Skip to content

Fix cv2 version checking in motrackers.detectors.yolo.py #51

@taekim027

Description

@taekim027

Hello, wondering if the below line 26 in motrackers.detectors.yolo.py causes issues for anyone else.

        if cv2.__version__ == '4.6.0':
  1. Because import cv2 as cv, I get a NameError: name 'cv2' is not defined when using this file. I believe changing the line to use cv instead of cv2 should fix the issue.
  2. I believe the line should check for greater than or equal to 4.6.0. My version is 4.8.0 and I get IndexError: invalid index to scalar variable. when using the file as-is

TL;DR proposed fix:

        if cv.__version__ >= '4.6.0':

Thanks!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions