Fire Detection YOLOv8 with Python (real time & custom data)

Поділитися
Вставка
  • Опубліковано 2 гру 2024

КОМЕНТАРІ • 67

  • @rodrigocorte5289
    @rodrigocorte5289 8 місяців тому

    Thanks for the video, very good explanation!!!

  • @L6FTY
    @L6FTY 10 місяців тому +3

    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

  • @alaamohamed5640
    @alaamohamed5640 8 місяців тому +2

    how can get the bath of data

  • @streamology
    @streamology Рік тому

    short and clear video, thanks

  • @aurgon_42121
    @aurgon_42121 9 місяців тому +1

    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

    • @universityofthefuture2077
      @universityofthefuture2077  9 місяців тому

      Have you install all necessary packages?

    • @aurgon_42121
      @aurgon_42121 9 місяців тому

      Yes but, while importing yolo from ultralytics , it is showing a yellow underline below that
      I think its logical error

    • @universityofthefuture2077
      @universityofthefuture2077  9 місяців тому

      Maybe it’s different version of the package?

    • @tabbabiyosr602
      @tabbabiyosr602 8 місяців тому

      do you write all codes ??

  • @cuongmanh4846
    @cuongmanh4846 9 місяців тому +1

    vscode you create ? time 3:45

  • @AnimoGameDev
    @AnimoGameDev 9 місяців тому

    Thanks For This Tutorial Hope You Do More💚

  • @karimmerchaoui9736
    @karimmerchaoui9736 8 місяців тому

    Why do you do the training in google collab and the prediction in your local environment ?

    • @universityofthefuture2077
      @universityofthefuture2077  8 місяців тому +1

      Prediction is quite fast even without gpu and real-time video streaming on Colab requires some additional set up:)

  • @cuongmanh4846
    @cuongmanh4846 9 місяців тому +1

    How come when downloading best.pt the main.py file is available

  • @kingclash1169
    @kingclash1169 9 місяців тому +1

    How to download the run file to the device?

  • @tabbabiyosr602
    @tabbabiyosr602 8 місяців тому

    give me the url of yolov8 in colab please

  • @MOHAMMEDABDULLAHS21CSR063
    @MOHAMMEDABDULLAHS21CSR063 9 місяців тому

    Thank you sir . done a greate job sir☺

  • @coolghoul9
    @coolghoul9 7 місяців тому

    Does holding a plastic spoon give a false positive

  • @MuhamadNoorIman
    @MuhamadNoorIman 5 місяців тому

    great video! can i used the same coding on jupyter notebook?

  • @kingclash1169
    @kingclash1169 9 місяців тому +1

    where is best.pt file i can't find it

    • @universityofthefuture2077
      @universityofthefuture2077  9 місяців тому

      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.

  • @user-sx5ib8vd6l
    @user-sx5ib8vd6l 8 місяців тому

    well done dawg

  • @rodrigocorte5289
    @rodrigocorte5289 7 місяців тому

    Hey !! Is there any way to sound an alarm when a fire is detected? Please respond, I really need your help!!

    • @universityofthefuture2077
      @universityofthefuture2077  7 місяців тому +1

      Hi, what do you mean? You can add simple alarm with for example playsound library.

    • @rodrigocorte5289
      @rodrigocorte5289 7 місяців тому

      @@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

    • @rodrigocorte5289
      @rodrigocorte5289 7 місяців тому

      @@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

    • @rodrigocorte5289
      @rodrigocorte5289 7 місяців тому

      @@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!!

    • @rodrigocorte5289
      @rodrigocorte5289 7 місяців тому

      @@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!!

  • @rodrigocorte5289
    @rodrigocorte5289 7 місяців тому

    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!!

    • @universityofthefuture2077
      @universityofthefuture2077  7 місяців тому

      Hi, now its late response, hah, but this snippet it’s quite unreadable, please provide some github repo

    • @rodrigocorte5289
      @rodrigocorte5289 7 місяців тому

      @@universityofthefuture2077 i already solve the problem but thanks 😉

    • @romanshendo4784
      @romanshendo4784 7 місяців тому

      @@universityofthefuture2077 guys can you help me please? a have a this problem to. Thanks

    • @romanshendo4784
      @romanshendo4784 7 місяців тому

      @@rodrigocorte5289 can you help me please? a have a this problem to. Thanks

    • @romanshendo4784
      @romanshendo4784 7 місяців тому

      @@rodrigocorte5289 can you help me please?i hame i same problem

  • @aurgon_42121
    @aurgon_42121 9 місяців тому

    showing the error of API KEy
    , when i paste the snippet from roboflow,,,

  • @lukbeatz7475
    @lukbeatz7475 10 місяців тому +1

    thanks bro, saved me

  • @jhansip5002
    @jhansip5002 2 місяці тому

    Sir...i want this code and output..

  • @GayathriSingamsetty-p5l
    @GayathriSingamsetty-p5l Місяць тому

    Can you please send me the code and result please

  • @R1cS0
    @R1cS0 7 місяців тому

    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.?

    • @universityofthefuture2077
      @universityofthefuture2077  7 місяців тому

      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:)

  • @L6FTY
    @L6FTY 10 місяців тому

    How many epochs make sense here?

    • @universityofthefuture2077
      @universityofthefuture2077  10 місяців тому

      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.

  • @bangipin361
    @bangipin361 10 місяців тому

    I've followed what's in the video but I always fail

    • @universityofthefuture2077
      @universityofthefuture2077  10 місяців тому

      Hi, which part of the code fails?

    • @L6FTY
      @L6FTY 10 місяців тому

      try updating your paths to the image folders in data.yaml:
      test: ./test/images
      train: ./train/images
      val: ./valid/images

  • @aisyahzulaikha01
    @aisyahzulaikha01 11 місяців тому

    How to appear run folder in vs code?

    • @universityofthefuture2077
      @universityofthefuture2077  11 місяців тому

      After you run the script, the folder should be created automatically in the project root directory

    • @aisyahzulaikha01
      @aisyahzulaikha01 11 місяців тому

      @@universityofthefuture2077 alright thank youu, I will try it

    • @houdabekkourialami3581
      @houdabekkourialami3581 10 місяців тому

      I followed the same instructions but the webcam doesn't run for me. The webcam is activated and all. What can be the problem?

    • @MuhamadNoorIman
      @MuhamadNoorIman 5 місяців тому

      @@universityofthefuture2077 where to find the project root directory?

  • @aidajam3294
    @aidajam3294 2 місяці тому

    Are you Portuguese dude ? 😊

  • @GayathriSingamsetty-p5l
    @GayathriSingamsetty-p5l Місяць тому

    Hlo

  • @ĐứcHuỳnhTấn-b1s
    @ĐứcHuỳnhTấn-b1s Рік тому

    dataset ?

  • @syedyadishalikhan8326
    @syedyadishalikhan8326 Рік тому

    source code

  • @wanpanman5492
    @wanpanman5492 Рік тому +3

    not a very in depth tutorial