rbarman commited on
Commit
281556c
·
1 Parent(s): 6bad718

remove conversion

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -17,11 +17,13 @@ output_layer = compiled_model.output(0)
17
  #Inference
18
  #####
19
  def predict(img: np.ndarray) -> str:
 
20
 
21
  # The MobileNet model expects images in RGB format.
22
- image = cv2.cvtColor(img, code=cv2.COLOR_BGR2RGB)
 
23
  # Resize to MobileNet image shape.
24
- input_image = cv2.resize(src=image, dsize=(224, 224))
25
  # Reshape to model input shape.
26
  input_image = np.expand_dims(input_image, 0)
27
 
 
17
  #Inference
18
  #####
19
  def predict(img: np.ndarray) -> str:
20
+ # input: numpy array of image in RGB (see defaults for https://www.gradio.app/docs/#image)
21
 
22
  # The MobileNet model expects images in RGB format.
23
+ #image = cv2.cvtColor(img, code=cv2.COLOR_BGR2RGB)
24
+ #image = cv2.cvtColor(img, code=cv2.COLOR_BGR2RGB)
25
  # Resize to MobileNet image shape.
26
+ input_image = cv2.resize(src=img, dsize=(224, 224))
27
  # Reshape to model input shape.
28
  input_image = np.expand_dims(input_image, 0)
29