fireDetection / app.py
ArchiMathur's picture
Update app.py
8aeffbc verified
raw
history blame
454 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
# Set the title of the app
st.title("Live Fire Detection App")
cap = cv2.VideoCapture(0)
cap.set(3, 640)
cap.set(4, 480)
while True:
ret, img= cap.read()
cv2.imshow('Webcam', img)
if cv2.waitKey(1) == ord('q'):
break
cap.release()
cv2.destroyAllWindows(