Git Product home page Git Product logo

object_detection's Introduction

Object Detection

Django REST framework API for object detection. Model trained on COCO dataset.

How to use

  1. Clone the repository:
git clone https://github.com/robot-le/object_detection.git
  1. Build a docker image:
docker build . --tag object_detection
  1. Run the container:
docker run -p 8084:8000 object_detection
  1. Send a request with such tools as Postman or Insomnia, or send it from a terminal with curl:
curl --location 'http://localhost:8084/api/detect-objects/' --form 'image=@"<path_to_your_image>"'

Example:

8

In Postman send POST request with this photo in body as form-data:

image

In response you'll get an object with a list of detected objects with label, confidence, and bounding box coordinates:

{
    "detected_objects": [
        {
            "label": "car",
            "confidence": 0.9929202198982239,
            "box": {
                "a": 70,
                "b": 344,
                "c": 266,
                "d": 394
            }
        },
        {
            "label": "person",
            "confidence": 0.9896812438964844,
            "box": {
                "a": 266,
                "b": 330,
                "c": 288,
                "d": 376
            }
        },
        {
            "label": "person",
            "confidence": 0.9634418487548828,
            "box": {
                "a": 295,
                "b": 332,
                "c": 311,
                "d": 376
            }
        },
        {
            "label": "person",
            "confidence": 0.9565578699111938,
            "box": {
                "a": 416,
                "b": 328,
                "c": 440,
                "d": 378
            }
        },
        {
            "label": "person",
            "confidence": 0.9295955300331116,
            "box": {
                "a": 588,
                "b": 326,
                "c": 620,
                "d": 380
            }
        },
        {
            "label": "person",
            "confidence": 0.9230886101722717,
            "box": {
                "a": 306,
                "b": 331,
                "c": 320,
                "d": 375
            }
        },
        {
            "label": "person",
            "confidence": 0.9230819344520569,
            "box": {
                "a": 625,
                "b": 326,
                "c": 639,
                "d": 368
            }
        },
        {
            "label": "traffic light",
            "confidence": 0.9148918390274048,
            "box": {
                "a": 20,
                "b": 163,
                "c": 44,
                "d": 201
            }
        },
        {
            "label": "person",
            "confidence": 0.9024598598480225,
            "box": {
                "a": 356,
                "b": 333,
                "c": 372,
                "d": 375
            }
        },
        {
            "label": "car",
            "confidence": 0.8786023855209351,
            "box": {
                "a": 371,
                "b": 334,
                "c": 401,
                "d": 354
            }
        },
        {
            "label": "person",
            "confidence": 0.8716214299201965,
            "box": {
                "a": 402,
                "b": 327,
                "c": 416,
                "d": 367
            }
        },
        {
            "label": "traffic light",
            "confidence": 0.8687766194343567,
            "box": {
                "a": 440,
                "b": 230,
                "c": 462,
                "d": 252
            }
        },
        {
            "label": "person",
            "confidence": 0.8665909171104431,
            "box": {
                "a": 473,
                "b": 330,
                "c": 495,
                "d": 374
            }
        },
        {
            "label": "traffic light",
            "confidence": 0.7571566700935364,
            "box": {
                "a": 454,
                "b": 232,
                "c": 466,
                "d": 250
            }
        },
        {
            "label": "traffic light",
            "confidence": 0.700567901134491,
            "box": {
                "a": 0,
                "b": 164,
                "c": 14,
                "d": 202
            }
        },
        {
            "label": "traffic light",
            "confidence": 0.558958888053894,
            "box": {
                "a": 248,
                "b": 300,
                "c": 254,
                "d": 308
            }
        },
        {
            "label": "person",
            "confidence": 0.5131950378417969,
            "box": {
                "a": 120,
                "b": 333,
                "c": 130,
                "d": 357
            }
        }
    ]
}

object_detection's People

Contributors

robot-le avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.