Skip to content

NurayJannat/Custom_object_detection_API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CUSTOM OBJECT DETECTION API

This repository contains object detection api for detecting alchohol bottle.

Dataset

https://www.kaggle.com/datasets/dataclusterlabs/alcohol-bottle-images-glass-bottles?select=1597906495385.jpg

Installation Process

Need to install few dependencies.

  1. 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

  2. create a virtual env with the following command

     conda create -n env_name python=3.8.5
     conda activate env_name
    
  3. Install other dependencies by using the following command

    cd path_to_project_folder
    pip3 install -r requirements.txt
    
  4. clone tensorflow object detection api:

     git clone --depth 1 https://github.com/tensorflow/models
    
  5. Download "checkpoints" folder for object detection api from:

     https://drive.google.com/drive/folders/1IScb4XRMbwNLFi_m6Gj22gLD8WQXgUg6?usp=sharing
    
  6. 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 .
    
  7. Run the API: Make sure, present directory is project directory and run this command.

    python3 main.py
    

    Test route

    http://0.0.0.0:8000/object-detection
    
    Request Body:

    { "img_base64": }

    Response Body:

    { "output_image": <base64 code of image, "object_cords": [ ] }

    http://0.0.0.0:8000/post_proc
    
    Request Body:

    { "img_base64": , "x1": int "y1": int "x2": int "y2": int }

    Response Body:

    { "output_image": <base64 code of image, }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages