-
-
Save det-peralta/5753f37f2bb46dce71b9fcc3cbef8f05 to your computer and use it in GitHub Desktop.
TensorFlow Object Detection Setup (Linux)
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
# Change this path to your config directory | |
CONFIG_DIR="/config" | |
cd /tmp | |
# Install required software | |
apt-get update | |
apt-get upgrade | |
apt-get install unzip | |
apt-get install git | |
apt-get install libatlas-base-dev libopenjp2-7 libtiff5 | |
#Install tensorflow | |
pip3 install tensorflow==1.13.1 | |
# Clone the latest code from GitHub | |
git clone --depth 1 https://github.com/tensorflow/models.git tensorflow-models | |
# download protobuf 3.4 | |
curl -OL https://github.com/google/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-x86_64.zip | |
unzip -a protoc-3.7.1-linux-x86_64.zip -d protobuf | |
mv protobuf/bin tensorflow-models/research | |
# Build the protobuf models | |
cd tensorflow-models/research/ | |
./bin/protoc object_detection/protos/*.proto --python_out=. | |
# Copy only necessary files | |
mkdir -p ${CONFIG_DIR}/tensorflow/object_detection | |
touch ${CONFIG_DIR}/tensorflow/object_detection/__init__.py | |
mv object_detection/data ${CONFIG_DIR}/tensorflow/object_detection | |
mv object_detection/utils ${CONFIG_DIR}/tensorflow/object_detection | |
mv object_detection/protos ${CONFIG_DIR}/tensorflow/object_detection | |
#Model Selection | |
curl -OL http://download.tensorflow.org/models/object_detection/faster_rcnn_inception_v2_coco_2018_01_28.tar.gz | |
tar -xzvf faster_rcnn_inception_v2_coco_2018_01_28.tar.gz | |
mv faster_rcnn_inception_v2_coco_2018_01_28 ${CONFIG_DIR}/tensorflow/ | |
# Cleanup | |
rm -rf /tmp/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -s https://gist.githubusercontent.com/det-peralta/5753f37f2bb46dce71b9fcc3cbef8f05/raw/2bfe9296c92915c763d6cd2d069b3470fa139f90/tensorflow_setup.sh | sh