Python modules and scripts for conversion between popular visual object detection annotation formats.
Since we'll utilize the TensorFlow models API in order to perform TFRecord conversions we'll need to have access to the TensorFlow Object Detection API.
(NOTE: the below is a simplification of the official installation instructions)
- Clone the TensorFlow Object Detection API from GitHub and set the API's base
directory as an environment variable for later use:
$ cd <directory_of_your_choice> $ git clone git@github.com:tensorflow/models.git $ cd models $ export TFOD=`pwd`
- Create a new Python environment (or activate an existing Python environment).
In this example we'll use an Anaconda environment:
$ conda create -n tltod python=3 --yes $ conda activate tltod
- Install TensorFlow and other necessary packages:
$ pip install tensorflow $ pip install Cython $ pip install contextlib2 $ pip install pillow $ pip install lxml $ pip install jupyter $ pip install matplotlib
- Compile the Protobuf libraries:
$ cd ${TFOD}/research $ protoc object_detection/protos/*.proto --python_out=.
- Add the API's
research
andresearch/slim
directories to thePYTHONPATH
variable:$ cd ${TFOD}/research $ export PYTHONPATH=`pwd`:`pwd`/slim
- Test the installation:
$ python object_detection/builders/model_builder_test.py