Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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="
|
| 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"),
|