Skip to content

Commit 0d48900

Browse files
Merge pull request #801 from qingqing01/ssd_doc
README.md for MobileNet-SSD.
2 parents 66d3b66 + 9718f31 commit 0d48900

File tree

4 files changed

+95
-3
lines changed

4 files changed

+95
-3
lines changed

fluid/object_detection/README.md

Lines changed: 95 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,99 @@ The minimum PaddlePaddle version needed for the code sample in this directory is
22

33
---
44

5-
# MobileNet-SSD
5+
## SSD Object Detection
66

7-
This model built with paddle fluid is still under active development and is not
8-
the final version. We welcome feedbacks.
7+
### Introduction
8+
9+
[Single Shot MultiBox Detector (SSD)](https://arxiv.org/abs/1512.02325) framework for object detection is based on a feed-forward convolutional network. The early network is a standard convolutional architecture for image classification, such as VGG, ResNet, or MobileNet, which is als called base network. In this tutorial we used [MobileNet](https://arxiv.org/abs/1704.04861).
10+
11+
### Data Preparation
12+
13+
You can use [PASCAL VOC dataset](http://host.robots.ox.ac.uk/pascal/VOC/) or [MS-COCO dataset](http://cocodataset.org/#download).
14+
15+
#### PASCAL VOC Dataset
16+
17+
If you want to train model on PASCAL VOC dataset, please download datset at first, skip this step if you already have one.
18+
19+
```bash
20+
cd data/pascalvoc
21+
./download.sh
22+
```
23+
24+
The command `download.sh` also will create training and testing file lists.
25+
26+
#### MS-COCO Dataset
27+
28+
If you want to train model on MS-COCO dataset, please download datset at first, skip this step if you already have one.
29+
30+
```
31+
cd data/coco
32+
./download.sh
33+
```
34+
35+
### Train
36+
37+
#### Download the Pre-trained Model.
38+
39+
We provide two pre-trained models. The one is MobileNet-v1 SSD trained on COCO dataset, but removed the convolutional predictors for COCO dataset. This model can be used to initialize the models when training other dataset, like PASCAL VOC. Then other pre-trained model is MobileNet v1 trained on ImageNet 2012 dataset, but removed the last weights and bias in Fully-Connected layer.
40+
41+
Declaration: the MobileNet-v1 SSD model is converted by [TensorFlow model](https://github.com/tensorflow/models/blob/f87a58cd96d45de73c9a8330a06b2ab56749a7fa/research/object_detection/g3doc/detection_model_zoo.md). The MobileNet v1 model is converted [Caffe](https://github.com/shicai/MobileNet-Caffe).
42+
43+
- Download MobileNet-v1 SSD:
44+
```
45+
./pretrained/download_coco.sh
46+
```
47+
- Download MobileNet-v1:
48+
```
49+
./pretrained/download_imagenet.sh
50+
```
51+
52+
#### Train on PASCAL VOC
53+
- Train on one device (/GPU).
54+
```python
55+
env CUDA_VISIABLE_DEVICES=0 python -u train.py --parallel=False --data='pascalvoc' --pretrained_model='pretrained/ssd_mobilenet_v1_coco/'
56+
```
57+
- Train on multi devices (/GPUs).
58+
59+
```python
60+
env CUDA_VISIABLE_DEVICES=0,1 python -u train.py --batch_size=64 --data='pascalvoc' --pretrained_model='pretrained/ssd_mobilenet_v1_coco/'
61+
```
62+
63+
#### Train on MS-COCO
64+
- Train on one device (/GPU).
65+
```python
66+
env CUDA_VISIABLE_DEVICES=0 python -u train.py --parallel=False --data='coco' --pretrained_model='pretrained/mobilenet_imagenet/'
67+
```
68+
- Train on multi devices (/GPUs).
69+
```python
70+
env CUDA_VISIABLE_DEVICES=0,1 python -u train.py --batch_size=64 --data='coco' --pretrained_model='pretrained/mobilenet_imagenet/'
71+
```
72+
73+
TBD
74+
75+
### Evaluate
76+
77+
```python
78+
env CUDA_VISIABLE_DEVICES=0 python eval.py --model='model/90' --test_list=''
79+
```
80+
81+
TBD
82+
83+
### Infer and Visualize
84+
85+
```python
86+
env CUDA_VISIABLE_DEVICES=0 python infer.py --batch_size=2 --model='model/90' --test_list=''
87+
```
88+
89+
TBD
90+
91+
### Released Model
92+
93+
94+
| Model | Pre-trained Model | Training data | Test data | mAP |
95+
|:------------------------:|:------------------:|:----------------:|:------------:|:----:|
96+
|MobileNet-v1-SSD 300x300 | COCO MobileNet SSD | VOC07+12 trainval| VOC07 test | xx% |
97+
|MobileNet-v1-SSD 300x300 | ImageNet MobileNet | VOC07+12 trainval| VOC07 test | xx% |
98+
|MobileNet-v1-SSD 300x300 | ImageNet MobileNet | MS-COCO trainval | MS-COCO test | xx% |
99+
100+
TBD

fluid/object_detection/data/pascalvoc/download.sh

100644100755
File mode changed.

fluid/object_detection/pretrained/download_coco.sh

100644100755
File mode changed.

fluid/object_detection/pretrained/download_imagenet.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)