raweggish commited on
Commit
765ac56
1 Parent(s): 68ba60a

Fix input image v3

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -4,7 +4,6 @@ import requests
4
  import os
5
  import tensorflow as tf
6
  import numpy as np
7
- from gradio.inputs import Image as GrImage
8
 
9
  file_urls = [
10
  'https://drive.google.com/file/d/1dxNKawyagazR9TbxT6Fbla0opLqkROFG/view?usp=sharing',
@@ -50,7 +49,9 @@ def predict_with_tf_model(image):
50
 
51
  return output
52
 
53
- def show_preds_image(image):
 
 
54
  # Perform inference using the TensorFlow model
55
  output = predict_with_tf_model(image)
56
 
@@ -59,7 +60,7 @@ def show_preds_image(image):
59
  return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
60
 
61
  inputs_image = [
62
- GrImage(type="pil", label="Input Image"),
63
  ]
64
  outputs_image = [
65
  gr.Image(type="numpy", label="Output Image"),
 
4
  import os
5
  import tensorflow as tf
6
  import numpy as np
 
7
 
8
  file_urls = [
9
  'https://drive.google.com/file/d/1dxNKawyagazR9TbxT6Fbla0opLqkROFG/view?usp=sharing',
 
49
 
50
  return output
51
 
52
+ def show_preds_image(image_path):
53
+ image = cv2.imread(image_path)
54
+
55
  # Perform inference using the TensorFlow model
56
  output = predict_with_tf_model(image)
57
 
 
60
  return cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
61
 
62
  inputs_image = [
63
+ gr.Image(type="filepath", label="Input Image"),
64
  ]
65
  outputs_image = [
66
  gr.Image(type="numpy", label="Output Image"),