File size: 759 Bytes
9b4be67
 
2e0ea1a
9b4be67
 
da8e3ad
 
 
b3818eb
da8e3ad
b3818eb
9b4be67
 
 
 
 
 
 
 
2fabddb
 
 
 
9b4be67
 
2e0ea1a
2fabddb
 
2e0ea1a
b3818eb
9b4be67
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# import gradio as gr
# import torch

# model = torch.hub.load('ultralytics/yolov5', 'custom', path='best.pt')
# # Define the face detector function
# def detect_faces(image):
#    # Loading in yolov5s - you can switch to larger models such as yolov5m or yolov5l, or smaller such as yolov5n
#     results = model(image)

#     return results.render()[0]

# # Create a Gradio interface
# iface = gr.Interface(fn=detect_faces, inputs="image", outputs="image")

# # Launch the interface
# iface.launch(debug=True)

import gradio as gr


def snap(image, video):
    return [image, video]


demo = gr.Interface(
    snap,
    [gr.Image(source="webcam", tool=None), gr.Video(source="webcam")],
    ["image", "video"],
)

if __name__ == "__main__":
    demo.launch()