A data source for an object detector.
- macOS 10.14+
- Xcode 11.0+
- Create ML
Use an object detector data source to specify the directory that contains the training data to create an
MLObject. The given directory must contain image files and exactly one JSON file with annotations for objects within those images.
The base of the JSON file must contain an array of the following JSON object structure.
The name of the image’s file.
An array of annotation JSON objects.
Each JSON object in the
annotation array must have the following JSON object structure.
The name of the annotated object.
The location of the object and the area it occupies in the image.
coordinate JSON object must have the following structure. The origin of the image is the upper-left corner. The
x-values increase from left to right and the
y-values increase from the top to the bottom.
The width of the annotation’s bounding box.
The height of the annotation’s bounding box.
As an example, the following JSON file has correct structure with one image file (
"cat and dog) in its base array, which has two annotations.
A typical annotation JSON file has many more objects in its base array, one for each image file.