From ff6e3369a5a3405f659b1f969ebdcc471ff3b4a1 Mon Sep 17 00:00:00 2001 From: MiXaiLL76 Date: Tue, 5 Mar 2024 01:32:39 +0300 Subject: [PATCH] issue fix --- .github/workflows/linter.yml | 2 +- faster_coco_eval/core/faster_eval_api.py | 38 +++++++++++++----------- faster_coco_eval/version.py | 2 +- history.md | 3 ++ 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index a07e3a1..f1eabdd 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -15,7 +15,7 @@ jobs: python-version: "3.x" - name: Install dependencies - run: pip3 install flake8 black[jupyter] isort + run: pip3 install flake8==7.0.0 black==24.2.0 isort==5.13.2 - name: Lint with flake8 run: make linter \ No newline at end of file diff --git a/faster_coco_eval/core/faster_eval_api.py b/faster_coco_eval/core/faster_eval_api.py index d7921f9..19b5a63 100644 --- a/faster_coco_eval/core/faster_eval_api.py +++ b/faster_coco_eval/core/faster_eval_api.py @@ -148,33 +148,37 @@ def accumulate(self): self.eval["counts"] ) + self.matched = False try: - self.detection_matches = np.vstack( - np.array(self.eval["detection_matches"]).reshape( - self.eval["counts"][0], self.eval["counts"][3], -1 + if self.extra_calc: + self.detection_matches = np.vstack( + np.array(self.eval["detection_matches"]).reshape( + self.eval["counts"][0], self.eval["counts"][3], -1 + ) ) - ) - assert self.detection_matches.shape[1] == len(self.cocoDt.anns) + assert self.detection_matches.shape[1] <= len(self.cocoDt.anns) - self.ground_truth_matches = np.vstack( - np.array(self.eval["ground_truth_matches"]).reshape( - self.eval["counts"][0], self.eval["counts"][3], -1 + self.ground_truth_matches = np.vstack( + np.array(self.eval["ground_truth_matches"]).reshape( + self.eval["counts"][0], self.eval["counts"][3], -1 + ) + ) + assert self.ground_truth_matches.shape[1] == len( + self.cocoGt.anns ) - ) - assert self.ground_truth_matches.shape[1] == len(self.cocoGt.anns) - self.ground_truth_orig_id = np.vstack( - np.array(self.eval["ground_truth_orig_id"]).reshape( - self.eval["counts"][0], self.eval["counts"][3], -1 + self.ground_truth_orig_id = np.vstack( + np.array(self.eval["ground_truth_orig_id"]).reshape( + self.eval["counts"][0], self.eval["counts"][3], -1 + ) + ) + assert self.ground_truth_orig_id.shape[1] == len( + self.cocoGt.anns ) - ) - assert self.ground_truth_orig_id.shape[1] == len(self.cocoGt.anns) - if self.extra_calc: self.math_matches() self.matched = True except Exception as e: logger.error("{} math_matches error: ".format(e), exc_info=True) - self.matched = False toc = time.time() diff --git a/faster_coco_eval/version.py b/faster_coco_eval/version.py index 4257c09..f59b411 100644 --- a/faster_coco_eval/version.py +++ b/faster_coco_eval/version.py @@ -1,2 +1,2 @@ -__version__ = "1.4.2" +__version__ = "1.4.3" __author__ = "MiXaiLL76" diff --git a/history.md b/history.md index c06a31f..2544503 100644 --- a/history.md +++ b/history.md @@ -1,6 +1,9 @@ # history +## v1.4.3 +- [x] fix [issue](https://github.com/MiXaiLL76/faster_coco_eval/issues/19) + ## v1.4.2 - [x] append Auto-formatters - [x] append py36 support