diff --git a/Makefile b/Makefile index 5910edb..ebed4c9 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ all: # install pycocotools locally pip install -r requirements.txt - python setup.py build_ext --inplace + python3 setup.py build_ext --inplace rm -rf build install: # install pycocotools to the Python site-packages - python setup.py build_ext install - rm -rf build \ No newline at end of file + python3 setup.py build_ext install + rm -rf build diff --git a/README.md b/README.md index a614f16..c9eac1f 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,12 @@ Use the Makefile to install the coco-analyze api: ### Usage To run the extended multi-instance keypoint estimation error analysis: update the paths of the detections and annotations and execute the command line. - [annFile] -> ./annotations/keypoints_val2014.json + [annFile] -> ./annotations/person_keypoints_val2014.json [dtsFile] -> ./detections/fakekeypoints100_keypoints_val2014_results.json [saveDir] -> ./results/fakekeypoints100 [teamName] -> fakekeypoints100 [version] -> 1.0 - $ python run_analysis.py [annFile] [dtsFile] [saveDir] [teamName] [version] + $ python3 run_analysis.py [annFile] [dtsFile] [saveDir] [teamName] [version] ### Results - A summary file called `[teamName]_performance_report.tex` will be created once the analysis is complete. diff --git a/analysisAPI/backgroundFalseNegErrors.py b/analysisAPI/backgroundFalseNegErrors.py index 814624f..95e6ad8 100644 --- a/analysisAPI/backgroundFalseNegErrors.py +++ b/analysisAPI/backgroundFalseNegErrors.py @@ -3,7 +3,8 @@ import numpy as np import matplotlib.pyplot as plt import matplotlib.path as mplPath -from scipy.misc import imresize +#from scipy.misc import imresize +from skimage.transform import resize as imresize import skimage.io as io # package imports diff --git a/analysisAPI/backgroundFalsePosErrors.py b/analysisAPI/backgroundFalsePosErrors.py index 9744b5a..edef8db 100644 --- a/analysisAPI/backgroundFalsePosErrors.py +++ b/analysisAPI/backgroundFalsePosErrors.py @@ -3,7 +3,8 @@ import numpy as np import matplotlib.pyplot as plt import matplotlib.path as mplPath -from scipy.misc import imresize +#from scipy.misc import imresize +from skimage.transform import resize as imresize import skimage.io as io # package imports diff --git a/analysisAPI/utilities.py b/analysisAPI/utilities.py index 5c8ede1..41d7580 100644 --- a/analysisAPI/utilities.py +++ b/analysisAPI/utilities.py @@ -6,7 +6,8 @@ import matplotlib.path as mplPath from matplotlib.collections import PatchCollection from matplotlib.patches import Polygon -from scipy.misc import imresize +#from scipy.misc import imresize +from skimage.transform import resize as imresize import skimage.io as io """ diff --git a/pycocotools/cocoeval.py b/pycocotools/cocoeval.py index da2756b..f61308d 100644 --- a/pycocotools/cocoeval.py +++ b/pycocotools/cocoeval.py @@ -447,6 +447,7 @@ def accumulate(self, p = None): tps = np.logical_and( dtm, np.logical_not(dtIg) ) fps = np.logical_and(np.logical_not(dtm), np.logical_not(dtIg) ) + np.float = float #For Numpy > 1.20 tp_sum = np.cumsum(tps, axis=1).astype(dtype=np.float) fp_sum = np.cumsum(fps, axis=1).astype(dtype=np.float) for t, (tp, fp) in enumerate(zip(tp_sum, fp_sum)): @@ -616,8 +617,13 @@ 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) + #Switch from : + #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) + #To : + 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) + #Using this advice : https://github.com/matteorr/coco-analyze/issues/28 self.maxDets = [20] self.areaRng = [[0 ** 2, 1e5 ** 2], [32 ** 2, 96 ** 2], [96 ** 2, 1e5 ** 2]] self.areaRngLbl = ['all', 'medium', 'large'] diff --git a/requirements.txt b/requirements.txt index dce60de..b4458db 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,8 @@ +pillow +cython +scipy colour numpy -matplotlib \ No newline at end of file +matplotlib +jinja2 +scikit-image