Spaces:
Build error
Build error
| import cv2 | |
| import numpy as np | |
| from glob import glob | |
| from ultralytics.yolo.v8.detect import predict | |
| #from models import Yolov4 | |
| import gradio as gr | |
| #model = Yolov4(weight_path="yolov4.weights", class_name_path='coco_classes.txt') | |
| def gradio_wrapper(img): | |
| predict(model="yolov8x6.pt", source=img) | |
| #print(np.shape(img)) | |
| demo = gr.Interface( | |
| gradio_wrapper, | |
| #gr.Image(source="webcam", streaming=True, flip=True), | |
| gr.Image(source="webcam", streaming=True), | |
| "image", | |
| live=True | |
| ) | |
| demo.launch() |