Back

Description

CarNET API provides you with the ability to detect a car’s make, model, generation, color and angle from an image of the car. Our API is powered by computer vision and deep learning technologies, and is capable of correctly recognizing cars in different lighting and weather conditions.

We are currently able to detect more than 3100 different car models. This number is growing every month as we add new cars to our database.

Whether you are working on an enterprise-level project or just thinking about building your own app, CarNET API can bring a new experience to your users.

How it works

Identifying cars is not an easy task. Even car enthusiasts are not always able to recognize exactly what they are seeing. Things get more complicated if all you have is a single, poor-quality image. The chances that you will correctly detect the car model from such an image are quite low.

To enhance user experience and to reduce the number of incorrect detections, we process car images in several steps. Certain limitations will apply on every step. Knowing those steps and limitations will give you a better understanding of how you can use our API.

Step 1. Detecting bounding boxes

Let’s say you have submitted above image to CarNET API.
First, we will try to find every car on the image and detect its bounding box. In this case we will end up with three bounding boxes. Each bounding box is then treated as a separate image.

Step 2. Filtering bounding boxes

Next step is to filter our bounding boxes which are not suitable for recognition. As for example we ignore bounding boxes in which one of the dimensions (either height or width) are less than 180px. Based on our experience, the error rate for smaller bounding boxes is too high and it just doesn’t make sense to try to identify cars for those.

There are several parameters you can use to specify which bounding boxes should be filtered out on this step. Those are: box_offset, box_min_width, box_min_height, box_min_ratio and box_max_ratio parameters.

If a bounding box is located near the edge of an image, there is a big chance that the BB contains only part of the car’s image. If this is the case, then it is unlikely that the car will be detected correctly. box_offset sets the minimum allowed distance in pixels between the edge of the image and the edge of the bounding box. Bounding boxes which are closer to the edge of the image than box_offset will be ignored. Default is 0.

box_min_ratio and box_max_ratio define the minimum and maximum ratio between bounding box width and height. Defaults are set to 1.0 and 3.15, accordingly.

box_min_height and box_min_width parameters should be self-explanatory. Default values are set to 180. Values less than 180 will be ignored.

In the example above, bounding box (1) will be excluded because its width to height ratio is 0.58, which is less than default box_min_ratio value and bounding box (3) will be excluded because both its width and height are less than 180px

Bounding box excluded because of width to height ratio is 0.58 which is less than box_min_ratio = 1
Bounding box excluded because of both width and height are less than box_min_height = 180 and box_min_width = 180

Step 3. Selecting detection strategy

After filtering out unsuitable bounding boxes we are ready to recognize cars within suitable ones. Sometimes you might actually need results only for a single bounding box, effectively ‘main’ car in the image.

box_select parameter allows you to set your selection strategy. There are three possible options:

  • all - images within all bounding boxes will be processed;
  • center - the bounding box closest to the center of the image will be processed;
  • largest - the bounding box with the largest area will be processed.

Default value is center

box_select parameter is set to ‘center’. Right car is selected because its bounding box is closer to the center of the image
box_select parameter is set to ‘largest’. Left car is selected because its bounding box size is slightly larger than that of the right car.

This parameter helps to reduce the amount of code you need to implement to handle CarNET API response, as well as the amount of time needed to process an image. It is considerably faster to select a single bounding box before running detection algorithms rather than running detection on all bounding boxes and then selecting just one.

Step 4. Detecting image subclass

‘Car image’ is not necessary refers to the car body. An image of the car’s interior is also considered to be a car. CarNET API defines 6 subclasses for car images. Subclasses, their description and sample images are listed in the table below.

In the fourth step we run subclass detection on every bounding box we selected in Step 3. Only bounding boxes with subclass of vehicle are then passed to the next and final step: Feature detection

Subclass
Description
Sample Images
Subclass

Dashboard

Description

Image of the control panel usually located directly in front of the driver, displaying instrumentation and controls for the operation of the vehicle.

Sample Images
Subclass

Interior

Description

Image of car interior.

Sample Images
Subclass

Wheel

Description

Image where most of the area is occupied by a car wheel / tyre.

Sample Images
Subclass

Body Part

Description

Image where most of the area is occupied by a single car body element like mirror, grill, headlight, badge, etc.

Sample Images
Subclass

Unidentifiable

Description

Image of the car body where due to image configuration car model can not be identified. Majority of the images in this category refer to open car trunks, excessively dirty cars, cars covered in snow, etc.

Sample Images
Subclass

Vehicle

Description

Images of a clearly visible car body.

Sample Images

Step 5. Detection of features

CarNET API supports detection of the following features:

  • Car model, which also reflects car make (mm);
  • Car generation, which also reflects car model and make (mmg);
  • Car body color (color);
  • Car angle.

You can use the features parameter to define what features you would like to extract from the image. If features parameter is omitted ‘mmg’ option will be used by default.

If, for example, you would like to extract both ‘mmg’ and ‘color’ features, you should include feature parameter in API request and list both options, joined by comma i.e. ?features=mmg,color

mm and mmg options are mutually exclusive. You should use mm option if you aim to detect car model, and mmg option if you want to get more granular results, including car generation (production years).

Sometimes the differences between two consecutive generations of the same car model are very subtle. In this case using mmg option could lead to incorrect generation detection or to the probability distribution between two generations. You should implement custom logic to handle such cases appropriately.

 

Options

Region selection

Car brands and models are distributed across the world unevenly. For example, it is hard to find Peugeot in the USA while it is the best selling brand in France.

If you know the region where the image you are trying to recognize was taken, you can include it as an additional request parameter (region). CarNET API currently supports the following regions: NA, EU, CIS, DEF

Including region parameter will lead to prioritizing most common brands in the region over those rarely encountered. While this option helps to produce stronger recognition results for the most common brands and models in the region, rare car brands and models are likely to be incorrectly recognized. You should evaluate your usage of region parameter based on your CarNET API usage scenario.

Resources