This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python object_detection/export_tflite_ssd_graph.py \ | |
--pipeline_config_path="pipeline.config" \ | |
--trained_checkpoint_prefix="model.ckpt-500" \ | |
--output_directory="output" \ | |
--add_postprocessing_op=true | |
bazel run -c opt tensorflow/contrib/lite/toco:toco -- \ | |
--input_file=output/tflite_graph.pb \ | |
--output_file=output/detect.tflite \ | |
--input_shapes=1,300,300,3 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash object_detection/dataset_tools/create_pycocotools_package.sh /tmp/pycocotools | |
python setup.py sdist | |
(cd slim && python setup.py sdist) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud ml-engine jobs submit training training_job \ | |
--job-dir=gs://edge-tpu-demo/train \ | |
--packages dist/object_detection-0.1.tar.gz,slim/dist/slim-0.1.tar.gz,/tmp/pycocotools/pycocotools-2.0.tar.gz | |
--module-name object_detection.model_tpu_main \ | |
--runtime-version 1.9 \ | |
--scale-tier BASIC_TPU \ | |
--region europe-west4 \ | |
-- \ | |
--model_dir=gs://edge-tpu-demo/train | |
--tpu_zone europe-west4 \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
item { | |
id: 1 | |
name: 'cutter' | |
} | |
item { | |
id: 2 | |
name: 'plier' | |
} | |
item { | |
id: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
model { | |
ssd { | |
num_classes: 3 | |
... | |
train_config { | |
batch_size: 24 | |
fine_tune_checkpoint: "gs://edge-tpu-demo/model.ckpt" | |
freeze_variables: [ | |
'FeatureExtractor/MobilenetV2/Conv', | |
'FeatureExtractor/MobilenetV2/expanded_conv_1', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone git@github.com:tzutalin/labelImg.git | |
cd labelImg | |
brew install qt | |
brew install libxml2 | |
make qt5py3 | |
python3 labelImg.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First install ffmpeg | |
# Then set the following 2 variables | |
FILENAME=your_file.mp4 | |
NUMBER_OF_IMAGES=50 | |
VIDEO_LENGTH_IN_SECONDS=`ffprobe -i $FILENAME -show_entries format=duration -v quiet -of csv="p=0"` | |
ffmpeg -i $FILENAME -vf fps=$NUMBER_OF_SECONDS/$NUMBER_OF_IMAGES image%04d.jpg |