basementparking commited on
Commit
3cfb968
·
verified ·
1 Parent(s): 0af0b1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -107,8 +107,7 @@ def setup_model():
107
 
108
  # Function to segment image
109
  def segment_image(image):
110
-
111
- image = cv2.imread(image)
112
  image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
113
 
114
  outputs = predictor(image)
@@ -235,7 +234,7 @@ def segment_image(image):
235
  # Create Gradio interface
236
  iface = gr.Interface(
237
  fn=segment_image,
238
- inputs=gr.Image(type="numpy", label="Upload Image"),
239
  outputs=[
240
  gr.Textbox(label="Output"),
241
  gr.Image(label="Cropped Car Image"),
 
107
 
108
  # Function to segment image
109
  def segment_image(image):
110
+ image = np.array(image)
 
111
  image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
112
 
113
  outputs = predictor(image)
 
234
  # Create Gradio interface
235
  iface = gr.Interface(
236
  fn=segment_image,
237
+ inputs= gr.Image(type="pil", label="Upload Image"),
238
  outputs=[
239
  gr.Textbox(label="Output"),
240
  gr.Image(label="Cropped Car Image"),