Skip to content

Instantly share code, notes, and snippets.

@Namburger
Last active August 15, 2020 00:28
Show Gist options
  • Save Namburger/67c3bcffb262ec311f79663117921ea5 to your computer and use it in GitHub Desktop.
Save Namburger/67c3bcffb262ec311f79663117921ea5 to your computer and use it in GitHub Desktop.
Install object detection API
# Import tensorflow 1.x and install tf_slim.
%tensorflow_version 1.x
!pip install tf_slim
!pip show tensorflow
# Install protobuf-compiler and the tensorflow's Object Detection API.
!apt-get install protobuf-compiler
!git clone https://github.com/tensorflow/models.git
%cd models/research
# Compile all the protobuf dependencies.
!protoc object_detection/protos/*.proto --python_out=.
# Set up and install the object detection API.
!cp object_detection/packages/tf1/setup.py .
!python -m pip install .
# Run a test to make sure setup is correct.
!python object_detection/builders/model_builder_test.py
import os
os.environ['PYTHONPATH'] += ':/content/models/research/'
os.environ['PYTHONPATH'] += ':/content/models/research/slim/'
os.environ['PYTHONPATH'] += ':/content/models/research/object_detection/utils/'
os.environ['PYTHONPATH'] += ':/content/models/research/object_detection'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment