This repository contains object detection api for detecting alchohol bottle.
Need to install few dependencies.
-
First we need to install anaconda Please follow this tutorial to install anaconda Use this link to download anaconda https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
-
create a virtual env with the following command
conda create -n env_name python=3.8.5 conda activate env_name
-
Install other dependencies by using the following command
cd path_to_project_folder pip3 install -r requirements.txt
-
clone tensorflow object detection api:
git clone --depth 1 https://github.com/tensorflow/models
-
Download "checkpoints" folder for object detection api from:
https://drive.google.com/drive/folders/1IScb4XRMbwNLFi_m6Gj22gLD8WQXgUg6?usp=sharing
-
Setting up other configuration: Go to this path:
cd models/research/
Run this command:
protoc object_detection/protos/*.proto --python_out=.
If 'protoc' is not found or any error occurs regarding 'protoc', follow this http://google.github.io/proto-lens/installing-protoc.html tutorial (linux portion). Then run the command again.
Otherwise jump to next step. Run these commands next:
cp object_detection/packages/tf2/setup.py . python -m pip install .
-
Run the API: Make sure, present directory is project directory and run this command.
python3 main.py
http://0.0.0.0:8000/object-detection
{ "img_base64": }
{ "output_image": <base64 code of image, "object_cords": [ ] }
http://0.0.0.0:8000/post_proc
{ "img_base64": , "x1": int "y1": int "x2": int "y2": int }
{ "output_image": <base64 code of image, }