-
Notifications
You must be signed in to change notification settings - Fork 106
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
Applying NMS to YOLOv5-exported TFlite Model #160
Comments
I do not have any experience with the model maker, so keep that in mind while reading this answer. I think adding an NMS layer to the model should be possible, but I am not sure how to actually do it. Here are the TF docs for NMS (I guess you need TF Select ops for this to work) and here a discussion about NMS with yolo. A second approach is for you to understand the output format of yolo v5 and implement NMS yourself. I implemented NMS for yolo v5 in dart, you can take a look if you want but it is very slow and should be implemented a different way (maybe in C). |
Hi there, thanks so much for your response. I'll have to assess my options and go from there. |
As per my understanding, NMS cannot be embedded in tflite models. So the NMS part will be stripped out when you convert the yolo to tflite. Hence the warning. You will get all the possible detections from tflite models. So you will have to do the NMS part after detection.
here is an NMS example in dart;
|
Hello All,
I am trying to use this (great) package for a Flutter app I am making, and I have run into a lot of issues using the tflite_model_maker. The best I've been able to get is training YOLOv5 on my dataset and then exporting it to TFLite.
When I apply NMS to the TFlite model when exporting it, I get an output shape like this:
However, when I load this into the flutter example app, I'm warned that this operation is not supported by TFLite.
When I export it without the --nms applied, this is the output shape:
(from Netron)
However, this obviously does not work directly with the output shape defined in this package.
I am no ML expert by any means so I am a bit lost about how to apply NMS to my TFLite model. From what I can understand, the tflite_model_maker package has some sort of postprocessing step to get the desired output, but I have yet to get that working (see tensorflow/tensorflow#62135).
Could someone give me some pointers on how to process the output tensor to use in my Flutter app?
The text was updated successfully, but these errors were encountered: