Take Advantage of “Tensorflow Object Detection API”!!!

Source: Deep Learning on Medium

Take Advantage of “Tensorflow Object Detection API”!!!

The following is the step by step and straight Tutorial for taking advantage of the “Tensorflow Object Detection API” viz. models repository.

Note: I have followed these steps on Ubuntu 16.04 and Ubuntu 18.04 systems.

but before proceeding for actual process our system must have some required libraries are as follows:

I. first check whether the system has a ‘protobuf-compiler’ library in the ubuntu system by hitting ‘protoc — version’ command in a terminal, if you get the result “libprotoc 3.0.0″ you are ready to jump for the main process, but if in case it fails to show version then install protobuf-compiler by using

sudo apt install protobuf-compiler’

Welcome to the world of Tensorflow!!!

Cloning Process

1. The very first step is to clone the ‘models’ repository from this link, then by using git clone command in a local system you will have models directory.

“git clone https://github.com/tensorflow/models.git

2. once the models repo cloned to the system, you can see models directory, within models you will find ‘research’ folder along with other stuff and directories, but our main goal is to work with research directory at least for this tutorial.

Protoc Process

3. the very next step is to play with some .proto files which you will find inside “path_to_the/models/research$ object_detection/protos/*.proto”, now just change your directory to “path_to_the/models/research$” and from within research directory hit the command “protoc object_detection/protos/*.proto — python_out=.”.

if the 3rd process is successfully executed you won’t find any errors in a terminal, but if you do so then please install protobuf-compiler properly and repeat 3rd process again.

after the execution of 3rd process, you will also be seeing .py files in “path_to_the/models/research$ object_detection/protos/*.py”

Export Path Process

4. This is a very important process if you don’t want to see any errors like “No module named nets” in the future while using models repo and training your Neural Networks. so to proceed with this, all you have to hit the command “ sudo vim ~/.bashrc”, this will open bashrc file, in the bashrc file all you have to paste this:

export PYTHONPATH=$PYTHONPATH:’path_to_the/research/’:’path_to_the/research/slim’

once you write and quit bashrc, don’t forget to hit command “source ~/.bashrc”, it will automatically execute bashrc file every time you open terminal.

Testing Process

5. this is the last and very important process to know whether our hard work really paid off or not??? so to check it out, hit the command from path_to_the/models/research$ python object_detection/builders/model_builder_test.py.

if the above step runs successfully, you will see the following result in terminal: