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

Google coral dev board - object detection using Yolo #868

Open
MECHAAMER opened this issue Oct 10, 2024 · 13 comments
Open

Google coral dev board - object detection using Yolo #868

MECHAAMER opened this issue Oct 10, 2024 · 13 comments
Labels
comp:model Model related isssues Hardware:Dev Board Coral Dev Board issues

Comments

@MECHAAMER
Copy link

Hello everyone,

I'm working on training a Yolo model for object detection and plan to use a Google Coral Dev Board for inference. As the Coral documentation recommends, the model should be in the TFLite format with 8-bit quantization for optimal performance.

Thanks to Ultralytics, exporting the model to the required format is straightforward:

from ultralytics import YOLO
model = YOLO("pre_trained_model.pt")

# Export the model to TFLite Edge TPU format
model.export(format="edgetpu")

In the output, I see:

Number of operations that will run on Edge TPU: 425
Number of operations that will run on CPU: 24

My question is: Can I do anything to make all operations run on the TPU for faster processing?

Additionally, are there any other recommended models that might offer better accuracy and lower latency on a Google Coral board?

Thanks all.

@google-coral-bot google-coral-bot bot added comp:model Model related isssues Hardware:Dev Board Coral Dev Board issues labels Oct 10, 2024
@ajbolt69
Copy link

ajbolt69 commented Oct 10, 2024 via email

@MECHAAMER
Copy link
Author

MECHAAMER commented Oct 10, 2024

is it better than Yolov8n?

@ajbolt69
Copy link

ajbolt69 commented Oct 10, 2024 via email

@MECHAAMER
Copy link
Author

Thanks for reply, I am outside office now and don't have access to the test data, however the inference was slow, need 0.14 sec per frame. I think the inference will be faster if I can run all the ops in the TPU

@MECHAAMER
Copy link
Author

Yes I tired to run the Yolov8n, the accuracy almost good, but the latency high, 5.58 frames/second only, do you think mobilenet v2 ssd accuracy will be faster and more accurate?

@ajbolt69
Copy link

ajbolt69 commented Oct 13, 2024 via email

@MECHAAMER
Copy link
Author

I read this sentence on the coral official document:

"If part of your model executes on the CPU, you should expect a significantly degraded inference speed compared to a model that executes entirely on the Edge TPU. We cannot predict how much slower your model will perform in this situation, so you should experiment with different architectures and strive to create a model that is 100% compatible with the Edge TPU. That is, your compiled model should contain only the Edge TPU custom operation."

you suggest use mobilenet v2 ssd, do you have another recommendation for a models that can work 100% on the TPU (object detection use)?

@ajbolt69
Copy link

ajbolt69 commented Oct 13, 2024 via email

@MECHAAMER
Copy link
Author

thank you for your reply and time, I will try it and comeback with results.

@MECHAAMER
Copy link
Author

do you recommenced and training parameters for the Mobilenet v2 SSD? is there any link can help me ?

the link you attached recently explain how to use a pre-trained model, I want to train the model with my dataset.

@ajbolt69
Copy link

ajbolt69 commented Oct 13, 2024 via email

@MECHAAMER
Copy link
Author

ok thank you, do you recommend use EfficientDet or mobilenet for object detection?

@ajbolt69
Copy link

Hey sorry for the late reply, i would recommend the mobilenet since i have used it it uses the edge tpu well and runs at 30fps easily , 20ms inference time per frame , currently working on deploying a custom yolo model to the devboard and Rpi5 , would you like to connect separately? arinjay1402@gmail.com , thats my email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:model Model related isssues Hardware:Dev Board Coral Dev Board issues
Projects
None yet
Development

No branches or pull requests

2 participants