My image folders were in different spots than roboflow uses now so I changed the data.yaml file to: test: ./test/images train: ./train/images val: ./valid/images
I have changed the path according to my folders in google colab , but this line of code " !yolo task=detect mode=train model=yolov8s.pt data=/content/continuous_fire-6/data.yaml epochs=1 imgsz=640 plots=True" is showing the error like this "/bin/bash: line 1: yolo: command not found " plz tell me how to deal with it
Great video! Thanks for sharing it! Here's a question: could the small Yolo model be used directly on an ESP32Cam to detect a fire and set an alarm (as already covered in the comments below), send a message, etc.?
Thanks! You can easily export yolo to tflite format (details here: docs.ultralytics.com/integrations/tflite/#deployment-options-in-tflite). I’ve never done this, so I am not sure if ESP can handle it, but probably yes. Hover if your goal is just to make it run, it would be much easier to use rpi zero for example:)
Hi bro, thanks for responding so quickly!! I've tried several times and I can't get an alarm to sound when fire is detected. I used this code, but it doesn't work. Do you have any suggestions? # Function for fire detection and sound alert def detect_fire_and_alert(): # Initialize the YOLO model model = YOLO('best.pt') # Performs continuous fire detection whileTrue: # Perform the prediction results = model.predict(source=0, imgsz=320, conf=0.6, show=True) # Checks for fire detections for detection in results.pred: if 'fire' in detection['names']: # If fire is detected, plays an alert sound playsound("alarm_sound.mp3") break # Breaks the loop when fire is detected # Function call for fire detection and audible alert detect_fire_and_alert() I would be very grateful if you could help me. I need your help!!
In my case it was in PROJECT/runs/detect/train/weights/best.pt, but if you are using different version of the ultralytics package, the path can be slightly different.
@@universityofthefuture2077 Hello and thanks for the quick response!! It's not that simple, I put an if to play sound when it detects fire but it doesn't work. I tried with this code : from ultralytics import YOLO from playsound import playsound # Função para detecção de fogo e alerta sonoro def detect_fire_and_alert(): # Inicializa o modelo YOLO model = YOLO('best.pt') # Realiza a detecção contínua de fogo while True: # Realiza a predição results = model.predict(source=0, imgsz=320, conf=0.6, show=True) # Verifica se há detecções de fogo for detection in results.pred: if 'fire' in detection['names']: # Se o fogo for detectado, reproduz um som de alerta playsound("alarm_sound.mp3") break # Interrompe o loop quando o fogo é detectado # Chamada da função para detecção de fogo e alerta sonoro detect_fire_and_alert() I can´t do it, could you help me with this
@@universityofthefuture2077 Hi bro, thanks for responding so quickly It's not that simple, I've already tried with this code and I'm not succeeding. from ultralytics import YOLO from playsound import playsound # Function for fire detection and sound alert def detect_fire_and_alert(): # Initialize the YOLO model model = YOLO('best.pt') # Performs continuous fire detection whileTrue: # Perform the prediction results = model.predict(source=0, imgsz=320, conf=0.6, show=True) # Checks for fire detections for detection in results.pred: if 'fire' in detection['names']: # If fire is detected, plays an alert sound playsound("alarm_sound.mp3") break # Breaks the loop when fire is detected # Function call for fire detection and audible alert detect_fire_and_alert() If you could help I would be very grateful
@@universityofthefuture2077 Hi bro, thanks for responding so quickly. This is not that simple. I've tried several times and still haven't managed to get an alarm to sound when it detects the fire. I used this code and I can't do it, do you have any suggestions? from ultralytics import YOLO from playsound import playsound # Function for fire detection and sound alert def detect_fire_and_alert(): # Initialize the YOLO model model = YOLO('best.pt') # Performs continuous fire detection whileTrue: # Perform the prediction results = model.predict(source=0, imgsz=320, conf=0.6, show=True) # Checks for fire detections for detection in results.pred: if 'fire' in detection['names']: # If fire is detected, plays an alert sound playsound("alarm_sound.mp3") break # Breaks the loop when fire is detected # Function call for fire detection and audible alert detect_fire_and_alert() I would be very grateful if you could help me. Bro i really need your help!!
@@universityofthefuture2077 Hi bro, thanks for responding so quickly!! I've tried several times and I can't get an alarm to sound when fire is detected. I used this code, but it doesn't work. Do you have any suggestions? # Function for fire detection and sound alert def detect_fire_and_alert(): # Initialize the YOLO model model = YOLO('best.pt') # Performs continuous fire detection whileTrue: # Perform the prediction results = model.predict(source=0, imgsz=320, conf=0.6, show=True) # Checks for fire detections for detection in results.pred: if 'fire' in detection['names']: # If fire is detected, plays an alert sound playsound("alarm_sound.mp3") break # Breaks the loop when fire is detected # Function call for fire detection and audible alert detect_fire_and_alert() I would be very grateful if you could help me. I need your help!!
Really depends on your goal. You should keep track of loss chart, if the curve stops going down, it's sign that probably further training is not going to make it better.
My image folders were in different spots than roboflow uses now so I changed the data.yaml file to:
test: ./test/images
train: ./train/images
val: ./valid/images
Thanks for the video, very good explanation!!!
short and clear video, thanks
how can get the bath of data
Does holding a plastic spoon give a false positive
I have changed the path according to my folders in google colab , but this line of code " !yolo task=detect mode=train model=yolov8s.pt data=/content/continuous_fire-6/data.yaml epochs=1 imgsz=640 plots=True" is showing the error like this "/bin/bash: line 1: yolo: command not found "
plz tell me how to deal with it
Have you install all necessary packages?
Yes but, while importing yolo from ultralytics , it is showing a yellow underline below that
I think its logical error
Maybe it’s different version of the package?
do you write all codes ??
thanks bro, saved me
Thanks For This Tutorial Hope You Do More💚
Great video! Thanks for sharing it! Here's a question: could the small Yolo model be used directly on an ESP32Cam to detect a fire and set an alarm (as already covered in the comments below), send a message, etc.?
Thanks! You can easily export yolo to tflite format (details here: docs.ultralytics.com/integrations/tflite/#deployment-options-in-tflite). I’ve never done this, so I am not sure if ESP can handle it, but probably yes. Hover if your goal is just to make it run, it would be much easier to use rpi zero for example:)
well done dawg
vscode you create ? time 3:45
Thank you sir . done a greate job sir☺
great video! can i used the same coding on jupyter notebook?
Thanks! Sure, it’s public on my github:)
Hi bro, thanks for responding so quickly!!
I've tried several times and I can't get an alarm to sound when fire is detected.
I used this code, but it doesn't work.
Do you have any suggestions?
# Function for fire detection and sound alert
def detect_fire_and_alert():
# Initialize the YOLO model
model = YOLO('best.pt')
# Performs continuous fire detection
whileTrue:
# Perform the prediction
results = model.predict(source=0, imgsz=320, conf=0.6, show=True)
# Checks for fire detections
for detection in results.pred:
if 'fire' in detection['names']:
# If fire is detected, plays an alert sound
playsound("alarm_sound.mp3")
break # Breaks the loop when fire is detected
# Function call for fire detection and audible alert
detect_fire_and_alert()
I would be very grateful if you could help me.
I need your help!!
Hi, now its late response, hah, but this snippet it’s quite unreadable, please provide some github repo
@@universityofthefuture2077 i already solve the problem but thanks 😉
@@universityofthefuture2077 guys can you help me please? a have a this problem to. Thanks
@@rodrigocorte5289 can you help me please? a have a this problem to. Thanks
@@rodrigocorte5289 can you help me please?i hame i same problem
Why do you do the training in google collab and the prediction in your local environment ?
Prediction is quite fast even without gpu and real-time video streaming on Colab requires some additional set up:)
How to download the run file to the device?
You can zip it, then download option should appear when you click three dots
give me the url of yolov8 in colab please
How come when downloading best.pt the main.py file is available
What do you mean :D ?
Can you please send me the code and result please
showing the error of API KEy
, when i paste the snippet from roboflow,,,
can you show the full error?
done
@@universityofthefuture2077
where is best.pt file i can't find it
In my case it was in PROJECT/runs/detect/train/weights/best.pt, but if you are using different version of the ultralytics package, the path can be slightly different.
Hey !! Is there any way to sound an alarm when a fire is detected? Please respond, I really need your help!!
Hi, what do you mean? You can add simple alarm with for example playsound library.
@@universityofthefuture2077 Hello and thanks for the quick response!!
It's not that simple, I put an if to play sound when it detects fire but it doesn't work.
I tried with this code :
from ultralytics import YOLO
from playsound import playsound
# Função para detecção de fogo e alerta sonoro
def detect_fire_and_alert():
# Inicializa o modelo YOLO
model = YOLO('best.pt')
# Realiza a detecção contínua de fogo
while True:
# Realiza a predição
results = model.predict(source=0, imgsz=320, conf=0.6, show=True)
# Verifica se há detecções de fogo
for detection in results.pred:
if 'fire' in detection['names']:
# Se o fogo for detectado, reproduz um som de alerta
playsound("alarm_sound.mp3")
break # Interrompe o loop quando o fogo é detectado
# Chamada da função para detecção de fogo e alerta sonoro
detect_fire_and_alert()
I can´t do it, could you help me with this
@@universityofthefuture2077 Hi bro, thanks for responding so quickly
It's not that simple, I've already tried with this code and I'm not succeeding.
from ultralytics import YOLO
from playsound import playsound
# Function for fire detection and sound alert
def detect_fire_and_alert():
# Initialize the YOLO model
model = YOLO('best.pt')
# Performs continuous fire detection
whileTrue:
# Perform the prediction
results = model.predict(source=0, imgsz=320, conf=0.6, show=True)
# Checks for fire detections
for detection in results.pred:
if 'fire' in detection['names']:
# If fire is detected, plays an alert sound
playsound("alarm_sound.mp3")
break # Breaks the loop when fire is detected
# Function call for fire detection and audible alert
detect_fire_and_alert()
If you could help I would be very grateful
@@universityofthefuture2077 Hi bro, thanks for responding so quickly.
This is not that simple. I've tried several times and still haven't managed to get an alarm to sound when it detects the fire.
I used this code and I can't do it, do you have any suggestions?
from ultralytics import YOLO
from playsound import playsound
# Function for fire detection and sound alert
def detect_fire_and_alert():
# Initialize the YOLO model
model = YOLO('best.pt')
# Performs continuous fire detection
whileTrue:
# Perform the prediction
results = model.predict(source=0, imgsz=320, conf=0.6, show=True)
# Checks for fire detections
for detection in results.pred:
if 'fire' in detection['names']:
# If fire is detected, plays an alert sound
playsound("alarm_sound.mp3")
break # Breaks the loop when fire is detected
# Function call for fire detection and audible alert
detect_fire_and_alert()
I would be very grateful if you could help me.
Bro i really need your help!!
@@universityofthefuture2077 Hi bro, thanks for responding so quickly!!
I've tried several times and I can't get an alarm to sound when fire is detected.
I used this code, but it doesn't work.
Do you have any suggestions?
# Function for fire detection and sound alert
def detect_fire_and_alert():
# Initialize the YOLO model
model = YOLO('best.pt')
# Performs continuous fire detection
whileTrue:
# Perform the prediction
results = model.predict(source=0, imgsz=320, conf=0.6, show=True)
# Checks for fire detections
for detection in results.pred:
if 'fire' in detection['names']:
# If fire is detected, plays an alert sound
playsound("alarm_sound.mp3")
break # Breaks the loop when fire is detected
# Function call for fire detection and audible alert
detect_fire_and_alert()
I would be very grateful if you could help me.
I need your help!!
Sir...i want this code and output..
check out video description for source code link:)
I've followed what's in the video but I always fail
Hi, which part of the code fails?
try updating your paths to the image folders in data.yaml:
test: ./test/images
train: ./train/images
val: ./valid/images
Are you Portuguese dude ? 😊
I am not😛
How many epochs make sense here?
Really depends on your goal. You should keep track of loss chart, if the curve stops going down, it's sign that probably further training is not going to make it better.
How to appear run folder in vs code?
After you run the script, the folder should be created automatically in the project root directory
@@universityofthefuture2077 alright thank youu, I will try it
I followed the same instructions but the webcam doesn't run for me. The webcam is activated and all. What can be the problem?
@@universityofthefuture2077 where to find the project root directory?
dataset ?
universe.roboflow.com/-jwzpw/continuous_fire
Hlo
not a very in depth tutorial
source code
Sorry for late response, now it’s in the description