YEHTUT commited on
Commit
7cdb8cc
1 Parent(s): 69034ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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
- else:
54
- print("This is video file")
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=[gr.Image(type="pil"),gr.Video()],
93
- outputs=[gr.Image(type="pil"),gr.Video()]
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)