-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
* docs: Clarify prerequisites * docs: Update reference links to newer docs
- Loading branch information
There are no files selected for viewing
6 comments
on commit c469494
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment utelissares copilot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
slm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hii there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hiii
import cv2 # Library for openCV
import threading # Library for threading -- which allows code to run in backend
import playsound # Library for alarm sound
import smtplib # Library for email sending
To access xml file which includes positive and negative images of fire.
(Trained images) File is also provided with the code.
fire_cascade = cv2.CascadeClassifier('fire_detection_cascade_model.xml')
vid = cv2.VideoCapture("videos\fire2.mp4")
runOnce = False # created boolean
defined function to play alarm post fire detection using threading
def play_alarm_sound_function():
# to play alarm # mp3 audio file is also provided with the code.
playsound.playsound('fire_alarm.mp3',True)
print("Fire alarm end") # to print in consol
Defined function to send mail post fire detection using threading
def send_mail_function():
while(True):
Alarm_Status = False
# Value in ret is True # To read video frame
ret, frame = vid.read()
# To convert frame into gray color
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# to provide frame resolution
fire = fire_cascade.detectMultiScale(frame, 1.2, 5)