Testys commited on
Commit
b08cebf
1 Parent(s): f93602b

Update deploy.py

Browse files
Files changed (1) hide show
  1. deploy.py +5 -5
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, input):
7
  # Call the appropriate detection function based on the choice
8
  if choice == "Image":
9
- return img_detect(input)
10
  elif choice == "Video":
11
- return video_detection(input)
12
  else:
13
- return img_detect(input) # Default to image detection
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="image")
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)