justin2341 commited on
Commit
9501e03
·
verified ·
1 Parent(s): f7d745e

Update demo.py

Browse files
Files changed (1) hide show
  1. demo.py +4 -4
demo.py CHANGED
@@ -5,7 +5,7 @@ import io
5
  import cv2
6
  import numpy as np
7
 
8
- alpr_count = 0
9
  def plot_one_box(x, img, color=None, label=None, score=None, line_thickness=3):
10
  # Plots one bounding box on image img
11
  tl = line_thickness or round(0.002 * (img.shape[0] + img.shape[1]) / 2) + 1 # line/font thickness
@@ -87,14 +87,14 @@ with gr.Blocks() as demo:
87
  )
88
  with gr.Row():
89
  with gr.Column():
90
- alpr_image_input = gr.Image(type='filepath', height=300)
91
  gr.Examples(['fire_examples/test1.jpg', 'fire_examples/test2.jpg', 'fire_examples/test3.jpg', 'fire_examples/test4.jpg'],
92
- inputs=alpr_image_input)
93
  fire_confirmation_button = gr.Button("Confirm")
94
  with gr.Column():
95
  fire_output = gr.Image(type="numpy")
96
 
97
- fire_confirmation_button.click(fire, inputs=alpr_image_input, outputs=fire_output)
98
  gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fweb.kby-ai.com%2F"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fweb.kby-ai.com%2F&label=VISITORS&countColor=%23263759" /></a>')
99
 
100
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
5
  import cv2
6
  import numpy as np
7
 
8
+ fire_count = 0
9
  def plot_one_box(x, img, color=None, label=None, score=None, line_thickness=3):
10
  # Plots one bounding box on image img
11
  tl = line_thickness or round(0.002 * (img.shape[0] + img.shape[1]) / 2) + 1 # line/font thickness
 
87
  )
88
  with gr.Row():
89
  with gr.Column():
90
+ fire_image_input = gr.Image(type='filepath', height=300)
91
  gr.Examples(['fire_examples/test1.jpg', 'fire_examples/test2.jpg', 'fire_examples/test3.jpg', 'fire_examples/test4.jpg'],
92
+ inputs=fire_image_input)
93
  fire_confirmation_button = gr.Button("Confirm")
94
  with gr.Column():
95
  fire_output = gr.Image(type="numpy")
96
 
97
+ fire_confirmation_button.click(fire, inputs=fire_image_input, outputs=fire_output)
98
  gr.HTML('<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fweb.kby-ai.com%2F"><img src="https://api.visitorbadge.io/api/combined?path=https%3A%2F%2Fweb.kby-ai.com%2F&label=VISITORS&countColor=%23263759" /></a>')
99
 
100
  demo.launch(server_name="0.0.0.0", server_port=7860)