title: How to pass image to tflite model in android
body: <p>I have converted a Yolo model to .tflite for use in android. This is how it was used in python -</p>
  <pre><code>net = cv2.dnn.readNet(&quot;yolov2.weights&quot;, &quot;yolov2.cfg&quot;)
  classes = []
  with open(&quot;yolov3.txt&quot;, &quot;r&quot;) as f:
      classes = [line.strip() for line in f.readlines()]
  layer_names = net.getLayerNames()
  output_layers = [layer_names[i[0] - 1] for i in net.getUnconnectedOutLayers()]
  colors = np.random.uniform(0, 255, size=(len(classes), 3))
  
  cap= cv2.VideoCapture(0)
  
  
  while True:
      _,frame= cap.read()
      height,width,channel= frame.shape
      blob = cv2.dnn.blobFromImage(frame, 0.00392, (320, 320), (0, 0, 0), True, crop=False)
      net.setInput(blob)
      outs = net.forward(output_layers)
      for out in outs:
          for detection in out:
              scores = detection[5:]
              class_id = np.argmax(scores)
              confidence = scores[class_id]
              if confidence &gt; 0.2:
              # Object detected
                  center_x = int(detection[0] * width)
                  center_y = int(detection[1] * height)
                  w = int(detection[2] * width)
                  h = int(detection[3] * height)
                  # Rectangle coordinates
                  x = int(center_x - w / 2)
                  y = int(center_y - h / 2)
  </code></pre>
  <p>I used netron <a href="https://github.com/lutzroeder/netron" rel="nofollow noreferrer">https://github.com/lutzroeder/netron</a> to visualize the model. The input is described as name: inputs,
  type: float32[1,416,416,3],
  quantization: 0 ≤ q ≤ 255,
  location: 399
  and the output as
  name: output_boxes,
  type: float32[1,10647,8],
  location: 400.</p>
  <p>My problem is regarding using this model in android. I have loaded the model in &quot;Interpreter tflite&quot;, I am getting the input frames from the camera in byte[] format. How can I convert it into the required input for tflite.run(input, output)?</p>