File size: 457 Bytes
68148c4
 
 
 
 
 
 
c2364da
68148c4
c2364da
68148c4
a9dec7c
 
 
68148c4
 
 
 
 
 
 
 
 
 
 
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
import subprocess
import tempfile
import time
from pathlib import Path
import cv2
import gradio as gr
import torch
import ultralytics.yolo.v8.detect.predict

pipeline = predict()

def fn_image(image):
    return pipeline(image)
    
gr.Interface(
    fn_image,
    inputs=[
        gr.Image(source='webcam', streaming=True),
    ],
    outputs=gr.Image(type="file"),
    live=True,
    title="YOLOv8",
    allow_flagging=False,
    allow_screenshot=False,
)