Skip to content

CLI Application

The CLI trainer application allows you to train CAD targets via a terminal application.

Train CAD

  1. Starting the trainer application with no argument, or -h, or -help displays usage instructions.

  2. To run CAD training you need to set the

    • output directory,
    • input configuration (e.g. defaultCADTargetTrainingConfig.json),
    • CAD file,
    • camera calibration

Detail Camera Calibration:

The target data files must be generated with the camera intrinsics of the target device (Device used for tracking). To get a suitable calibration file for the trainer application, please follow the instructions on Camera Calibration

Limitation: CAD Target Tracking currently only supports 640 x 480 input resolution (landscape mode).

When the target should be tracked with a different camera (different FOV / different focal length) the target data needs to be retrained accordingly!

Detail Input Configuration:

The input configuration is a JSON file containing the following content:

{
"Config.Target.Type": "CAD",
"[Config.Target.Name](http://config.target.name/)": "targetname",
"CAD.Radii": [ 0.3, 0.35, 0.4, 0.45, 0.5 ],
"CAD.UprightVector": [ 0.0, 1.0, 0.0 ],
"CAD.NumberOfViews": 2,
"CAD.ElevationAngles": [10.0, 70.0]
}

Configuration parameter explanation:

Config.Target.Type
Always use "CAD" for CAD Training.

Config.Target.Name
The name of the Target. Allowed characters: 'a-z' 'A-Z' '0-9' '_'.

CAD.Radii
Defines the viewpoint sampling radii from which the object model should be trained on. The radius is defined as the distance of the (virtual) camera to the object origin in meter. The object can only be detected within the specified distance range. The larger the step size in-between these rendering radii, the more likely it is that you need to slowly move the camera a bit closer or further away during the detection phase to find a good viewpoint. The closer the distance of the camera to the object and the larger the focal length of the camera, the more critical it is to choose a smaller step size. Note however that a larger range and more steps can lead to more false positive detections and slower runtime.

CAD.UprightVector
A vector that defines the upright axis of the object. By default, the upright axis is defined as the Y-axis of the model, and therefore [ 0.0, 1.0, 0.0 ].

CAD.NumberOfViews
Defines the number of viewpoints for each rendering radius from which the model should be trained on.

Note that this value does not scale linearly:

Input value Number of views per radius
0 12
1 42
2 162 (Standard)
3 642
4 2562

CAD.ElevationAngles
The minimum and maximum elevation angle from which the object should be detectable.
0° - Horizontal view
90° - Top down view
-90° - Bottom up view

It is recommended to use [10.0°, 70.0°]. In this case, the object cannot be detected when viewed from top-down or bottom-up. Note that a larger range can lead to more false positive detections and slower runtime.

Info

Batch training of CAD targets is not possible.

Back to top