Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions analysisAPI/backgroundFalseNegErrors.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## imports
import os, time
import cv2
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.path as mplPath
from scipy.misc import imresize
import skimage.io as io

# package imports
Expand Down Expand Up @@ -146,7 +146,7 @@ def backgroundFalseNegErrors( coco_analyze, imgs_info, saveDir ):
grid = grid.reshape((ny,nx))

the_mask += np.array(grid, dtype=int)
segm_heatmap += imresize(the_mask,(128,128))
segm_heatmap += cv2.resize(the_mask,(128,128))

fig = plt.figure(figsize=(10,10))
ax = plt.subplot(111)
Expand Down
1 change: 0 additions & 1 deletion analysisAPI/backgroundFalsePosErrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.path as mplPath
from scipy.misc import imresize
import skimage.io as io

# package imports
Expand Down
3 changes: 2 additions & 1 deletion analysisAPI/localizationErrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def localizationErrors( coco_analyze, imgs_info, saveDir ):
plt.close()

fig = plt.figure(figsize=(15,15)); plt.axis('off')
I = io.imread('./latex/manikin.jpg')
filepath = os.path.dirname(os.path.realpath(__file__)) + "/"
I = io.imread(filepath + '../latex/manikin.jpg')
plt.imshow(I); ax = plt.gca(); ax.set_autoscale_on(False)

rects_d = {}
Expand Down
1 change: 0 additions & 1 deletion analysisAPI/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import matplotlib.path as mplPath
from matplotlib.collections import PatchCollection
from matplotlib.patches import Polygon
from scipy.misc import imresize
import skimage.io as io

"""
Expand Down
2 changes: 1 addition & 1 deletion latex/report_template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
% HUMAN SKELETON COLOR CODING
\section{Human Pose and Skeleton Color Coding}
\begin{wrapfigure}{l}{0.5\textwidth}
\includegraphics[width=\linewidth]{./latex/color_coding.pdf}
\includegraphics[width=\linewidth]{color_coding.pdf}
\caption{ {\small \textbf{Detection's Skeleton Color Coding.}}}
\end{wrapfigure}
We adopt the following color coding when visualizing an algorithm's keypoint detections:
Expand Down
8 changes: 4 additions & 4 deletions pycocotools/cocoeval.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,8 @@ def setDetParams(self):
self.imgIds = []
self.catIds = []
# np.arange causes trouble. the data point on arange is slightly larger than the true value
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
self.recThrs = np.linspace(.0, 1.00, np.round((1.00 - .0) / .01) + 1, endpoint=True)
self.iouThrs = np.linspace(.5, 0.95, int(np.round((0.95 - .5) / .05) + 1), endpoint=True)
self.recThrs = np.linspace(.0, 1.00, int(np.round((1.00 - .0) / .01) + 1), endpoint=True)
self.maxDets = [1, 10, 100]
self.areaRng = [[0 ** 2, 1e5 ** 2], [0 ** 2, 32 ** 2], [32 ** 2, 96 ** 2], [96 ** 2, 1e5 ** 2]]
self.areaRngLbl = ['all', 'small', 'medium', 'large']
Expand All @@ -616,8 +616,8 @@ def setKpParams(self):
self.imgIds = []
self.catIds = []
# np.arange causes trouble. the data point on arange is slightly larger than the true value
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
self.recThrs = np.linspace(.0, 1.00, np.round((1.00 - .0) / .01) + 1, endpoint=True)
self.iouThrs = np.linspace(.5, 0.95, int(np.round((0.95 - .5) / .05) + 1), endpoint=True)
self.recThrs = np.linspace(.0, 1.00, int(np.round((1.00 - .0) / .01) + 1), endpoint=True)
self.maxDets = [20]
self.areaRng = [[0 ** 2, 1e5 ** 2], [32 ** 2, 96 ** 2], [96 ** 2, 1e5 ** 2]]
self.areaRngLbl = ['all', 'medium', 'large']
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
colour
numpy
matplotlib
matplotlib
opencv-python
9 changes: 6 additions & 3 deletions run_analysis.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## general imports
import os, sys, json, datetime, jinja2
import os, shutil, sys, json, datetime, jinja2
from jinja2 import Template

## COCO imports
Expand All @@ -19,6 +19,7 @@ def main():
if len(sys.argv) != 6:
raise ValueError("Please specify args: $> python run_analysis.py [annotations_path] [detections_path] [save_dir] [team_name] [version_name]")

filepath = os.path.dirname(os.path.realpath(__file__)) + "/"
latex_jinja_env = jinja2.Environment(
block_start_string = '\BLOCK{',
block_end_string = '}',
Expand All @@ -30,7 +31,7 @@ def main():
line_comment_prefix = '%#',
trim_blocks = True,
autoescape = False,
loader = jinja2.FileSystemLoader(os.path.abspath('./latex/'))
loader = jinja2.FileSystemLoader(filepath + 'latex/')
)
template = latex_jinja_env.get_template('report_template.tex')
template_vars = {}
Expand Down Expand Up @@ -78,6 +79,7 @@ def main():

## initialize COCO analyze api
coco_analyze = COCOanalyze(coco_gt, coco_dt, 'keypoints')
coco_analyze.params.areaRng = [[0 ** 2, 1e5 ** 2], [32 ** 2, 96 ** 2], [96 ** 2, 1e5 ** 2]]
if teamName == 'fakekeypoints100':
imgIds = sorted(coco_gt.getImgIds())[0:100]
coco_analyze.cocoEval.params.imgIds = imgIds
Expand Down Expand Up @@ -119,9 +121,10 @@ def main():
paths = sizeSensitivity( coco_analyze, .75, saveDir )
template_vars.update(paths)

output_report = open('./%s_performance_report.tex'%teamName, 'w')
output_report = open("{}/{}_performance_report.tex".format(saveDir, teamName), 'w')
output_report.write( template.render(template_vars) )
output_report.close()
shutil.copyfile(filepath + 'latex/color_coding.pdf', os.path.join(saveDir, 'color_coding.pdf'))

if __name__ == '__main__':
main()