This is an implementation of SSD for object detection in Tensorflow. It contains complete code for preprocessing, postprocessing, training and test. Besides, this repository is easy-to-use and can be developed on Linux and Windows.
- Python 3.x
- Tensorflow 1.x
- Opencv-python
- Pandas
Download and unzip this repository.
cd ../SSD/label
Open the label.txt
and revise its class names as yours.
Copy your images and annotation files to directories ../SSD/data/annotation/images
and ../SSD/data/annotation/images/xml
respectively, where the annotations should be obtained by a graphical image annotation tool and saved as XML files in PASCAL VOC format.
cd ../SSD/code
run
python spilt.py
Then train and val images will be generated in ../SSD/data/annotation/train
and /SSD/data/annotation/test
directories, respectively.
cd ../SSD/code
run
python anchor_generators.py
Anchors generated will be saved in the directory ../SSD/anchor/anchor.txt
.
The model parameters, training parameters and eval parameters are all defined by parameters.py
.
cd ../SSD/code
run
python train.py
The model will be saved in directory ../SSD/model/checkpoint
, and some detection results are saved in ../SSD/pic
.
cd ../SSD
run
tensorboard --logdir=model/
Open the URL in browser to visualize graph of the model, as follows:
Belows are some successful detection examples in my dataset: