-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Low FPS Issue with Camera Detection #35
Comments
Hello, Thank you for reaching out and providing details about the low FPS issue you're experiencing with the camera detection feature. To help improve the frame rate, here are a few suggestions:
If the issue persists, could you please provide a minimum reproducible example? This will help us better understand the problem and provide more specific guidance. You can find more information on creating a reproducible example here. Thank you for your cooperation, and I look forward to assisting you further! |
Hi @pderrenger , Thanks for your insights. I'd like to provide some details about my setup to further the discussion:
Your expertise and suggestions would be greatly appreciated! |
Hi @congngc, Thank you for providing additional details about your setup. Let's dive into each point to help you optimize your camera detection performance:
Additionally, if you encounter any specific issues or bugs, providing a minimum reproducible example can be incredibly helpful for us to diagnose and address the problem efficiently. You can find more information on creating a reproducible example here. Feel free to reach out if you have any further questions or need more assistance. We're here to help! 😊 |
Hi @pderrenger, |
Hi @congngc, Thank you for your detailed follow-up and for implementing the suggestions provided. It's great to see your proactive approach! Given that you've already optimized the model, delegate, device settings, and software, let's explore a few additional factors that might be affecting the performance:
If the issue persists, providing a minimum reproducible example would be incredibly helpful for us to diagnose the problem more effectively. You can find guidance on creating one here. Thank you for your patience and cooperation. We're committed to helping you achieve the best performance possible. If you have any further questions or need more assistance, feel free to reach out! 😊 |
@congngc can you share the specs of the device you are testing on ?. I think one of the many ways we can increase fps is to spawn new isolates/thread to handle camera inference, but this is a tricky process, since you want to have a synchronous real time effect of the the box appearing on screen, the inference engine make predictions. Myself, I tested on a quite low end device, honor x6a with 4GB RAM and an octacore cpu (mediatek helio). FPS is in the range of 1-3. I think it is an interesting challenge to look into, a slight improvement in algorithmic processes can win us some hardware magic. I will keep this issue updated on my work into fps optimisation. |
Did you have any success in increasing FPS ? |
I tried on Samsung S24 Ultra with quantized YOLOv5su model with 320x320 imgsz, got about 20fps |
Hello @sidewinderz0ne, Thank you for sharing your experience with the Samsung S24 Ultra and the quantized YOLOv5su model. Achieving 20 FPS with a 320x320 image size is a good benchmark, especially considering the computational demands of real-time object detection. Given the context, here are a few additional suggestions that might help further optimize performance:
If you have already tried these suggestions and the issue persists, it might be helpful to provide a minimum reproducible example. This can help us diagnose the problem more effectively. You can find guidance on creating one here. Thank you for your patience and cooperation. We're committed to helping you achieve the best performance possible. If you have any further questions or need more assistance, feel free to reach out! 😊 |
This is my device |
Hello @congngc, Thank you for sharing the specifications of your device. The Samsung Galaxy S21 is indeed a powerful device, and it should be capable of handling real-time object detection efficiently. Here are a few additional suggestions to help optimize the FPS:
If the issue persists, providing a minimum reproducible example would be incredibly helpful for us to diagnose the problem more effectively. You can find guidance on creating one here. Thank you for your patience and cooperation. We're committed to helping you achieve the best performance possible. If you have any further questions or need more assistance, feel free to reach out! 😊 |
Reducing the imgsz parameter of the quantized models seriously improves FPS at the cost of some accuracy. |
Thank you for your insightful comment! You're absolutely right—reducing the For those looking to implement this, here's a quick example of how you can adjust the # Example of setting the image size for inference
imgsz = 320 # Reduce this value to improve FPS, e.g., 320, 240, etc.
# Load your model with the specified image size
model = torch.hub.load('ultralytics/yolov5', 'yolov5s', pretrained=True)
model.imgsz = imgsz
# Perform inference
results = model(img) Additionally, if you haven't already, please ensure you are using the latest versions of the Ultralytics packages. Updates often include performance improvements and bug fixes that could further enhance your FPS. If you encounter any issues or have further questions, feel free to share more details. We're here to help! 😊 |
#71 PRed a kind of solution. I hope it gonna be helpful. 🙏 |
Thank you for your contribution! We'll review your PR and provide feedback soon. |
Hello,
I have implemented the example from this GitHub repository: https://github.com/ultralytics/yolo-flutter-app/tree/main/example. However, I am experiencing low frame rates with the camera detection feature, which ranges only from 12 to 20 FPS. Could you please advise on how I might improve the FPS to achieve better performance?
Thank you for your assistance.
Screen_Recording_20240625_092403.1.mp4
The text was updated successfully, but these errors were encountered: