Skip to content

Instantly share code, notes, and snippets.

@StanCallewaert
Last active April 3, 2019 12:14
Show Gist options
  • Save StanCallewaert/c8d5997a0352bc90b2afa92d9a5f2a13 to your computer and use it in GitHub Desktop.
Save StanCallewaert/c8d5997a0352bc90b2afa92d9a5f2a13 to your computer and use it in GitHub Desktop.
Convert our data to the TFRecords file format
git clone git@github.com:datitran/raccoon_dataset.git
# Load your images and annotations in the correct folder
rm raccoon_dataset/annotations/* raccoon_dataset/images/*
mv image*.xml raccoon_dataset/annotations/
mv image*.jpg raccoon_dataset/images/
# Convert your XML files to a CSV file
cd raccoon_dataset
python3 xml_to_csv.py
# Before generating the TFRecords a small change to the script change has to be made:
# Open the generate_tfrecord.py file and change the function on line 31.
# We should map our own labels to a numeric value, e.g.:
#
# if row_label == 'screwdriver':
# return 1
# elif row_label == 'cutter':
# return 2
# elif row_label == 'plier':
# return 3
python3 generate_tfrecords.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment