Object Detection Api


Object Detection is part of Machine Learning , in which we use different algorithm to detect object in Image, Or Video files. Our algorithm can detect around 10K+ different objects.

Object Detection Example

Endpoint

POST - /ml/object-detection

Parameters

  • file

    • required
    • Type: Image File is Required
    • Max Size: 20MB
  • mode

    • optional
    • Type: xywh, xywhn, xyxy, xyxyn
    • Default: xyxyn
    • Details: - based on mode, output will contain different fields related to object position
  • threshold

    • optional
    • Type: number between 1 to 100
    • Default: 40
    • Details - threshold is number which defines confidence of object inside the image. Object with less confidence than threshold will get ignored in results

Example

Sample Image used

detectio-demo image

Request

curl --form "file=@detection-demo-file.jpg $BASE_ROUTE/ml/object-detection

Response with different Mode

{
  "count": 3,
  "data": [
    {
      "class": 0,
      "confidence": 0.9367442131,
      "name": "person",
      "xmax": 0.7731372118,
      "xmin": 0.1024992168,
      "ymax": 0.7416218519,
      "ymin": 0.1403899938
    },
    {
      "class": 16,
      "confidence": 0.9351310134,
      "name": "dog",
      "xmax": 1,
      "xmin": 0.0016319321,
      "ymax": 1,
      "ymin": 0.6291618943
    },
    {
      "class": 2,
      "confidence": 0.7377066612,
      "name": "car",
      "xmax": 0.9993353486,
      "xmin": 0.7337724566,
      "ymax": 0.6310616732,
      "ymin": 0.4480176568
    }
  ],
  "status": "done"
}
{
  "count": 3,
  "data": [
    {
      "class": 0,
      "confidence": 0.9367442131,
      "height": 619.8700561523,
      "name": "person",
      "width": 460.728302002,
      "xcenter": 300.7811279297,
      "ycenter": 454.6770935059
    },
    {
      "class": 16,
      "confidence": 0.9351310134,
      "height": 382.3341064453,
      "name": "dog",
      "width": 685.8788452148,
      "xcenter": 344.0605773926,
      "ycenter": 839.8329467773
    },
    {
      "class": 2,
      "confidence": 0.7377066612,
      "height": 188.7183837891,
      "name": "car",
      "width": 182.4417114258,
      "xcenter": 595.3225097656,
      "ycenter": 556.2653808594
    }
  ],
  "status": "done"
}
{
  "count": 3,
  "data": [
    {
      "class": 0,
      "confidence": 0.9367442131,
      "height": 0.601231873,
      "name": "person",
      "width": 0.6706379652,
      "xcenter": 0.4378182292,
      "ycenter": 0.4410059154
    },
    {
      "class": 16,
      "confidence": 0.9351310134,
      "height": 0.3708381355,
      "name": "dog",
      "width": 0.9983680248,
      "xcenter": 0.5008159876,
      "ycenter": 0.8145809174
    },
    {
      "class": 2,
      "confidence": 0.7377066612,
      "height": 0.1830440164,
      "name": "car",
      "width": 0.265562892,
      "xcenter": 0.866553843,
      "ycenter": 0.5395396352
    }
  ],
  "status": "done"
}
{
  "count": 3,
  "data": [
    {
      "class": 0,
      "confidence": 0.9367442131,
      "name": "person",
      "xmax": 531.1452636719,
      "xmin": 70.4169616699,
      "ymax": 764.612121582,
      "ymin": 144.7420806885
    },
    {
      "class": 16,
      "confidence": 0.9351310134,
      "name": "dog",
      "xmax": 687,
      "xmin": 1.1211373806,
      "ymax": 1031,
      "ymin": 648.6658935547
    },
    {
      "class": 2,
      "confidence": 0.7377066612,
      "name": "car",
      "xmax": 686.5433959961,
      "xmin": 504.1016845703,
      "ymax": 650.6245727539,
      "ymin": 461.9061889648
    }
  ],
  "status": "done"
}
Contributors: coder9118