-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Always returning 100 detections with .tflite #529
Comments
Hi @aocz1 You should change this flag to smaller value (it is 100 if None): automl/efficientdet/model_inspect.py Line 69 in df12387
Also, if you want fast, the easy way is to use smaller images (the current input images are pretty big). |
Cheers, so the setting only needs to be changed when using model_inspect.py to generate the model files from the checkpoint? |
that's right |
@aocz1 Hi Ales, Is there a open source android app example for use with efficient det tflite? |
@zishanahmed08 Yes there are several example android apps using tensorflow lite, like here (https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android). Basically you would have to adapt the TFLiteObjectDetectionAPIModel class so that it can read your efficientdet model. The example app I've linked above has a model that returns the following arrays:
While our efficientdet model will return a single 3D array with dimensions of [1][MAX_BOXES][7]. Once you've mapped the results into the array, you can access the results programatically and process them however you wish. |
@aocz1 Alex, thanks for the info. Do you have fork with these changes? |
@aocz1 A gentle reminder |
@zishanahmed08 Apologies, I was out of office the last few days. I do not have a fork with the changes, however you can find some useful information about using EfficientDet with TensorflowLite on android in another issue #533 If you're looking to learn about running a tflite model on android, I would suggest building and having a play around with https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android and look to gain an understanding of how the code works. Once you understand how it works, then it's a matter of changing some of the variables (such as input size) and the output array in the TFLiteObjectDetectionAPIModel class to match your own efficientdet model. |
@mingxingtan |
@Abdktefane I recently made some changes that invalid those options. Will be fixed in db40ab7 |
I've successfully managed to train and export models to .tflite with this library, though it appears as though the shape returned with .tflite is [1, 100, 7]. I would like to return less detection's in order to speed up the inference time on mobile devices, is there a way to do this? I have already tried using the hparam "max_instances_per_image", but that doesn't seem to change anything.
The text was updated successfully, but these errors were encountered: