ImgLabel https://github.com/tzutalin/labelImg
Before we can transform the newly created files to TFRecords we need to change a few lines in the generate_tfrecords.py file.
def class_text_to_int(row_label):
if row_label == 'Raspberry_Pi_3':
return 1
elif row_label == 'Arduino_Nano':
return 2
elif row_label == 'ESP8266':
return 3
elif row_label == 'Heltec_ESP32_Lora':
return 4
else:
return None
python generate_tfrecord.py --csv_input=data/train_labels.csv --image_dir=images/train --output_path=train.record
python generate_tfrecord.py --csv_input=data/test_labels.csv --image_dir=images/test --output_path=test.record
The label map maps an id to a name. We will put it in a folder called training, which is located in the object_detection directory. The labelmap for my detector can be seen below.
item {
id: 1
name: 'Steel_Pole'
}
item {
id: 2
name: 'Wood_Pole'
}
https://raw.githubusercontent.com/tensorflow/models/master/research/object_detection/model_main.py
pip3 install -U scikit-image pip3 install -U cython pip3 install "git+https://github.com/philferriere/cocoapi.git#egg=pycocotools&subdirectory=PythonAPI"
tf_upgrade_v2
--infile model_main.py
--outfile model_main_v2.py
python model_main_v2.py --logtostderr --model_dir=training/ --pipeline_config_path=training/faster_rcnn_inception_v2_pets.config