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

yolov5 failed to work in esp32cam #13517

Open
Sadek-21 opened this issue Feb 21, 2025 · 4 comments
Open

yolov5 failed to work in esp32cam #13517

Sadek-21 opened this issue Feb 21, 2025 · 4 comments
Labels
detect Object Detection issues, PR's embedded Pertaining to IOT or low-power devices question Further information is requested

Comments

@Sadek-21
Copy link

first sorry for my simple English

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

@UltralyticsAssistant UltralyticsAssistant added detect Object Detection issues, PR's embedded Pertaining to IOT or low-power devices question Further information is requested labels Feb 21, 2025
@UltralyticsAssistant
Copy link
Member

👋 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:

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

YOLOv5 CI

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! 😊

@pderrenger
Copy link
Member

@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.

@Sadek-21
Copy link
Author

thank you so much ill try it and ill tel you if its work thank you

@pderrenger
Copy link
Member

@Sadek-21 glad to help! For ESP32-CAM deployments, consider that YOLOv5 models might be too computationally heavy for this hardware. We recommend exploring:

  1. Ultra-lightweight model architectures better suited for microcontrollers
  2. Offloading inference to a more powerful companion device/server
  3. The Ultralytics YOLOv5 Export Competition Winners showcase edge-optimized deployments that might inspire alternative approaches.

Let us know how it goes! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
detect Object Detection issues, PR's embedded Pertaining to IOT or low-power devices question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants