Brains
The Brain module provides access to the Brains defined in the Brains section of the project. Brains are accessed by the specific friendly name defined for each one.
After configuring a brain with name brain_1 in your project, we can access its memeber functions writing Brains.brain_1.
inference()
Gets inference results from the brain for the given image.
inference(images: Ve.Image, options?: IInferenceOptions): Promise<result>;
parallelInference()
Gets inference results from the brain for each image.
parallelInference(images: Ve.Image[], options?: IInferenceOptions): Promise<result[]>;
patchInference()
Get inference results from the brain for each patch in the image. This method will divide the given image in valid crops and perform and inference for each one. The of shape the crops is defined by the image size expected by the brain. Adding the patchOverlap, the crops will have an overlapping of pixels to avoid false positives. A patch of 50px means each crop will share 100 px with the next one, so 50px will be repeated and therefore not used in the final result. The method will return an array of boxes containing the inference results.
patchInference(images: Ve.Image, options?: IPatchInferenceOptions): Promise<result>;
Options
IInferenceOptions
Represents options for inference operations.
- enableProfiler:
boolean(optional) - Enables profiling during inference. - flexibleImageSize:
boolean(optional) - Allows flexible image size during inference. - flexibleImageFormat:
boolean(optional) - Allows flexible image format during inference.
IPatchInferenceOptions
Represents options for patch-wise inference operations.
- enableProfiler:
boolean(optional) - Enables profiling during patch inference. - contextPadding:
number(optional) - Specifies padding context for patch inference.