Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -47,11 +47,11 @@ def load_model2():
|
|
47 |
|
48 |
def predict(pilimg):
|
49 |
# Check if the input is an image or a video
|
50 |
-
if isinstance(pilimg, np.ndarray): # Input is an image
|
51 |
image_np = pil_image_as_numpy_array(pilimg)
|
52 |
return predict2(image_np)
|
53 |
-
|
54 |
-
|
55 |
|
56 |
def predict2(image_np):
|
57 |
|
@@ -89,6 +89,6 @@ detection_model = load_model()
|
|
89 |
# predicted_img.save('predicted.jpg')
|
90 |
|
91 |
gr.Interface(fn=predict,
|
92 |
-
inputs=
|
93 |
-
outputs=
|
94 |
).launch(share=True)
|
|
|
47 |
|
48 |
def predict(pilimg):
|
49 |
# Check if the input is an image or a video
|
50 |
+
#if isinstance(pilimg, np.ndarray): # Input is an image
|
51 |
image_np = pil_image_as_numpy_array(pilimg)
|
52 |
return predict2(image_np)
|
53 |
+
# else:
|
54 |
+
# print("This is video file")
|
55 |
|
56 |
def predict2(image_np):
|
57 |
|
|
|
89 |
# predicted_img.save('predicted.jpg')
|
90 |
|
91 |
gr.Interface(fn=predict,
|
92 |
+
inputs=gr.Image(type="pil"),
|
93 |
+
outputs=gr.Image(type="pil")
|
94 |
).launch(share=True)
|