- Make sure you have the prerequisites for the Object Detection API installed. The directions for installations can be found here
- Download the training and evaluation images in this directory
Run the following commands
# Unzip the contents
unzip characters.zip
unzip eval_images.zip
# Change the filneame attribute in the train and eval csvs to point to the correct location of the images
python change_csv.py
Make sure the images are inside the CharacterFinder/ directory
The following instuctions only creates training and evaluation records for one character - Santa. If you want to train on more characters, follow these instructions first
- After the csv points to the correct location, we can generate the record files
# Generate training record
python --csv_input train.csv --output_path train.record --label_map_path characters_label_map.pbtext
# Generate evaluation record
python --csv_input eval.csv --output_path eval.record --label_map_path characters_label_map.pbtext
For training you need to construct an object-detection training pipeline.
- You can use any of the config files present in object_detection/samples/configs/ as basis
- Adjust the number of classes depending on the number of character you are training on
- It is recommended to train your model from a pre-trained checkpoint. Tensorflow provides several pre-trained checkpoints which can be found here
- Changes in the config file:
- Change the
fine_tune_checkpoint: "PATH_TO_BE_CONFIGURED/model.ckpt"
to point to the checkpoint you want to use - In
change thetrain_input_reader: { tf_record_input_reader { input_path: "PATH_TO_BE_CONFIGURED/train.record" } label_map_path: "PATH_TO_BE_CONFIGURED/characters_label_map.pbtxt" }
input_path
to point to the train.record file generated in the previous step and change thelabel_map_path
to point to the appropriate label map - Change the