This blog is intended to simply understand how to use a web cam and use pre-trained models on a video stream for the ‘out-of-box’ inference.
Installation list :
- Tensorflow Installation
- Tensorflow Object Detection API Installation
- Steps for organizing the data and download pre-trained models
The hyper-links has detailed instructions to installations. However I would just like to post some of the additional commands I had to run on windows10 while following the documentation. Hoping it would help when you go through the installations by yourself.
A. When in COCO API Installation section:
The command ‘pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI’ didn’t work as git was not installed. Simply, run ‘conda install git’. And re-try.
B. While installing Object Detection API:
Instead of ‘cp object_detection/packages/tf2/setup.py .’ as stated in the documentation, use the folllwing with two changes: copy instaed of cp & backslash instead of forward slash.
copy object_detection\packages\tf2\setup.py .
This command is simply meant to copy the setup.py file to the research folder.
C. I recommend downloading the Object_detection_camera.py file from here instead of running snippets of code from the page. Don’t worry, It won’t create the data folder multiple times.
Only two parameters are to be changed to test the different models in the above python file:
# Download and extract model
MODEL_DATE = ‘20200711’
MODEL_NAME = ‘efficientdet_d7_coco17_tpu-32’
Writer: Piyush Kulkarni (Data Scientist)