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

Can I load YOLOv5 model without Ultralytics #13013

Closed
1 task done
Munia-AK opened this issue May 15, 2024 · 3 comments
Closed
1 task done

Can I load YOLOv5 model without Ultralytics #13013

Munia-AK opened this issue May 15, 2024 · 3 comments
Labels
question Further information is requested

Comments

@Munia-AK
Copy link

Search before asking

Question

I trained my yolov5 model and I want to use it for real time detection on Jetson Nano
I need to use a CSI camera, which needs Gstreamer support in OpenCV. To provide this support, I need to build OpenCV on Jetson which has Python 3.6 as the default interpreter.
I know that installing Ultralytics requires python >= 3.8 but installing python 3.8 on Jetson won't solve the problem as OpenCV build happens with version 3.6
so in order to be able to use the CSI camera I need python 3.6 which is not supported by Ultralytics

So, my question is whether there's a way to load YOLOv5 model without installing Ultralytics ? before one or two years, I was able to do this but now I can't
Otherwise, I will just use USB camera ... :(

Additional

No response

@Munia-AK Munia-AK added the question Further information is requested label May 15, 2024
@glenn-jocher
Copy link
Member

@Munia-AK hi there! 😊

Loading the YOLOv5 model without the Ultralytics package directly isn't supported as the model and the library are tightly integrated. It's essential to use our software to ensure all features and functionalities of YOLOv5 work correctly.

However, you could consider using a virtual environment with Python 3.8 or later while still using Python 3.6 for OpenCV in another environment on your Jetson Nano. This could potentially help you solve the compatibility issues without needing to compromise on the camera input or the performance of YOLOv5.

Let me know if this solution helps or if you have any more questions!

@Munia-AK
Copy link
Author

Munia-AK commented May 16, 2024

Hello @glenn-jocher! Thank you for your quick response
I tried doing this but since I'm using Jetson Nano, Python 3.6 is being the default interpreter so even when installing python3.8 and making it as default interpreter I still can't import opencv for python3.8
I don't know if I'm missing something but according to what I found in the NVIDIA forums, Jet Pack 4 won't support installing packages for python 3.8, so when I'm building OpenCV using the shell script that JetsonHacks repository is providing I saw that inside the script there are these lines:

Python 2.7

sudo apt-get install -y python-dev python-numpy python-py python-pytest

Python 3.6

sudo apt-get install -y python3-dev python3-numpy python3-py python3-pytest

so I tried replacing python3 with python 3.8 but I get the error mentioning that the wanted packages can't be found
I will try find a solution for the problem otherwise I will just change to YOLOv4
have a nice day!

@glenn-jocher
Copy link
Member

Hello @Munia-AK! 🌟

It seems like the environment constraints on the Jetson Nano are indeed quite challenging. If the package installation persists to be an issue with Python 3.8, and modifying the setup scripts isn’t solving it, an alternate might be to utilize Docker containerization where you could manage different Python environments more flexibly.

Alternatively, redirecting to YOLOv4 is a practical route if it aligns better with the system constraints you're dealing with.

Best of luck, and don't hesitate to reach out if you have further questions or need additional assistance! Have a great day! 😊

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

No branches or pull requests

2 participants