Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
22 |
-
return frame
|
23 |
|
24 |
|
25 |
-
image = gr.
|
26 |
label = gr.outputs.Label()
|
27 |
examples = ['rock.jpg', 'paper.jpg', 'scissor.jpg']
|
28 |
|
29 |
-
intf = gr.Interface(fn = classify_images, inputs =
|
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 |
|