Skip to content

Commit

Permalink
Fix bug described in ultralytics#2106
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmaillot committed Jun 22, 2021
1 parent 0e4f4f7 commit 121d704
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import shutil

MODULE_NAME = "nanovare_yolov5"
VERSION = "0.2.1"
VERSION = "0.2.2"


def copy_to_module():
Expand Down
3 changes: 3 additions & 0 deletions utils/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,9 @@ def output_to_target(output, width, height):
for i, o in enumerate(output):
if o is not None:
for pred in o:
# sometimes output can be a list of tensor, so here ensure the type again, this fixes the error.
if isinstance(o, torch.Tensor):
o = o.cpu().numpy()
box = pred[:4]
w = (box[2] - box[0]) / width
h = (box[3] - box[1]) / height
Expand Down

0 comments on commit 121d704

Please sign in to comment.