This is a custom python / TensorFlow library for applying transfer learning on a RetinaNet object detection model with image augmentation.
Simply use git clone <URL>
to clone this library into a local directory.
Subsequently, it can be added to your PYTHONPATH
either temporarily by
issuing the sys.path.append("/your/local/directory")
command in python,
or permanantly by exporting you directory into the PYTHONPATH
system variable.
For example, if using the bash shell, add the
export PYTHONPATH="${PYTHONPATH}:/your/local/directory"
in the ~/.bashrc
file.
This library requires python 3.8 and the TensorFlow, TensorFlow Addons, numpy, scikit-learn, and matplotlib python libraries for correct functionality.
To fine-tune a RetinaNet model on a custom data set, run the train_detector.py
module using command-line arguments:
python train_detector.py [OPTION]
,
or by supplying a parameter file that includes the command-line arguments:
python train_detector.py @<parameter_file>
.
The full list of command-line options can be printed on the STDOUT by:
python train_detector.py --help
.
The configuration file and initial checkpoint files are not included in this repository, and can be downloaded from, e.g. the TensorFlow Model Garden
The program expects JSON annotation files in the output format of the
VGG Image Annotator.
Furthermore, the train_detector.py
module requires ellipse annotations.
MIT, see LICENSE
.