title: Using MobileNet v3 for Object Detection in TensorFlow Lite
body: <p>I've been trying to get this working on an android device for a while now, but I can't get the model to make any detections.</p>
  
  <p>I'm using the sample code that google provides for object detection: <a href="https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android" rel="nofollow noreferrer">https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android</a>
  and trying to get it to run with a pre-trained model for mobilenet v3, specifically the .tflite file in "ssd_mobilenet_v3_large_coco", downloaded from here: <a href="https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md" rel="nofollow noreferrer">https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md</a></p>
  
  <p>Whenever I run the model, it always returns confidence scores for every category no greater than 10^-15, i.e., far too low to constitute a detection. The code was working fine with the old mobilenet v1 model, and since this model is the only thing I'm changing I suspect that I must be using the new model wrong.</p>
  
  <p>I'm wondering if anyone has been able to successfully use this new model for object detection, and if so how they did it. This is the way I'm trying to do it now:</p>
  
  <p>1.) Taking the aforementioned sample code provided by google, I've replaced the model they use with the .tflite file with the mobilenet v3 .tflite model. (and changing the build.gradle file accordingly)</p>
  
  <p>2.) I've set TF_OD_API_INPUT_SIZE = 320 (in DetectorActivity.java)</p>
  
  <p>3.) I've set NUM_DETECTIONS = 2034 (in TFLiteObjectDetectionAPIModel.java)</p>
  
  <p>4.) I've used 2 float arrays for the detection output, one for detection confidences of shape [1][NUM_DETECTIONS][91] and the other for boxes of shape [1][NUM_DETECTIONS][1][4]</p>
  
  <p>Those are essentailly the only changes I've made. Cheers for any suggestions. </p>