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

Latest Yolov4 Models Not Working #300

Closed
Tracked by #306 ...
rogerquake opened this issue Nov 12, 2021 · 11 comments · Fixed by #306
Closed
Tracked by #306 ...

Latest Yolov4 Models Not Working #300

rogerquake opened this issue Nov 12, 2021 · 11 comments · Fixed by #306

Comments

@rogerquake
Copy link

I have been trying to load in the latest Yolov4 models below to Viseron for testing and when I do, no objects get detected.

https://github.com/AlexeyAB/darknet/releases/tag/yolov4

The scaled Yolov4 model seems interesting, so was trying to see if that would work.

@roflcoopter
Copy link
Owner

Great idea, hadn't seen those!
I need to upgrade OpenCV for it to work, will do so soon!

@rogerquake
Copy link
Author

That would be awesome, thanks! I updated the OpenCV version to the latest release, 4.5.4 in the .env file and compiled the OpenCV docker container from source, but it still didn't work.

@roflcoopter
Copy link
Owner

Did you also build the main image? They are chained together

@rogerquake
Copy link
Author

Yeah, built the OpenCV image followed by the main image. From reading the github threads for OpenCV, it's hard to tell if the required updates are actually in the latest build or not. opencv/opencv#18975

@roflcoopter
Copy link
Owner

Seems to be in 4.5.4 according to this comment

@rogerquake
Copy link
Author

I see this error in the debug log when it attempts to perform object detection with the yolov4-csp weight and cfg:

viseron | Exception in thread object_detection:
viseron | Traceback (most recent call last):
viseron | File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
viseron | self.run()
viseron | File "/usr/lib/python3.8/threading.py", line 870, in run
viseron | self._target(*self._args, **self._kwargs)
viseron | File "/src/viseron/detector/init.py", line 105, in object_detection
viseron | frame_to_scan.frame.objects = self.object_detector.return_objects(
viseron | File "/src/viseron/detector/darknet/init.py", line 108, in return_objects
viseron | objects = self.post_process(labels, confidences, boxes)
viseron | File "/src/viseron/detector/darknet/init.py", line 81, in post_process
viseron | self.labels[int(label[0])],
viseron | IndexError: invalid index to scalar variable.

@roflcoopter
Copy link
Owner

Seems the code has to change as well, see here

Not sure how to apply it right now tho but i will get to it soon!

@ozett
Copy link

ozett commented Dec 1, 2021

let us know if when can try yolo4...

@roflcoopter
Copy link
Owner

Will be in #306 when its done

@roflcoopter roflcoopter mentioned this issue Dec 6, 2021
43 tasks
@ozett
Copy link

ozett commented Dec 6, 2021

i will follow the progess on #306
thanks for notifying here 🤝

@roflcoopter roflcoopter linked a pull request Dec 6, 2021 that will close this issue
43 tasks
@roflcoopter roflcoopter mentioned this issue Oct 21, 2022
43 tasks
@roflcoopter
Copy link
Owner

YOLOv4 and even YOLOv7 is available in v2

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

Successfully merging a pull request may close this issue.

3 participants