n0no123 commited on
Commit
08dc636
·
1 Parent(s): 8745d31

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -9,10 +9,15 @@ def my_app(img):
9
  analysedData = classifier.detectMultiScale(flipped_image,
10
  minSize=(20, 20))
11
  if len(analysedData) != 0:
 
 
 
 
 
12
  return ("S T O P !")
13
  else:
 
14
  return ("You're good to go :)")
15
 
16
 
17
- gr.interface.Interface(fn=my_app, live=True, inputs=gr.Image(
18
- source='webcam', streaming=True), outputs="text").launch()
 
9
  analysedData = classifier.detectMultiScale(flipped_image,
10
  minSize=(20, 20))
11
  if len(analysedData) != 0:
12
+ for (x, y, width, height) in analysedData:
13
+ return cv2.rectangle(flipped_image, (x, y),
14
+ (x + height, y + width),
15
+ (0, 255, 0), 5)
16
+ return flipped_image
17
  return ("S T O P !")
18
  else:
19
+ return flipped_image
20
  return ("You're good to go :)")
21
 
22
 
23
+ gr.interface.Interface(fn=my_app, live=True, inputs="image", outputs="image").launch()