-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyolov1_training_test.txt
53 lines (44 loc) · 1.93 KB
/
yolov1_training_test.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
1. yolov1 source code download in LMS system
2. downloading VOCdatasets in yolov1-resnetgit directory
>> wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtrainval_06-Nov-2007.tar
>> wget http://host.robots.ox.ac.uk/pascal/VOC/voc2007/VOCtest_06-Nov-2007.tar
>> wget http://host.robots.ox.ac.uk/pascal/VOC/voc2012/VOCtrainval_11-May-2012.tar
3. Extracting all tars into one director named 'VOCdevkit'
>> tar -xvf VOCtrainval_06-Nov-2007.tar
>> tar -xvf VOCtest_06-Nov-2007.tar
>> tar -xvf VOCtrainval_11-May-2012.tar
4. It should have this basic structure
- ./VOCdevkit/VOC2007
- ./VOCdevkit/VOC2012
5. Generating the train and test list
>> python3 ./tools/convert_voc.py --dir_path ./Dataset
├── Dataset
├── Images
├── 0001.jpg
├── 0002.jpg
├── Labels
├── 0001.txt
├── 0002.txt
├── train.txt
├── test.txt
6. Traing
(1) before training,
a. modifying root directory
- root = '../Dataset/' --> root = '../Datasets/'
- with open('../Dataset/train.txt') as f --> with open('./Dataset/train.txt') as f
- with open('../Dataset/test.txt') as f: --> with open('./Dataset/test.txt') as f:
b. modifying proper hyperparametes
- for example batch_size = 8
c. if you have an exist pretrained weight in ./weight folder, wright down as following.
- python3 main.py --pre_weights yolov1_0010.pth
>>python3 main.py
7. Evaluation
>> python3 eval.py
- In evaluation.py, im_show=False change to True to see the results.
8. Detection
(1) To show the result image
>> python3 detect.py --image assets/person.jpg
(2) To save result image
>> python3 detect.py --image assets/person.jpg --save_img
9. Weights
- Run the download.sh file in weights folder or download from this link