Spaces:
Runtime error
Runtime error
Download app.py from ProyectoVision/Demo_Video: direct link, hf CLI and curl.
- Browser
- Download file 976 Bytes
-
https://huggingface.co/spaces/ProyectoVision/Demo_Video/resolve/main/app.py
- Command line
-
hf download hf://spaces/ProyectoVision/Demo_Video/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ProyectoVision/Demo_Video/resolve/main/app.py
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() | |