Skip to content

Instantly share code, notes, and snippets.

@mehdidc
Created May 28, 2018 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mehdidc/6b41870388338f421947190139250a18 to your computer and use it in GitHub Desktop.
Save mehdidc/6b41870388338f421947190139250a18 to your computer and use it in GitHub Desktop.
wget https://downloads.rclone.org/v1.41/rclone-v1.41-linux-amd64.zip
unzip rclone-v1.41-linux-amd64.zip
wget https://gist.githubusercontent.com/mehdidc/9f9f7d1f96e2c53571dfac501f61dbbb/raw/252e45e95159dc311468e8aefa875700bce1d195/gistfile1.txt --output-document=$HOME/.rclone.conf
mkdir -p data
git clone https://github.com/tensorflow/models/
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
rm -fr protoc && unzip protoc-3.2.0-linux-x86_64.zip -d protoc
cd models/research/ && ../../protoc/bin/protoc object_detection/protos/*.proto --python_out=.
pip install contextlib2
cp models/research/object_detection/dataset_tools/create_oid_tf_record.py .
mkdir -p data/records/train data/records/valid data/records/test
cp models/research/object_detection/train.py .
cp models/research/object_detection/eval.py .
mkdir M
cd M && wget http://download.tensorflow.org/models/object_detection/ssd_mobilenet_v1_coco_2017_11_17.tar.gz && tar xvf ssd_mobilenet_v1_coco_2017_11_17.tar.gz
wget !wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
unzip ngrok-stable-linux-amd64.zip
pip install Cython
pip install pycocotools
rclone-v1.41-linux-amd64/rclone copy mehdi:projects/arpp/coco data
mkdir -p data/records/train data/records/valid data/records/test
wget https://gist.githubusercontent.com/mehdidc/f060625715165ffaa96f0da97fb09624/raw/42e4459605ee440d85365420498d415f7bbf3e5a/create_oid_tf_record.py --output-document=create_oid_tf_record.py
python create_oid_tf_record.py --input_annotations_csv data/annotations/train.csv --input_images_directory data/images/train --input_label_map data/annotations/label_map.pbtxt --output_tf_record_path_prefix data/records/train/record --num_shards 1
python create_oid_tf_record.py --input_annotations_csv data/annotations/valid.csv --input_images_directory data/images/valid --input_label_map data/annotations/label_map.pbtxt --output_tf_record_path_prefix data/records/valid/record --num_shards 1
python create_oid_tf_record.py --input_annotations_csv data/annotations/test.csv --input_images_directory data/images/test --input_label_map data/annotations/label_map.pbtxt --output_tf_record_path_prefix data/records/test/record --num_shards 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment