How to benchmark TFLite object detection model
@mikel-brostrom Thanks for reporting the issue.

The benchmarking tool can be used with any tflite model. The example of Performance benchmark numbers for [starter model](https://tfhub.dev/tensorflow/lite-model/ssd_mobilenet_v1/1/metadata/1?lite-format=tflite) with SSD Mobilenet are generated with the tool [described here](https://www.tensorflow.org/lite/performance/benchmarks). Please refer to this [section](https://www.tensorflow.org/lite/examples/object_detection/overview#performance_benchmarks) for the same.

The [Model Customization](https://www.tensorflow.org/lite/examples/object_detection/overview#model_customization) section provides the information about choosing the model to customize and fine tuning the models on custom data.

Thanks


 Ok. Then I guess that the inference process fails because of the different output in each model... The output of the SSD Mobilenet you provided:

![Screenshot from 2023-03-16 14-20-20](https://user-images.githubusercontent.com/18719680/225629569-49b7bb62-ec95-41cd-a756-c9201246080f.png)

My model's output:

![Screenshot from 2023-03-16 14-21-18](https://user-images.githubusercontent.com/18719680/225629971-31e3a5d4-f5c2-40d8-987c-42d7aa208b03.png)
 Is there any tutorial on how to convert standard object detector output shape (bs, N, 5 + nr of classe) to what basically all the TFLite object detection tools in this repo expects? Hi @mikel-brostrom 

The TFLite provides a way to use custom models and benchmark them. 

Please check the [Model Customization](https://www.tensorflow.org/lite/examples/object_detection/overview#model_customization) and also a way of TF2 object detection models to convert into TF Lite [here](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_on_mobile_tf2.md#running-tf2-detection-api-models-on-mobile) and let us know if it helps.

Feel free to close the issue if it is resolved.

Thanks. > Please check the [Model Customization](https://www.tensorflow.org/lite/examples/object_detection/overview#model_customization) and also a way of TF2 object detection models to convert into TF Lite [here](https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/running_on_mobile_tf2.md#running-tf2-detection-api-models-on-mobile) and let us know if it helps.

Thanks. This was really helpful @pjpratik. I think it is unclear whether the benchmark App support different type of models or not. I would suggest that you add the customization information under https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/tools/benchmark @mikel-brostrom Glad it helped. Feel free to create a PR if you are interested.

Can you please close the issue if it is resolved?

Thanks.
 Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59997">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/59997">No</a>

It seems that only classification models can be benchmarked. There is no explanation for how to run benchmarking on `TFLite` object detection models under https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/tools/benchmark. Could anybody point me into the right direction to get the modifications needed to run the `TFLite` benchmark on my custom `TFLite` object detection model?

After running:

```bash
➜  tensorflow git:(master) adb shell am start -S \                                    
  -n org.tensorflow.lite.benchmark/.BenchmarkModelActivity \
  --es args '"--graph=/data/local/tmp/my_custom_object_detection_float32.tflite \
  --num_threads=4"'
```

When I check logcat:

```bash
➜  tensorflow git:(master) adb logcat | grep "Inference timings in us"
```

I see:

```shell
03-15 14:00:51.294 12836 12836 I tflite  : Inference timings in us: Init: 36618, First inference: 1530248, Warmup (avg): 1.53025e+06, Inference (avg): 1.49712e+06
03-15 14:13:43.409 13393 13393 I tflite  : Inference timings in us: Init: 33412, First inference: 307818, Warmup (avg): 297955, Inference (avg): 333826
```

Basically, my model inference fails and it falls back onto the classification model


<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Support

### Have you reproduced the bug with TF nightly?

No

### Source

source

### Tensorflow Version

2.11.0

### Custom Code

No

### OS Platform and Distribution

Linux Ubuntu 18.04

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/Compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current Behaviour?

### Standalone code to reproduce the issue

```shell
The app falls back onto the classification model once the object detection one fails:

03-15 14:00:51.294 12836 12836 I tflite  : Inference timings in us: Init: 36618, First inference: 1530248, Warmup (avg): 1.53025e+06, Inference (avg): 1.49712e+06
03-15 14:13:43.409 13393 13393 I tflite  : Inference timings in us: Init: 33412, First inference: 307818, Warmup (avg): 297955, Inference (avg): 333826
```


### Relevant log output

_No response_</details>