Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 =
|
37 |
-
intf.launch(inline=False
|
|
|
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)
|