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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video_object_detection.py issue #19

Open
lweingart opened this issue Sep 24, 2023 · 1 comment
Open

video_object_detection.py issue #19

lweingart opened this issue Sep 24, 2023 · 1 comment

Comments

@lweingart
Copy link

Hello,

I simply cloned the repo and tried to run the video_objet_detection.py, but it directly fails with:

$ python3 video_object_detection.py
Traceback (most recent call last):
  File "video_object_detection.py", line 4, in <module>
    from yolov8 import YOLOv8
  File "/home/jetson/git/ONNX-YOLOv8-Object-Detection/yolov8/__init__.py", line 1, in <module>
    from .YOLOv8 import YOLOv8
  File "/home/jetson/git/ONNX-YOLOv8-Object-Detection/yolov8/YOLOv8.py", line 6, in <module>
    from yolov8.utils import xywh2xyxy, draw_detections, multiclass_nms
  File "/home/jetson/git/ONNX-YOLOv8-Object-Detection/yolov8/utils.py", line 108, in <module>
    def draw_box( image: np.ndarray, box: np.ndarray, color: tuple[int, int, int] = (0, 0, 255),
TypeError: 'type' object is not subscriptable

I had to remove the type description to make it work (i.e. color: tuple[int, int, int] = (0, 0, 255) turned into color=(0, 0, 255)

Maybe there is a way to fix this that I'm not aware of yet ?

Cheers

@michael1309
Copy link

For older python version like 3.8 use the following modifications for utils.py:

  1. Add from typing import Tuple in the file header
  2. Replace tuple with Tuple in draw_box and draw_text.

Which Python version do you use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants