WEBVTT

﻿1
00:00:01.251 --> 00:00:05.505
in this lesson. we will learn about installing and training yolo.  

2
00:00:06.715 --> 00:00:10.593
access the github repository via the official yolo website.  

3
00:00:14.014 --> 00:00:18.059
create a conda virtual environment and install yolo within it.  

4
00:01:44.104 --> 00:01:48.108
finally. enter the `yolo` command to verify the installation.  

5
00:01:56.908 --> 00:02:02.122
this time. we will obtain training data from roboflow and train the yolo model.  

6
00:02:03.164 --> 00:02:05.959
first. click on the roboflow universe menu.  

7
00:02:07.252 --> 00:02:12.507
click the "explore universe" button to navigate to the dataset exploration page.  

8
00:02:12.799 --> 00:02:16.553
now. search for the dataset you want to use for training. 

9
00:02:16.678 --> 00:02:22.392
i will use the "fire detection" dataset. which has been downloaded more than 400 times.  

10
00:02:23.893 --> 00:02:26.688
download the dataset and extract the files.  

11
00:02:50.587 --> 00:02:53.548
now. open and check the `data.yaml` file.  

12
00:03:01.764 --> 00:03:06.769
to ensure smooth training. we will set the dataset path to an absolute path.  

13
00:03:07.312 --> 00:03:10.982
(set the path according to your environment.)  

14
00:03:11.649 --> 00:03:15.028
this path should point to the extracted dataset folder.  

15
00:03:18.823 --> 00:03:24.537
next. open a cmd window and activate the `flameguard` virtual environment in anaconda.  

16
00:03:32.587 --> 00:03:37.258
now. let's refer to the yolo official documentation and start training.  

17
00:03:43.389 --> 00:03:46.684
run the basic training command to train the model.  

18
00:03:51.147 --> 00:03:54.108
let's briefly go over the training options. 

19
00:03:56.194 --> 00:03:59.197
`epochs` sets the number of training iterations.  

20
00:04:00.740 --> 00:04:04.285
`data` specifies the path to the dataset for training.  

21
00:04:05.245 --> 00:04:09.624
we have already defined the dataset path in the `data.yaml` file.  

22
00:04:10.833 --> 00:04:13.836
`imgsz` sets the image size for training.  

23
00:04:14.170 --> 00:04:16.506
the recommended default size is `640`.  

24
00:04:17.674 --> 00:04:19.634
now. let's start the training.  

25
00:04:21.886 --> 00:04:28.518
normally. training is repeated at least 100 times. but in this example. we will run it only 10 times.  

26
00:04:30.144 --> 00:04:34.691
it is recommended to train for at least 100 epochs for better results.  

27
00:04:41.197 --> 00:04:50.290
all training results will be saved inside the `train` folder under `detect`. which is located in the `run` directory of the training path.

28
00:04:59.841 --> 00:05:03.177
inside the weights folder. you will find two files.

29
00:05:05.013 --> 00:05:07.432
best stores the best training result.

30
00:05:07.432 --> 00:05:10.310
last stores the most recent training result.

31
00:05:11.227 --> 00:05:16.566
typically. the best model. which has the highest mean average precision (mAP). is used.

32
00:05:19.694 --> 00:05:24.699
let’s refer to the official yolo documentation and test the trained model.  

33
00:05:25.992 --> 00:05:29.871
navigate to the directory where the trained model is saved.  

34
00:05:37.503 --> 00:05:40.798
enter the provided command to predict fire images.  

35
00:05:48.848 --> 00:05:54.312
to do this. find fire images from the internet and save them in the same directory.  

36
00:06:04.572 --> 00:06:09.702
next. specify the saved image using the `source` option to run the prediction.  

37
00:06:22.548 --> 00:06:25.968
based on the directory where the command is executed. 

38
00:06:25.968 --> 00:06:32.809
a `predict` folder will be created inside `runs/detect`. and the prediction results will be stored there.  

39
00:06:33.976 --> 00:06:37.897
let’s test a few more fire and non-fire images for prediction. 

40
00:07:20.022 --> 00:07:27.155
in the next lesson. we will build a backend server using fastapi and create an api for running predictions.  
