Skip to content

Commit

Permalink
Fix an IndexError edge case (#84)
Browse files Browse the repository at this point in the history
There was an index error that occurs sometimes when running a custom edge tpu model. Disagreement between count and len(scores). Confirmed that this resolves the bug
  • Loading branch information
usmank13 authored Mar 1, 2024
1 parent 693f255 commit 46f06c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pycoral/adapters/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,4 @@ def make(i):
bbox=BBox(xmin=xmin, ymin=ymin, xmax=xmax,
ymax=ymax).scale(sx, sy).map(int))

return [make(i) for i in range(count) if scores[i] >= score_threshold]
return [make(i) for i in range(len(scores)) if scores[i] >= score_threshold]

0 comments on commit 46f06c8

Please sign in to comment.