Spaces:
Runtime error
Runtime error
Download app.py from ArchiMathur/fireDetection: direct link, hf CLI and curl.
- Browser
- Download file 718 Bytes
-
https://huggingface.co/spaces/ArchiMathur/fireDetection/resolve/main/app.py
- Command line
-
hf download hf://spaces/ArchiMathur/fireDetection/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ArchiMathur/fireDetection/resolve/main/app.py
718 Bytes
| import streamlit as st | |
| import cv2 | |
| import numpy as np | |
| from ultralytics import YOLO | |
| # Load the YOLO model | |
| model = YOLO("best.pt") # Ensure the path to your model is correct | |
| webcamera = cv2.VideoCapture() | |
| # # webcamera.set(cv2.CAP_PROP_FRAME_WIDTH, 1920) | |
| # # webcamera.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080) | |
| # while True: | |
| # success, frame = webcamera.read() | |
| # results = model.track(frame, classes=0, conf=0.8, imgsz=480) | |
| # cv2.putText(frame, f"Total: {len(results[0].boxes)}", (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2, cv2.LINE_AA) | |
| # cv2.imshow("Live Camera", results[0].plot()) | |
| # if cv2.waitKey(1) == ord('q'): | |
| # break | |
| # webcamera.release() | |
| # cv2.destroyAllWindows() | |