Object Detection
Object Detection
If you don’t have above option “NVIDIA Control Panel” upon right clicking on desktop,
you only have to follow (a) Tensorflow CPU Installation whereas if you have above
option, go with (b) Tensorflow GPU installation
Note: click on download button wherever its mention for respective installation.
www.extrinsictechnology.com
a. Tensorflow CPU installation
Download Anaconda
1. Download visual studio 2017 from below link and install only with .NET
installation which will help us to install compatible C++ library.
www.extrinsictechnology.com
Check CUDA enabled GPUs
https://en.wikipedia.org/wiki/CUDA
Install any one from below depending on your graphic card
a. CUDA 9 with CUDNN 7.3.1
Install CUDA 9 and copy CUDNN files in NVIDIA GPU computing folder
BIN
Include
X64
----------------------------------------OR------------------------------------------------------
b. CUDA 10 with CUDNN
Download Anaconda
www.extrinsictechnology.com
Check tensorflow is installed properly or not.
Python (3.7.0) (no error should populate after installation)
>>import tensorflow as tf
All in One Download Link
>>
here
Step 2: Tensorflow Framework Installation
Download Tensorflow
Framework
Download Protos
Set PYTHONPATH=C:\tensorflow\models\research\slim;C:\tensorflow\models\research
www.extrinsictechnology.com
Step 3: Dataset Preparation and Annotation
1. Prepare dataset – before feeding into machine learning model
2. Dataset : combination of different form of same data
Download some free image dataset you can try for learning purpose.
Download LABEL_IMG
Labelled dataset
DOG and PANDA
www.extrinsictechnology.com
Step 4: Convert labelled dataset into TF-record
(File generated before model training)
Now its turn to distribute your labelled dataset into two folder
Folder “train” should consist of 90% of entire dataset
Folder “test” should consist of 10% of entire dataset
Use commands
set PYTHONPATH=C:\tensorflow\models\research\slim;C:\tensorflow\models\research
1. XML to CSV
Python xml_to_csv.py
Use above command twice by changing folder name will result in below two files.
>> test.csv
>>train.csv
Paste above csv files in respective folder
2. CSV to TF-RECORD
Move test and train folder to the tensorflow/models/research/object_detection
Also move generate_ftrecord.py file to the same folder
Mention your classifier name (line 39,41)
“dog” “panda”
Navigate tensorflow/models/research/object_detection
Generate test.record and train.record
www.extrinsictechnology.com
set PYTHONPATH=C:\tensorflow\models\research\slim;C:\tensorflow\models\research
Test.record
python generate_tfrecord.py --csv_input=C:/tensorflow/models/research/object_detection/test/test_labels.csv --
output_path=C:/tensorflow/models/research/object_detection/test/test.record
Train.record
python generate_tfrecord.py --csv_input=C:/tensorflow/models/research/object_detection/train/train_labels.csv --
output_path=C:/tensorflow/models/research/object_detection/train/train.record
www.extrinsictechnology.com
Step 5: Train the model
2. Download Labelmap.pbtxt
Download
www.extrinsictechnology.com
set PYTHONPATH=C:\tensorflow\models\research\slim;C:\tensorflow\models\research
Run below commands to start training (I will suggest to copy first in notepad and then paste to
anaconda prompt)
python train.py --logtostderr --train_dir=training/ --
pipeline_config_path=training/ssd_mobilenet_v1_coco.config
Check how model is trained with the help of tensorboard (run below command in legacy folder)
Deployment
Webserver Code Download
Commands
Set flask_env=development
Flask run
www.extrinsictechnology.com
Thank you ML enthusiastic for learning this course.
Good Luck for your future!
www.extrinsictechnology.com