Sighthound Cloud offers a Recognition API that developers can use for vehicle recognition applications. Try out the following demo to see the Detection API and Recognition API in action.
# To use a hosted image uncomment the following line and update the URL
#image_data = "http://example.com/path/to/hosted/image.jpg"
# To use a local file uncomment the following line and update the path
#image_data = base64.b64encode(open("/path/to/local/image.jpg", "rb").read()).decode()
using System; using System.Collections.Generic; using System.Text; using System.Net; using System.IO; using Newtonsoft.Json; using Newtonsoft.Json.Linq;
class UrlSample
{ static voidMain(string[] args) { // Option 1 - Image is a file on local filesystem // Comment out the following 2 lines if using a URL. string imageFilePath = @"PATH TO IMAGE"; string imgBase64String = GetBase64StringForImage(imageFilePath);
// Option 2 - Image path is a URL // Uncomment the following 2 lines if using a URL. // string imageUrlPath = "https://www.example.com/path/to/image.jpg"; // string imgBase64String = GetBase64StringForImage(imageUrlPath);
Dictionary dict = new Dictionary(); dict.Add("image", imgBase64String);
string json = JsonConvert.SerializeObject(dict, Formatting.Indented); byte[] body = Encoding.UTF8.GetBytes(json);
POST https://dev.sighthoundapi.com/v1/detections? type=face,person&faceOption=landmark,gender
Content-Type: application/json
X-Access-Token: Your-API-Key
Optional URL Parameters
type
A comma-separated list of object categories to detect. Valid options are ‘all’, ‘face’, ‘person’. Default is ‘all’.
faceOption
For type 'face', additional detections can be performed by passing comma-separated list of values. Valid options are ‘gender’ and ‘landmark’. Default is face bounding box only.
Body Parameters
image
The image to analyze. This can be a URL to an image (authentication data in URL is accepted) or inline as base64 encoded data.
Result
The result is a JSON array of all detected objects and information about the processed image.
An array of all detected objects. Each includes the type of detection results returned, face or person, and a boundingBox of the object's location in the image. The x, y, width, and height values are defined in a coordinate space with (0,0) as the top left corner of the image.
image
The width, height, and orientation of the processed image. Orientation defaults to 1, else the value found in the image's Exif data and indicates that bounding boxes have been translated to match that coordinate space.