arham061 commited on
Commit
63e42be
1 Parent(s): 2ce5a8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -22,16 +22,16 @@ def classify_images(img):
22
  pred, idx, probs = learn.predict(img)
23
  return dict(zip(categories, map(float, probs)))
24
 
25
- def get_webcam_image():
26
- cap = cv2.VideoCapture(0)
27
- _, frame = cap.read()
28
- cap.release()
29
- return frame
30
 
31
 
32
  image = gr.inputs.Image(shape=(192,192))
33
  label = gr.outputs.Label()
34
  examples = ['rock.jpg', 'paper.jpg', 'scissor.jpg']
35
 
36
- intf = gr.Interface(fn = classify_images, inputs = image, outputs = label, examples = examples)
37
- intf.launch(inline=False, capture_interface=True, capture_fn=get_webcam_image)
 
22
  pred, idx, probs = learn.predict(img)
23
  return dict(zip(categories, map(float, probs)))
24
 
25
+ #def get_webcam_image():
26
+ # cap = cv2.VideoCapture(0)
27
+ # _, frame = cap.read()
28
+ # cap.release()
29
+ # return frame
30
 
31
 
32
  image = gr.inputs.Image(shape=(192,192))
33
  label = gr.outputs.Label()
34
  examples = ['rock.jpg', 'paper.jpg', 'scissor.jpg']
35
 
36
+ intf = gr.Interface(fn = classify_images, inputs = webcam_image, outputs = label, examples = examples)
37
+ intf.launch(inline=False)