Add support for TFLite INT8 detection export#1968
Conversation
|
@adamp87 I tried your PR with my custom tolov7-tiny model and found that difference in bbox position. With the original model bbox was tight (close around the object) but with full_integer_quant.tflite model bbox was not so tight. For example with _float16.tflite model, I am facing the following error- |
|
You dont need to do the integer scaling and shifting if you use models like float16. I recommend you reading Tensorflow documentation on quantizing models. https://www.tensorflow.org/lite/performance/post_training_quantization |

This PR adds support to export a fixed model in ONNX format and convert with onnx2tf to quantized TFLite. It differs from the previous solutions, because it does not reimplement any of the nn blocks in TF, rather exports the PyTorch model to ONNX.
Quantization issues:
yolov7/models/tf.py
Lines 364 to 365 in f2439f8
Converted model:
Backward compatibility:
Demo:
Conclusion:
If you like this PR, please give a thumbs up and lets hope @AlexeyAB and @WongKinYiu will merge it.