arham061 commited on
Commit
af9b471
1 Parent(s): 2096d0f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -15,16 +15,16 @@ def classify_images(img):
15
  pred, idx, probs = learn.predict(img)
16
  return dict(zip(categories, map(float, probs)))
17
 
18
- def get_webcam_image():
19
- cap = cv2.VideoCapture(0)
20
- _, frame = cap.read()
21
- cap.release()
22
- return frame
23
 
24
 
25
- image = gr.inputs.Image(shape=(192,192))
26
  label = gr.outputs.Label()
27
  examples = ['rock.jpg', 'paper.jpg', 'scissor.jpg']
28
 
29
- intf = gr.Interface(fn = classify_images, inputs = [gr.Webcam()], outputs = label, examples = examples).launch()
30
 
 
15
  pred, idx, probs = learn.predict(img)
16
  return dict(zip(categories, map(float, probs)))
17
 
18
+ #def get_webcam_image():
19
+ # cap = cv2.VideoCapture(0)
20
+ # _, frame = cap.read()
21
+ # cap.release()
22
+ # return frame
23
 
24
 
25
+ image = gr.Webcam()
26
  label = gr.outputs.Label()
27
  examples = ['rock.jpg', 'paper.jpg', 'scissor.jpg']
28
 
29
+ intf = gr.Interface(fn = classify_images, inputs = image, outputs = label, examples = examples).launch()
30