Demo_Video / app.py
ProyectoVision's picture
Update app.py
e951191
Raw History Blame Contribute Delete
976 Bytes
'''
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()