@@ -5,32 +5,27 @@ This repository contains training scripts for lightweight SSD-based face detecto
5
5
6
6
## Prerequisites
7
7
8
- 1 . Download mmdetection submodule:
9
- ` git submodule update --init --recommend-shallow ../../external/mmdetection `
10
- 2 . Download the [ WIDER Face] ( http://shuoyang1213.me/WIDERFACE/ ) and unpack it to ` data ` folder.
11
- 3 . Annotation in the VOC format can be found in this
8
+ 1 . Download the [ WIDER Face] ( http://shuoyang1213.me/WIDERFACE/ ) and unpack it to ` data ` folder.
9
+ 2 . Annotation in the VOC format can be found in this
12
10
[ repo] ( https://github.com/sovrasov/wider-face-pascal-voc-annotations.git ) . Move the annotation files from
13
11
` WIDER_train_annotations ` and ` WIDER_val_annotations ` folders to the ` Annotation ` folders inside the corresponding
14
12
directories ` WIDER_train ` and ` WIDER_val ` . Also annotation lists ` val.txt ` and ` train.txt ` should be copied to
15
13
` data/WIDERFace ` from ` WIDER_train_annotations ` and ` WIDER_val_annotations ` .
16
14
The directory should be like this:
17
15
18
16
```
19
- object_detection
20
- ├── tools
21
- ├── data
22
- │ ├── WIDERFace
23
- │ │ ├── WIDER_train
24
- │ | │ ├──0--Parade
25
- │ | │ ├── ...
26
- │ | │ ├── Annotations
27
- │ │ ├── WIDER_val
28
- │ | │ ├──0--Parade
29
- │ | │ ├── ...
30
- │ | │ ├── Annotations
31
- │ │ ├── val.txt
32
- │ │ ├── train.txt
33
-
17
+ data
18
+ └── WIDERFace
19
+ ├── WIDER_train
20
+ │ ├──0--Parade
21
+ │ ├── ...
22
+ │ └── Annotations
23
+ ├── WIDER_val
24
+ │ ├──0--Parade
25
+ │ ├── ...
26
+ │ └── Annotations
27
+ ├── val.txt
28
+ └── train.txt
34
29
```
35
30
36
31
## Training
@@ -40,7 +35,7 @@ object_detection
40
35
2 . To train the detector on a single GPU run in terminal:
41
36
``` bash
42
37
python3 ../../external/mmdetection/tools/train.py \
43
- ../../external/mmdetection/ configs/wider_face /mobilenetv2_tiny_ssd300_wider_face.py
38
+ configs/mobilenetv2_tiny_ssd300_wider_face.py
44
39
```
45
40
46
41
@@ -58,7 +53,7 @@ object_detection
58
53
``` bash
59
54
python3 ../../external/mmdetection/tools/voc_eval.py \
60
55
result.pkl \
61
- ../../external/mmdetection/ configs/wider_face /mobilenetv2_tiny_ssd300_wider_face.py
56
+ configs/mobilenetv2_tiny_ssd300_wider_face.py
62
57
```
63
58
One should observe 0.305 AP on validation set. For more detailed results and comparison with vanilla SSD300 see ` ../../external/mmdetection/configs/wider_face/README.md ` .
64
59
@@ -67,7 +62,7 @@ object_detection
67
62
1 . Convert PyTorch model to ONNX format: run script in terminal
68
63
``` bash
69
64
python3 tools/onnx_export.py \
70
- ../../external/mmdetection/ configs/wider_face /mobilenetv2_tiny_ssd300_wider_face.py
65
+ configs/mobilenetv2_tiny_ssd300_wider_face.py
71
66
< CHECKPOINT> \
72
67
face_detector.onnx
73
68
```
@@ -89,7 +84,7 @@ object_detection
89
84
To run the demo connect a webcam end execute command:
90
85
``` bash
91
86
python3 tools/detection_live_demo.py \
92
- ../../external/mmdetection/ configs/wider_face /mobilenetv2_tiny_ssd300_wider_face.py \
87
+ configs/mobilenetv2_tiny_ssd300_wider_face.py \
93
88
< CHECKPOINT> \
94
89
--cam_id 0
95
90
```
@@ -109,5 +104,5 @@ python3 tools/count_flops.py configs/mobilenetv2_tiny_ssd300_wider_face.py
109
104
described in this instruction.
110
105
* Fine-tuning steps are the same as step 2 for training, but some adjustments in config are needed:
111
106
- specify initial checkpoint containing a valid detector in ` load_from ` field of config
112
- ` configsmobilenetv2_tiny_ssd300_wider_face .py`
107
+ ` configs/mobilenetv2_tiny_ssd300_wider_face .py`
113
108
- edit ` data ` section of config to pass a custom dataset.
0 commit comments