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

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 67

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

  • @rodrigocorte5289
    @rodrigocorte5289 7 месяцев назад

    Thanks for the video, very good explanation!!!

  • @streamology
    @streamology Год назад

    short and clear video, thanks

  • @alaamohamed5640
    @alaamohamed5640 8 месяцев назад +2

    how can get the bath of data

  • @coolghoul9
    @coolghoul9 7 месяцев назад

    Does holding a plastic spoon give a false positive

  • @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  8 месяцев назад

      Maybe it’s different version of the package?

    • @tabbabiyosr602
      @tabbabiyosr602 8 месяцев назад

      do you write all codes ??

  • @lukbeatz7475
    @lukbeatz7475 10 месяцев назад +1

    thanks bro, saved me

  • @AnimoGameDev
    @AnimoGameDev 9 месяцев назад

    Thanks For This Tutorial Hope You Do More💚

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

  • @user-sx5ib8vd6l
    @user-sx5ib8vd6l 8 месяцев назад

    well done dawg

  • @cuongmanh4846
    @cuongmanh4846 8 месяцев назад +1

    vscode you create ? time 3:45

  • @MOHAMMEDABDULLAHS21CSR063
    @MOHAMMEDABDULLAHS21CSR063 9 месяцев назад

    Thank you sir . done a greate job sir☺

  • @MuhamadNoorIman
    @MuhamadNoorIman 5 месяцев назад

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

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

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

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

  • @cuongmanh4846
    @cuongmanh4846 8 месяцев назад +1

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

  • @GayathriSingamsetty-p5l
    @GayathriSingamsetty-p5l 28 дней назад

    Can you please send me the code and result please

  • @aurgon_42121
    @aurgon_42121 9 месяцев назад

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

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

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

  • @jhansip5002
    @jhansip5002 2 месяца назад

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

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

  • @aidajam3294
    @aidajam3294 Месяц назад

    Are you Portuguese dude ? 😊

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

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

  • @ĐứcHuỳnhTấn-b1s
    @ĐứcHuỳnhTấn-b1s Год назад

    dataset ?

  • @GayathriSingamsetty-p5l
    @GayathriSingamsetty-p5l 27 дней назад

    Hlo

  • @wanpanman5492
    @wanpanman5492 Год назад +3

    not a very in depth tutorial

  • @syedyadishalikhan8326
    @syedyadishalikhan8326 Год назад

    source code