yolov5 failed to work in esp32cam
so I have this project for detecting objects and I use yolov5 to detect the object that I want and I do this step I try the code and its working in the cam in my laptop and now I want to detect with my ESP32-cam and the code didn't work in my esp32 it showing me video but its to slow and detecting the movement with delay and when I show in front of the espcam the object that I trained it didn't detected
Pleas if some one have an idea about this
👋 Hello @Sadek-21, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.
If this is a 🐛 Bug Report, please provide a minimum reproducible example (MRE) to help us debug it. This could include your code snippets, configuration details, and steps to reproduce the issue. Without more specifics, it’s challenging to identify the problem. For hardware limitations like those encountered with ESP32-Cam, please ensure to provide details about your deployment approach and environment.
If this is a custom training ❓Question, kindly share more context, including:
- Examples of your dataset and expected detection outputs
- Logs or outputs from the model when running on your ESP32-Cam device
- Details about the setup and any modifications you’ve made to the YOLOv5 code or configuration
Additionally, YOLOv5 is designed to run most efficiently on devices with high compute capabilities (like GPUs or TPUs). Microcontrollers like the ESP32-Cam may not handle the computational requirements of YOLOv5 effectively because of limited processing power, resulting in slow performance. For such use cases, you might also consider exploring model quantization or smaller versions of the model designed explicitly for edge devices.
Requirements
Python>=3.8.0 with all requirements.txt installed, and PyTorch>=1.8. To get started:
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
Environments
YOLOv5 runs in various computational environments. However, for environments with limited resources, explore lightweight inference solutions or optimized deployments. See below for verified environments where YOLOv5 runs efficiently:
- Notebooks with free GPU:
- Google Cloud Deep Learning VM. See GCP Quickstart Guide
- Amazon Deep Learning AMI. See AWS Quickstart Guide
- Docker Image. See Docker Quickstart Guide
For highly constrained environments like microcontrollers, look into options such as converting the YOLOv5 model to ONNX or TensorFlow Lite for edge deployments to optimize performance.
Status
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify the correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.
⚡ This is an automated response. An Ultralytics engineer will review your issue and provide further assistance soon. Let us know if you have additional details to share in the meantime! 😊
@Sadek-21 while YOLOv5 is effective on laptops, deploying it on an ESP32-CAM presents significant challenges due to the device's limited processing power and memory, as described in the article on deploying YOLOv5 with Neural Magic's DeepSparse, it highlights achieving GPU-class performance on CPUs, but even this might be too resource-intensive for an ESP32-CAM. Deploy Ultralytics YOLOv5 With Neural Magic’s DeepSparse for GPU-Class Performance on CPUs.
thank you so much ill try it and ill tel you if its work thank you
@Sadek-21 glad to help! For ESP32-CAM deployments, consider that YOLOv5 models might be too computationally heavy for this hardware. We recommend exploring:
- Ultra-lightweight model architectures better suited for microcontrollers
- Offloading inference to a more powerful companion device/server
- The Ultralytics YOLOv5 Export Competition Winners showcase edge-optimized deployments that might inspire alternative approaches.
Let us know how it goes! 🚀
@pderrenger Thank you so much for your suggestions and guidance!
I’m happy to share that I’ve managed to get everything working! the ESP32-CAM is successfully detecting objects with minimal delay. I also optimized the YOLOv5 model for edge deployment, which made a huge difference.
Your recommendation to look into lightweight model architectures and edge-optimized deployments was spot on, and it helped me solve the issue. Thank you again for your support—it means a lot!
@Sadek-21 Fantastic news! 🎉 We're thrilled to hear about your successful ESP32-CAM deployment with YOLOv5. Your achievement is a great example of edge optimization in action. If you're open to sharing your approach, consider posting a brief write-up in our GitHub Discussions to inspire others tackling similar edge deployment challenges. The community would benefit from your insights! Keep up the great work with Ultralytics YOLO!
@pderrenger Thank you so much for your kind words and encouragement! I’m really excited about the successful ESP32-CAM deployment with YOLOv5,YOLOv11s and I’m glad it resonates with the community. I’ve already shared the details of this project on LinkedIn and Twitter (X), so feel free to check it out there! If it’s helpful, I’d be happy to post a brief write-up in the GitHub Discussions as well to share my approach and insights with the community. Thanks again for your support, and I’m looking forward to contributing more!
@Sadek-21 Congratulations again on your ESP32-CAM deployment! 🚀 We'd love for you to share your write-up in GitHub Discussions - edge deployments like yours inspire our community. For others exploring similar projects, the Ultralytics YOLOv5 Export Competition Winners showcase innovative edge implementations that complement approaches like yours. Looking forward to your contribution!
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
- Docs: https://docs.ultralytics.com
- HUB: https://hub.ultralytics.com
- Community: https://community.ultralytics.com
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐