Spaces:
Runtime error
Runtime error
Update deploy.py
Browse files
deploy.py
CHANGED
@@ -3,14 +3,14 @@ from faster_rcnn import img_detect, video_detection
|
|
3 |
|
4 |
|
5 |
# Define detection function
|
6 |
-
def detect(choice,
|
7 |
# Call the appropriate detection function based on the choice
|
8 |
if choice == "Image":
|
9 |
-
return img_detect(
|
10 |
elif choice == "Video":
|
11 |
-
return video_detection(
|
12 |
else:
|
13 |
-
return img_detect(
|
14 |
|
15 |
|
16 |
# Create Gradio interface using blocks layout
|
@@ -19,7 +19,7 @@ with gr.Blocks() as demo:
|
|
19 |
choices=["Image", "Video"],
|
20 |
label="What type of object would you like to detect?",
|
21 |
)
|
22 |
-
inp_image = gr.Image(filepath="
|
23 |
output = gr.Image()
|
24 |
det = gr.Button('Detect')
|
25 |
det.click(detect, [choices, inp_image], output)
|
|
|
3 |
|
4 |
|
5 |
# Define detection function
|
6 |
+
def detect(choice, inp):
|
7 |
# Call the appropriate detection function based on the choice
|
8 |
if choice == "Image":
|
9 |
+
return img_detect(inp)
|
10 |
elif choice == "Video":
|
11 |
+
return video_detection(inp)
|
12 |
else:
|
13 |
+
return img_detect(inp) # Default to image detection
|
14 |
|
15 |
|
16 |
# Create Gradio interface using blocks layout
|
|
|
19 |
choices=["Image", "Video"],
|
20 |
label="What type of object would you like to detect?",
|
21 |
)
|
22 |
+
inp_image = gr.Image(filepath="upload")
|
23 |
output = gr.Image()
|
24 |
det = gr.Button('Detect')
|
25 |
det.click(detect, [choices, inp_image], output)
|