File size: 454 Bytes
defef4e
42df645
defef4e
42df645
 
 
 
 
0be7ae3
42df645
8aeffbc
 
 
5b83d94
eda777f
8aeffbc
 
0be7ae3
8254cd5
a80de8b
0be7ae3
8aeffbc
 
 
 
 
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
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(