Skip to content

Commit

Permalink
issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MiXaiLL76 committed Mar 4, 2024
1 parent a1258ef commit ff6e336
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
38 changes: 21 additions & 17 deletions faster_coco_eval/core/faster_eval_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion faster_coco_eval/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
__version__ = "1.4.2"
__version__ = "1.4.3"
__author__ = "MiXaiLL76"
3 changes: 3 additions & 0 deletions history.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit ff6e336

Please sign in to comment.