Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyTorch Hub cv2 .save() .show() bug #2830

Closed
glenn-jocher opened this issue Apr 18, 2021 · 0 comments 路 Fixed by #2831
Closed

PyTorch Hub cv2 .save() .show() bug #2830

glenn-jocher opened this issue Apr 18, 2021 · 0 comments 路 Fixed by #2831
Labels
bug Something isn't working

Comments

@glenn-jocher
Copy link
Member

馃悰 Bug

.show() and .save() methods do not show bounding boxes for cv2-loaded images in the PyTorch Hub tutorial detailed example:

YOLOv5 馃殌 2021-4-15 torch 1.8.1 CPU
Downloading zidane.jpg...
100%|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 165k/165k [00:00<00:00, 7.90MB/s]
Downloading bus.jpg...
100%|鈻堚枅鈻堚枅鈻堚枅鈻堚枅鈻堚枅| 476k/476k [00:00<00:00, 12.2MB/s]
image 1/2: 720x1280 2 persons, 2 ties
image 2/2: 1080x810 4 persons, 1 bus
Speed: 11.3ms pre-process, 269.3ms inference, 1.4ms NMS per image at shape (2, 3, 640, 640)
Saved zidane.jpg,Traceback (most recent call last):
  File "<input>", line 21, in <module>
  File "/Users/glennjocher/.cache/torch/hub/ultralytics_yolov5_master/models/common.py", line 348, in save
    self.display(save=True, save_dir=save_dir)  # save results
  File "/Users/glennjocher/.cache/torch/hub/ultralytics_yolov5_master/models/common.py", line 325, in display
    plot_one_box(box, img, label=label, color=colors[int(cls) % 10])
  File "/Users/glennjocher/.cache/torch/hub/ultralytics_yolov5_master/utils/plots.py", line 62, in plot_one_box
    cv2.rectangle(img, c1, c2, color, thickness=tl, lineType=cv2.LINE_AA)
TypeError: argument for rectangle() given by name ('thickness') and position (4)
@glenn-jocher glenn-jocher added the bug Something isn't working label Apr 18, 2021
@glenn-jocher glenn-jocher linked a pull request Apr 18, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant