CHOOCH API DOCUMENTATION

INTRODUCTION

The Chooch API is organized around REST. The API recognizes objects and concepts in videos and images from our pre-trained models.

The API is compatible with livestreams and live tagging.

Image Recognition API

The image recognition API is a straightforward REST API conducting classification and object recognition predictions on images. The image URL is passed as a field to the API and the API returns a JSON based response with relevant predictions.

SAMPLE INPUT (IMAGE)

API input fields are:

  • url: URL of the image file. In this example it is https://s3.amazonaws.com/choochdashboard/base_site/ronaldo_suit.jpg
  • predicttype: There are two prediction types:
    1- “basic” and 2- “dense.” Basic retrieves general prediction results. Dense retrieves more detailed multilayer results when available.
  • apikey: API key provided by Chooch. In this example it is 346g5717-1sd3-35h6-9104-b8h5c819dn19

SAMPLE OUTPUT (IMAGE)

The sample JSON response is:

                                        

{
  "status": "ok",
  "url": "https://s3.amazonaws.com/choochdashboard/base_site/ronaldo_suit.jpg",
  "predictions": [
    {
      "class_title": "Cristiano Ronaldo",
      "order": "1"
    },
    {
      "class_title": "tom ford style",
      "order": "2"
    },
    {
      "class_title": "double-breasted suit, fashion",
      "order": "3"
    },
    {
      "class_title": "man",
      "order": "6"
    },
    {
      "class_title": "suit",
      "order": "7"
    },
    {
      "class_title": "cartoon, sterling archer",
      "order": "8"
    },
    {
      "class_title": "icon",
      "order": "9"
    },
    {
      "class_title": "man's clothing",
      "order": "10"
    },
    {
      "class_title": "face",
      "order": "11"
    },
    {
      "class_title": "male",
      "order": "12"
    },
    {
      "class_title": "young man",
      "order": "13"
    },
    {
      "class_title": "actor, doer",
      "order": "14"
    },
    {
      "class_title": "tie",
      "order": "15"
    },
    {
      "class_title": "striped tie",
      "order": "16"
    },
    {
      "class_title": "windsor tie",
      "order": "17"
    },
    {
      "class_title": "four-in-hand tie",
      "order": "18"
    },
    {
      "class_title": "cravat",
      "order": "19"
    }
  ],
  "texts": {
    "status": "limited to 15 results",
    "predictions": [
      
    ],
    "summary": [
      
    ]
  },
  "objects": {
    "predictions": [
      {
        "sub_predictions": [
          {
            "class_title": "tom ford style",
            "order": 1
          },
          {
            "class_title": "double breasted suit",
            "order": 2
          },
          {
            "class_title": "brown tie",
            "order": 3
          },
          {
            "class_title": "double-breasted suit, fashion",
            "order": 4
          }
        ],
        "object_title": "man",
        "coordinates": "0,749,64,982"
      },
      {
        "sub_predictions": [
          {
            "class_title": "cartoon, sterling archer",
            "order": 1
          },
          {
            "class_title": "tom ford style",
            "order": 2
          },
          {
            "class_title": "sterling archer",
            "order": 3
          },
          {
            "class_title": "double breasted suit",
            "order": 4
          },
          {
            "class_title": "brown tie",
            "order": 5
          },
          {
            "class_title": "double-breasted suit, fashion",
            "order": 6
          },
          {
            "class_title": "icon",
            "order": 7
          },
          {
            "class_title": "man's clothing",
            "order": 8
          }
        ],
        "object_title": "suit",
        "coordinates": "25,712,305,995"
      },
      {
        "sub_predictions": [
          {
            "class_title": "male",
            "order": 1
          },
          {
            "class_title": "young man",
            "order": 2
          },
          {
            "class_title": "actor, doer",
            "order": 3
          }
        ],
        "object_title": "face",
        "coordinates": "225,504,75,464"
      },
      {
        "sub_predictions": [
          {
            "class_title": "striped tie",
            "order": 1
          },
          {
            "class_title": "windsor tie",
            "order": 2
          },
          {
            "class_title": "four-in-hand tie",
            "order": 3
          },
          {
            "class_title": "cravat",
            "order": 4
          }
        ],
        "object_title": "tie",
        "coordinates": "320,436,523,875"
      }
    ],
    "summary": [
      {
        "count": "1",
        "object_title": "tie"
      },
      {
        "count": "1",
        "object_title": "face"
      },
      {
        "count": "1",
        "object_title": "suit"
      },
      {
        "count": "1",
        "object_title": "man"
      }
    ]
  },
  "faces": {
    "face_count": 1,
    "predictions": [
      {
        "face_name": "Cristiano Ronaldo",
        "coordinates": "248,506,192,450"
      }
    ]
  },
  "predicttype": "dense",
  "fileid": "c2f02758f0dd4b8ab703e26f4d70d7c7"
}                                    

The response fields are:

  • url: URL of the image file posted
  • status: Status of the API request. When successful the status is “ok”. For error messages see last section.
  • predict_type: Prediction type, “basic” or “dense”.
  • predictions: Predictions made on the image. Predictions are provided as a list and have class_title and order fields.class_title is the name of the class predicted, and order is the order of relevancy of the particular class.
  • sub_predictions: Predictions made under dense classification. The image or frame is segmented into parts and classified based on the segments.
  • text_value: Text predictions.
  • face_name: Facial recognition name predictions.
  • face_count: Sum of faces.
  • coordinates: Coordinates of the object based on pixels. The format for the coordinates is X1, X2, Y1, Y2.
  • count: The number of times an object or concept appears in an image or a frame.
  • fileid: Unique File ID created for the image. The File ID is to identify the image for future references.
    In this example it is ec7995bb557d4416ab97b819917fc18c

Video Recognition API

The video recognition API is a REST API indexing videos every second. The API consists of 2 parts: 1) send video and 2) search. The indexing begins by sending the video. After sending the video, the indexed data can be viewed through the search API.

SAMPLE INPUT (VIDEO)

API input fields are:

  • url: URL of the video file. In this example it is https://s3.amazonaws.com/choochfilestest/51.mp4
  • apikey: API key provided by Chooch. In this example it is 346g5717-1sd3-35h6-9104-b8h5c819dn19

SAMPLE OUTPUT (VIDEO)

The sample JSON response is:

{
    url: "https://s3.amazonaws.com/choochfilestest/51.mp4",
    status: "Success (Video is being indexed)",
    predicttype: "video",
    fileid: "55de9d9ce1e2469da3a420a7b4de9397"
}

The response fields are:

  • url: URL of the video file.
  • status: Status of the API request. When successful the status is “Success (Video is being indexed)”. For errors see last section.
  • predicttype: Predict type is video for videos.
  • fileid: Unique File ID created for the video. The File ID is to identify the indexed video for future reference and searches within the video. In this example it is 55de9d9ce1e2469da3a420a7b4de9397

VIEWING INDEXED VIDEO

After the video is indexed, the indexed data can be viewed through the search API by using the File ID of the video. The following is a sample API request URL for viewing indexed data.

API input fields are:

  • apikey: : API key provided by Chooch. In this example it is 346g5717-1sd3-35h6-9104-b8h5c819dn19
  • fileid: Unique File ID created for the video. The File ID is to identify the indexed video for future reference and searches within the video. In this example it is 55de9d9ce1e2469da3a420a7b4de9397

The sample JSON response is:

{
    status: "ok",
    url: "https://s3.amazonaws.com/choochfilestest/51.mp4",
    indexstatus: "Success (Video Has Been Indexed)",
    seconds: [{
        texts: {
            status: "limited to 15 results",
            predictions: [
                {
                    text_value: "sports",
                    coordinates: "556,773,379,422"
                },
                {
                    text_value: "scenter",
                    coordinates: "751,1041,376,432"
                },
                {
                    text_value: "allaccess",
                    coordinates: "631,973,458,507"
                },
                {
                    text_value: "ronald",
                    coordinates: "592,994,519,616"
                },
                {
                    text_value: "in",
                    coordinates: "682,735,614,650"
                },
                {
                    text_value: "china",
                    coordinates: "748,922,616,660"
                }
            ],
            summary: [
                {
                    count: "1",
                    text_value: "allaccess"
                },
                {
                    count: "1",
                    text_value: "sports"
                },
                {
                    count: "1",
                    text_value: "ronald"
                },
                {
                    count: "1",
                    text_value: "china"
                },
                {
                    count: "1",
                    text_value: "in"
                },
                {
                    count: "1",
                    text_value: "scenter"
                }
            ]
        },
        second: 1,
        objects: {
            predictions: [
                {
                    sub_predictions: [ ],
                    object_title: "illustration",
                    coordinates: "211,1138,142,712"
                },
                {
                    sub_predictions: [
                    {
                        class_title: "victory",
                        order: 1
                    },
                    {
                        class_title: "joy",
                        order: 2
                    }
                    ],
                    object_title: "man",
                    coordinates: "190,580,319,712"
                },
                {
                    sub_predictions: [ ],
                    object_title: "face",
                    coordinates: "279,511,325,658"
                },
                {
                    sub_predictions: [ ],
                    object_title: "person",
                    coordinates: "978,1089,571,716"
                },
                {
                    sub_predictions: [ ],
                    object_title: "clothing",
                    coordinates: "971,1097,602,712"
                },
                {
                    sub_predictions: [ ],
                    object_title: "illustration",
                    coordinates: "211,1138,142,712"
                },
                {
                    sub_predictions: [
                        {
                            class_title: "victory",
                            order: 1
                        },
                        {
                            class_title: "joy",
                            order: 2
                        }
                    ],
                    object_title: "man",
                    coordinates: "190,580,319,712"
                },
                {
                    sub_predictions: [ ],
                    object_title: "face",
                    coordinates: "279,511,325,658"
                },
                {
                    sub_predictions: [ ],
                    object_title: "person",
                    coordinates: "978,1089,571,716"
                },
                {
                    sub_predictions: [ ],
                    object_title: "clothing",
                    coordinates: "971,1097,602,712"
                }
            ],
            summary: [
                {
                    count: "2",
                    object_title: "person"
                },
                {
                    count: "2",
                    object_title: "face"
                },
                {
                    count: "2",
                    object_title: "clothing"
                },
                {
                    count: "2",
                    object_title: "illustration"
                },
                {
                    count: "2",
                    object_title: "man"
                }
            ]
        },
        predictions: [
            {
                class_title: "cristiano ronaldo",
                order: "1"
            },
            {
                class_title: "illustration",
                order: "2"
            },
            {
                class_title: "man",
                order: "3"
            },
            {
                class_title: "victory",
                order: "4"
            },
            {
                class_title: "joy",
                order: "5"
            },
            {
                class_title: "face",
                order: "6"
            },
            {
                class_title: "sports",
                order: "7"
            },
            {
                class_title: "scenter",
                order: "8"
            },
            {
                class_title: "allaccess",
                order: "9"
            },
            {
                class_title: "ronald",
                order: "10"
            },
            {
                class_title: "in",
                order: "11"
            },
            {
                class_title: "china",
                order: "12"
            }
        ],
        faces: {
            face_count: 1,
            predictions: [
                {
                    face_name: "Cristiano Ronaldo",
                    coordinates: "212,390,292,472"
                }
            ]
        }
    },
    {
        texts: {
            status: "limited to 15 results",
            predictions: [
            {
                text_value: "scenter",
                coordinates: "712,1023,279,339"
            },
            {
                text_value: "sorts",
                coordinates: "512,745,302,345"
            },
            {
                text_value: "allfaccess",
                coordinates: "583,937,366,417"
            },
            {
                text_value: "onald",
                coordinates: "545,970,428,530"
            },
            {
                text_value: "i",
                coordinates: "626,683,534,572"
            },
            {
                text_value: "china",
                coordinates: "690,906,529,582"
            },
            {
                text_value: "mra",
                coordinates: "1042,1084,568,584"
            },
            {
                text_value: "s",
                coordinates: "957,993,652,671"
            }
            ],
            summary: [
                {
                    count: "1",
                    text_value: "allfaccess"
                },
                {
                    count: "1",
                    text_value: "i"
                },
                {
                    count: "1",
                    text_value: "mra"
                },
                {
                    count: "1",
                    text_value: "s"
                },
                {
                    count: "1",
                    text_value: "china"
                },
                {
                    count: "1",
                    text_value: "sorts"
                },
                {
                    count: "1",
                    text_value: "onald"
                },
                {
                    count: "1",
                    text_value: "scenter"
                }
            ]
        },
        second: 2,
        objects: {
            predictions: [
                {
                    sub_predictions: [
                        {
                            class_title: "maybe olympics",
                            order: 1
                        }
                    ],
                    object_title: "man",
                    coordinates: "78,547,267,712"
                },
                {
                    sub_predictions: [
                        {
                            class_title: "psycho joker",
                            order: 1
                        }
                    ],
                    object_title: "face",
                    coordinates: "241,455,271,582"
                },
                {
                    sub_predictions: [
                        {
                            class_title: "forward",
                            order: 1
                        },
                        {
                            class_title: "back",
                            order: 2
                        }
                    ],
                    object_title: "man",
                    coordinates: "965,1150,467,712"
                },
                {
                    sub_predictions: [ ],
                    object_title: "person",
                    coordinates: "981,1145,459,707"
                },
                {
                    sub_predictions: [ ],
                    object_title: "clothing",
                    coordinates: "987,1150,503,697"
                },
                {
                    sub_predictions: [
                        {
                            class_title: "maybe olympics",
                            order: 1
                        }
                    ],
                    object_title: "man",
                    coordinates: "78,547,267,712"
                },
                {
                    sub_predictions: [
                        {
                            class_title: "psycho joker",
                            order: 1
                        }
                    ],
                    object_title: "face",
                    coordinates: "241,455,271,582"
                },
                {
                    sub_predictions: [
                        {
                            class_title: "forward",
                            order: 1
                        },
                        {
                            class_title: "back",
                            order: 2
                        }
                        ],
                    object_title: "man",
                    coordinates: "965,1150,467,712"
                },
                {
                    sub_predictions: [ ],
                    object_title: "person",
                    coordinates: "981,1145,459,707"
                },
                {
                    sub_predictions: [ ],
                    object_title: "clothing",
                    coordinates: "987,1150,503,697"
                }
            ],
            summary: [
                {
                    count: "4",
                    object_title: "man"
                },
                {
                    count: "2",
                    object_title: "person"
                },
                {
                    count: "2",
                    object_title: "face"
                },
                {
                    count: "2",
                    object_title: "clothing"
                }
            ]
        },
        predictions: [
            {
                class_title: "cristiano ronaldo",
                order: "1"
            },
            {
                class_title: "man - 1",
                order: "2"
            },
            {
                class_title: "maybe olympics",
                order: "3"
            },
            {
                class_title: "face",
                order: "4"
            },
            {
                class_title: "psycho joker",
                order: "5"
            },
            {
                class_title: "man - 2",
                order: "6"
            },
            {
                class_title: "forward",
                order: "7"
            },
            {
                class_title: "back",
                order: "8"
            },
            {
                class_title: "scenter",
                order: "9"
            },
            {
                class_title: "sorts",
                order: "10"
            },
            {
                class_title: "allfaccess",
                order: "11"
            },
            {
                class_title: "onald",
                order: "12"
            },
            {
                class_title: "i",
                order: "13"
            },
            {
                class_title: "china",
                order: "14"
            },
            {
                class_title: "mra",
                order: "15"
            },
            {
                class_title: "s",
                order: "16"
            }
        ],
        faces: {
            face_count: 1,
            predictions: [
                {
                    face_name: "Cristiano Ronaldo",
                    coordinates: "192,342,260,408"
                }
            ]
        }
    },
    ],
    index_status: "Success (Video Has Been Indexed)",
    fileid: "55de9d9ce1e2469da3a420a7b4de9397"
}

The response fields are:

  • url: URL of the video file.
  • status: Status of the API request. When successful the status is “Success (Video is being indexed)”. For errors see last section.
  • predicttype: Predict type is video for videos.
  • sub_predictions: Predictions made under dense classification. The image or frame is segmented into parts and classified based on the segments.
  • face_count: Sum of faces
  • coordinates: Coordinates of the object based on pixels. The format for the coordinates are X1, X2, Y1, Y2.
  • count: The number of times an object or concept appears in an image or a frame.
  • fileid: Unique File ID created for the video. The File ID is to identify the indexed video for future reference and searches within the video. In this example it is 55de9d9ce1e2469da3a420a7b4de9397
  • indexstatus: Status of video index. When complete the status is "Success (Video Has Been Indexed)". For errors see next section.
  • seconds: Each second in the video is indexed. Each item is a second in the video and there are predictions for every second, similar to the image prediction API. Each item has a second and predictions field. Predictions for every second are listed in the predictions field with the class_title and order fields.

    GENERAL STATUS MESSAGES

  • ok
  • Error (Wrong Parameters)
  • Error (Invalid API Key)
  • Error (You Have Reached Your Trial API Call Limit)
  • Error (No File)

    VIDEO INDEX STATUS MESSAGES

  • Waiting to Be Processed
  • In Process Error Occurred (Not Valid Video File)
  • Error Occurred (Reached Your API Call Limit)
  • Success (Video Has Been Indexed)

FTP DROP FUNCTION

The FTP drop function was developed on top of the Chooch API for image and video professionals who want to tag their images and videos autonomously. For every client a personal FTP host is issued together with the API.

  • FTP Host: ftp://52.207.237.100
  • API Key: 6werc42-1675-6553-8105

The FTP drop sends the image to the API. The API predicts the image and places the results in the keywords field of the IPTC metadata file. Once the metadata has been successfully placed into the keywords fields of the IPTC file, it is sent to the destination directed by the user.