Spaces:
Runtime error
Runtime error
File size: 976 Bytes
bfa5e78 886b4ec 106269c befc4d5 1399b66 106269c e206298 bfa5e78 106269c 886b4ec 2e18082 886b4ec e4afb16 fcf420f e4afb16 886b4ec e951191 2b05534 886b4ec | 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 33 34 35 36 37 38 39 40 41 42 43 44 | '''
import gradio as gr
import numpy as np
def flip(im):
return np.flipud(im)
demo = gr.Interface(
flip,
gr.Image(sources=["webcam"], streaming=True),
"image",
live=True,
)
if __name__ == "__main__":
demo.launch()
'''
import gradio as gr
import os
import numpy as np
import re
from ultralytics import YOLO
model = YOLO('Modelo/yolov8n.pt')
def video_identity(video):
#results = model(video, conf=0.60, stream=True, show=True) # results list
#for r in results:
# salida = r.plot()
return video
demo = gr.Interface(video_identity,
gr.Video(sources=["webcam"], streaming=True,
"playable_video")
#live=True,
#examples=[
# os.path.join(os.path.dirname(__file__),
# "video/video_sample.mp4")],
#cache_examples=True)
if __name__ == "__main__":
demo.launch()
|