File size: 472 Bytes
68148c4
 
 
 
 
 
 
799e5e1
 
68148c4
 
a9dec7c
799e5e1
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
from ultralytics.yolo.v8.detect.predict import predict



def fn_image(image):
    return predict(model=yolov8x6, source=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,
)