SqueezeBrains SDK 1.18
|
Project management interface. More...
Data Structures | |
struct | sb_t_project_info |
Project info structure. More... | |
struct | sb_t_projects_info |
Array of the projects info. More... | |
struct | sb_t_scale_offset_par |
Offsets to change scale ranges. More... | |
struct | sb_t_par_model_lut |
Information about mapping between old and new models and levels in the sb_t_par structure. More... | |
struct | sb_t_par_changes_info |
Information on what sb_project_set_par and sb_image_info_apply_par_changes do when they apply the new parameters. More... | |
struct | sb_t_elaborated_image |
Elaborated image. More... | |
struct | sb_t_elaborated_images |
List of elaborated images. More... | |
struct | sb_t_project_detection_info |
Detection information structure. More... | |
Enumerations | |
enum | sb_t_project_type { SB_PROJECT_TYPE_RETINA = 0 , SB_PROJECT_TYPE_SURFACE , SB_PROJECT_TYPE_DEEP_SURFACE , SB_PROJECT_TYPE_DEEP_CORTEX , SB_PROJECT_TYPE_DEEP_RETINA } |
Project types enum. More... | |
enum | sb_t_project_mode { SB_PROJECT_MODE_DETECTION_ONLY = 0 , SB_PROJECT_MODE_DETECTION_AND_SVL , SB_PROJECT_MODE_NO_DETECTION } |
Defines the loading or saving mode of a project. More... | |
enum | sb_t_project_training_status { SB_PROJECT_TRAINED_NONE = 0 , SB_PROJECT_TRAINED , SB_PROJECT_TRAINED_OPENVINO } |
Defines project training status. More... | |
Functions | |
const char * | sb_project_type_format (sb_t_project_type type) |
Returns the string of the project type. More... | |
sb_t_err | sb_project_get_info (SB_HANDLE handle, sb_t_project_info *project_info) |
Gets the project information from the handle. More... | |
sb_t_err | sb_project_destroy (SB_HANDLE *phandle) |
Frees all the resources of the project handle. More... | |
sb_t_err | sb_project_create (SB_HANDLE *phandle, const char *const project_name, sb_t_project_type project_type) |
Creates a new project of the specifed type. More... | |
sb_t_err | sb_project_load (SB_HANDLE *phandle, const char *const solution_file, const char *const project_uuid, sb_t_project_mode mode) |
Loads an existing project from a solution file. More... | |
sb_t_err | sb_project_save (SB_HANDLE handle, const char *const solution_file, sb_t_project_mode mode) |
Saves the project to file. More... | |
sb_t_err | sb_project_clone (SB_HANDLE src, SB_HANDLE *pdst, sb_t_project_mode mode, int regenerate_uuid) |
Clones the SqueezeBrains project. More... | |
sb_t_err | sb_project_invalidate (SB_HANDLE handle, const char *const model_name, float scale) |
Eliminates the training of the models. More... | |
const char * | sb_project_training_status_format (sb_t_project_training_status training_status) |
Returns the string of the training status. More... | |
sb_t_err | sb_project_check_trained (SB_HANDLE handle, const char *const model_name, float scale, sb_t_project_training_status *const training_status) |
Checks if the project is trained. More... | |
sb_t_err | sb_project_get_default_features (SB_HANDLE handle, char *str, int size) |
Get the project default features depending on the project type (Retina or Surface) | |
sb_t_err | sb_project_set_sensitivity (SB_HANDLE handle, const char *const model_name, float scale, float sensitivity) |
Sets the sensitivity of the detection in the project handle. More... | |
sb_t_err | sb_project_get_sensitivity (SB_HANDLE handle, const char *const model_name, float scale, float *const sensitivity) |
Gets the classification threshold from the project handle. More... | |
sb_t_err | sb_project_get_notes (SB_HANDLE handle, char **const note) |
Gets the note from the project handle. More... | |
sb_t_err | sb_project_set_notes (SB_HANDLE handle, const char *const note) |
Sets the note into the project handle. More... | |
sb_t_err | sb_project_get_name (SB_HANDLE handle, char **const name) |
Gets the name from the project handle. More... | |
sb_t_err | sb_project_set_name (SB_HANDLE handle, const char *const name) |
Sets the name into the project handle. More... | |
sb_t_err | sb_project_get_custom_par_root (SB_HANDLE handle, SB_HANDLE *node_root) |
Returns the xml root node of your own custom parameters. More... | |
sb_t_err | sb_project_get_svl_version (SB_HANDLE handle, sb_t_version *const version, char *const version_str, int size_version_str) |
Returns the version of the SB library when the last SVL was made. More... | |
sb_t_err | sb_project_detection (SB_HANDLE handle, const sb_t_image *const img, const sb_t_roi *const roi, const sb_t_roi *const roi_defects, const sb_t_samples *const samples) |
Detection function. More... | |
sb_t_err | sb_project_copy_labeling (const char *const path_solution_dst, const char *const path_solution_src, int copy_roi, int copy_labeling, int verbosity) |
Copies the analysis roi and the labeling between two current projects of two different solutions. More... | |
sb_t_err | sb_project_set_scale_offset_par (SB_HANDLE handle, sb_t_scale_offset_par scale_offset) |
Sets in the project handle the scale offset used at detection time. More... | |
sb_t_err | sb_project_get_scale_offset_par (SB_HANDLE handle, sb_t_scale_offset_par *const scale_offset) |
Gets the scale offset from the project handle. More... | |
sb_t_err | sb_project_openvino_conversion (SB_HANDLE handle, const char *const converter_path) |
Starting from the pytorch weights, it generates the openvino weights. More... | |
sb_t_err | sb_project_get_par_changes_info (SB_HANDLE handle, const sb_t_par *const par, sb_t_par_changes_info **const par_changes_info) |
Returns the information on what sb_project_set_par and sb_image_info_apply_par_changes do when they apply the new parameters. More... | |
sb_t_err | sb_project_destroy_par_changes_info (sb_t_par_changes_info **const par_changes_info) |
Destroys the structure. More... | |
sb_t_err | sb_project_change_type (const char *const solution_file, const char *const project_uuid, sb_t_project_type project_type) |
Change the project type. More... | |
sb_t_err | sb_project_get_par (SB_HANDLE handle, sb_t_par **const par) |
Retrieves the project parameters structure. More... | |
sb_t_err | sb_project_set_par (SB_HANDLE handle, const sb_t_par *const par) |
Sets the parameters structure into the project handle. More... | |
sb_t_err | sb_project_get_res (SB_HANDLE handle, sb_t_res **const res, int details) |
Retrieves the results of the last elaborated image. More... | |
sb_t_err | sb_project_reset_stat (SB_HANDLE handle) |
Resets the internal statistics of the elaborations. More... | |
sb_t_err | sb_project_get_stat (SB_HANDLE handle, sb_t_stat **const stat) |
Gets the statistics from the handle. More... | |
sb_t_err | sb_project_detection_destroy_info (sb_t_project_detection_info **const di) |
Destroy the detection info structure. More... | |
sb_t_err | sb_project_detection_get_info (SB_HANDLE handle, const sb_t_image *const src, const sb_t_roi *const roi, sb_t_project_detection_info **const di) |
Returns detection information. More... | |
Project management interface.
See Solution and projects management for more information.
enum sb_t_project_mode |
Defines the loading or saving mode of a project.
The values are 32 bits both for 32 and 64 bits library version.
Enumerator | |
---|---|
SB_PROJECT_MODE_DETECTION_ONLY | Load/save the minimum module information to allow detection. |
SB_PROJECT_MODE_DETECTION_AND_SVL | Load/save all the module information. |
SB_PROJECT_MODE_NO_DETECTION | Load/save the minimum module information and is not possible to do detection. |
Defines project training status.
Enumerator | |
---|---|
SB_PROJECT_TRAINED_NONE | Project is not trained. |
SB_PROJECT_TRAINED | Project is trained. |
SB_PROJECT_TRAINED_OPENVINO | Project is trained and Intel OpenVino support is available. Only for Deep Cortex and Deep Surface projects. |
enum sb_t_project_type |
Project types enum.
The values are 32 bits both for 32 and 64 bits library version.
sb_t_err sb_project_change_type | ( | const char *const | solution_file, |
const char *const | project_uuid, | ||
sb_t_project_type | project_type | ||
) |
Change the project type.
The function changes the project type in the solution file.
It also updates the project type in all rtn files associated with images in sb_t_svl_par::project_path.
The function returns SB_ERR_DIR_NOT_EXIST if sb_t_svl_par::project_path is not an existing folder, and SB_ERR_STRING_EMPTY if it is an empty string.
When the project type is changed the training and all the analysis results will be lost, moreover some data is initialized, others are kept.
Regarding the parameters of the project the models number, their name and sb_t_par. collaborations "collaboration matrix" are always kept.
While, for image data, ROI analysis and labeling can be retained or lost.
The following table shows what happens when you change the project type.
Source project type | Destination project type | ROI analysis | Samples | ROI defects | Model size | Network |
---|---|---|---|---|---|---|
Retina | Surface | full image | / | empty | / | / |
Deep Surface | full image | / | empty | / | initialized if necessary | |
Deep Cortex | / | / | / | / | initialized if necessary | |
Surface | Retina | full image | none | / | initialized | / |
Deep Surface | kept | / | kept | / | initialized if necessary | |
Deep Cortex | / | / | / | / | initialized if necessary | |
Deep Surface | Retina | full image | none | / | initialized if necessary | / |
Surface | kept | / | kept | / | / | |
Deep Cortex | / | / | / | / | initialized | |
Deep Cortex | Retina | full image | none | / | initialized if necessary | / |
Surface | full image | / | empty | / | / | |
Deep Surface | full image | / | empty | / | initialized |
[in] | solution_file | Solution file name. |
[in] | project_uuid | UUID of the project. |
[in] | project_type | New project type. |
sb_t_err sb_project_check_trained | ( | SB_HANDLE | handle, |
const char *const | model_name, | ||
float | scale, | ||
sb_t_project_training_status *const | training_status | ||
) |
Checks if the project is trained.
Usually, to check if a project is trained and the sb_project_detection function can be called, the function is called with model_name equal to NULL and scale equal to 0.
The function works in a slightly different way depending on the project type.
In case of a Surface project the model_name and scale parameters can be configured in 4 different ways explained below.
model_name | scale | Condition | is_trained |
---|---|---|---|
NULL | 0 | ||
All models are disabled | SB_PROJECT_TRAINED | ||
All the enabled models and all their enabled scale levels are trained | SB_PROJECT_TRAINED | ||
There is an enabled model with all scale levels disabled | SB_PROJECT_TRAINED | ||
There is an enabled model with no scale levels | SB_PROJECT_TRAINED_NONE | ||
There is an enabled model with an enabled scale level that is no trained | SB_PROJECT_TRAINED_NONE | ||
The project has no models | SB_PROJECT_TRAINED_NONE | ||
!=NULL | >=1.0 | ||
The model is disabled | SB_PROJECT_TRAINED | ||
The model is enabled and the scale is disabled | SB_PROJECT_TRAINED | ||
the specified combination model_name - scale has been trained | SB_PROJECT_TRAINED | ||
the specified combination model_name - scale has not been trained | SB_PROJECT_TRAINED_NONE | ||
NULL | >=1.0 | ||
All the enabled models that have the specified scale level are trained | SB_PROJECT_TRAINED | ||
There is an enabled model with the specified scale level that is not trained | SB_PROJECT_TRAINED_NONE | ||
!=NULL | 0 | ||
The model is disabled | SB_PROJECT_TRAINED | ||
The model is enabled and all the enabled scale levels are trained | SB_PROJECT_TRAINED | ||
The model is enabled and all the scale levels are disabled | SB_PROJECT_TRAINED | ||
The model is enabled and it has no scale levels | SB_PROJECT_TRAINED_NONE | ||
The model is enabled and there is an enabled scale level that is no trained | SB_PROJECT_TRAINED_NONE |
In case of Retina, Deep Cortex or Deep Surface project type the parameter scale is not used, so the table can be simplified as the one below:
model_name | Condition | is_trained |
---|---|---|
NULL | ||
All models are disabled | SB_PROJECT_TRAINED or SB_PROJECT_TRAINED_OPENVINO | |
All the enabled models are trained | SB_PROJECT_TRAINED or SB_PROJECT_TRAINED_OPENVINO | |
The project has no models | SB_PROJECT_TRAINED_NONE | |
!=NULL | ||
The model is disabled | SB_PROJECT_TRAINED or SB_PROJECT_TRAINED_OPENVINO | |
The model is enabled and it is trained | SB_PROJECT_TRAINED or SB_PROJECT_TRAINED_OPENVINO | |
The model is enabled but it isn't trained | SB_PROJECT_TRAINED_NONE |
[in] | handle | Project Handle. |
[in] | model_name | Name of the model to be checked. If the model_name is not found the function returns the error SB_ERR_MODEL_NOT_FOUND. |
[in] | scale | Level scale to check. Used only by Surface projects. The permitted values are 0 and between SB_PAR_LEVEL_SCALE_MIN and SB_PAR_LEVEL_SCALE_MAX with steps of SB_PAR_LEVEL_SCALE_GRANULARITY, i.e. 1, 1.5, 2, 2.5 etc. If scale has no allowed value, the function returns the error SB_ERR_WRONG_PARAMETER. If the scale has an allowed value but it is not found the function returns the error SB_ERR_SCALE_NOT_FOUND. |
[out] | training_status | Variable set according to the tables above. |
sb_t_err sb_project_clone | ( | SB_HANDLE | src, |
SB_HANDLE * | pdst, | ||
sb_t_project_mode | mode, | ||
int | regenerate_uuid | ||
) |
Clones the SqueezeBrains project.
The function returns the SB_ERR_PROJECT_LOAD_MODE error if the load mode of the source project is lower than the new load mode.
[in] | src | The source project handle. |
[out] | pdst | The pointer to the new project handle. |
[in] | mode | Loading method of the module of a project.
|
[in] | regenerate_uuid | If true it generates a new project uuid for the new project |
sb_t_err sb_project_copy_labeling | ( | const char *const | path_solution_dst, |
const char *const | path_solution_src, | ||
int | copy_roi, | ||
int | copy_labeling, | ||
int | verbosity | ||
) |
Copies the analysis roi and the labeling between two current projects of two different solutions.
For each image of the destination project it searches the source project for the image with the same name and if the .rtn file exists, it copies the required data.
The source and destination image must have the same resolution.
path_solution_dst | Folder of the destination solution, the current project is used |
path_solution_src | Folder of the source solution, the current project is used |
copy_roi | Set to 1 if you need to copy ROI analysis. |
copy_labeling | Set to 1 if you need to copy labeling (i.e. samples or ROI defects). |
verbosity | Message verbosity, 0 disable all trace |
sb_t_err sb_project_create | ( | SB_HANDLE * | phandle, |
const char *const | project_name, | ||
sb_t_project_type | project_type | ||
) |
Creates a new project of the specifed type.
[out] | phandle | Pointer to the project handle |
[in] | project_name | Name of the project. |
[in] | project_type | Project type. |
Frees all the resources of the project handle.
[in,out] | phandle | Pointer to the project handle |
sb_t_err sb_project_destroy_par_changes_info | ( | sb_t_par_changes_info **const | par_changes_info | ) |
Destroys the structure.
[in,out] | par_changes_info | Pointer to the structure. The function sets it to NULL. |
sb_t_err sb_project_detection | ( | SB_HANDLE | handle, |
const sb_t_image *const | img, | ||
const sb_t_roi *const | roi, | ||
const sb_t_roi *const | roi_defects, | ||
const sb_t_samples *const | samples | ||
) |
Detection function.
The function elaborates the image inside the ROI.
You should use the function sb_project_get_res to get the results.
Remember to call sb_roi_evaluate_bounding_box if the ROI is changed.
In case of Surface and Deep Surface projects the function also executes a blob analysis on the voting plane in order to cluster the defects areas. The function does the blob analysis if the parameter roi_defects is valorized or if the sb_t_par.surface_blob_analysis is set.
If you want to reset the statistic you should call the function sb_project_reset_stat before to call sb_project_detection .
[in] | handle | Project handle. |
[in] | img | Pointer to the image. It is analyzed inside the ROI. |
[in] | roi | Pointer of the ROI. |
[in] | roi_defects | Pointer to the defects ROI. Is it used only with Surface and Deep Surface projects. The parameter can be NULL. In the case roi_defects is valorized, the function executes the blob analysis on the voting plane and does the following operation:
|
[in] | samples | Pointer to the samples of the image that is the ground truth or labeling. It is used only with Retina and Deep Cortex projects. The parameter can be NULL. If samples if valorized, the function works in test mode and can perform the following operation:
|
sb_t_err sb_project_detection_destroy_info | ( | sb_t_project_detection_info **const | di | ) |
Destroy the detection info structure.
[in,out] | di | Pointer to the detection info |
sb_t_err sb_project_detection_get_info | ( | SB_HANDLE | handle, |
const sb_t_image *const | src, | ||
const sb_t_roi *const | roi, | ||
sb_t_project_detection_info **const | di | ||
) |
Returns detection information.
The function analyzes the image and returns some information that can be useful to understand which images have actually been processed.
The function has been implemented only for Deep Surface projects.
handle | Project handle | |
[in] | src | Pointer to the image. |
[in] | roi | Pointer of the ROI. |
[out] | di | Pointer to the detection information. The structure must be destroied with the function sb_project_detection_destroy_info . Nella struttura c'è la lista dei singoli tile elaborati |
Returns the xml root node of your own custom parameters.
[in] | handle | Project handle. |
[out] | node_root | The variable is filled with the xml root node of your own custom parameters. The handle returned by the function must not be destroyed. |
sb_t_err sb_project_get_info | ( | SB_HANDLE | handle, |
sb_t_project_info * | project_info | ||
) |
Gets the project information from the handle.
[in] | handle | The project handle |
[out] | project_info | Pointer to the project information structure |
Gets the name from the project handle.
[in] | handle | Project handle. |
[out] | name | Pointer to the name. On successful return, this parameter will be filled with the pointer to the name. The pointer should be freed with sb_free. |
Gets the note from the project handle.
[in] | handle | Project handle. |
[out] | note | Pointer to the note. On successful return, this parameter will be filled with the pointer to the note. The pointer should be freed with sb_free. |
Retrieves the project parameters structure.
[in] | handle | Project handle. |
[out] | par | Pointer to the parameters structure. On successful return, this parameter will be filled with the pointer to sb_t_par structure. The structure should be freed using the function sb_par_destroy. |
sb_t_err sb_project_get_par_changes_info | ( | SB_HANDLE | handle, |
const sb_t_par *const | par, | ||
sb_t_par_changes_info **const | par_changes_info | ||
) |
Returns the information on what sb_project_set_par and sb_image_info_apply_par_changes do when they apply the new parameters.
[in] | handle | Project handle. |
[in] | par | Pointer to the new project parameters structure. |
[out] | par_changes_info | Pointer to the structure of information on parameter changes. The structure must be deallocated with sb_project_destroy_par_changes_info . |
Retrieves the results of the last elaborated image.
For more information see sb_t_res .
The field par in the structure sb_t_res is valued with the parameters saved when the sb_project_detection function was last called.
[in] | handle | Module handle. |
[out] | res | Pointer to the results structure. On successful return, this parameter will be filled with the pointer to sb_t_res structure. The structure should be freed using the function sb_res_destroy. |
[in] | details | If 1 the function also exports some additional details. For Retina project the details are the weight images of each sample, that is the sb_t_sample::weights_image image. For Surface or Deep Surface project the details are the fields sb_t_res_model::surface in the models array sb_t_res::models. For Deep Cortex project the details are currently not available. |
sb_t_err sb_project_get_scale_offset_par | ( | SB_HANDLE | handle, |
sb_t_scale_offset_par *const | scale_offset | ||
) |
Gets the scale offset from the project handle.
It works only for Deep Surface projects.
[in] | handle | The project handle |
[out] | scale_offset | The variable is filled with the scale offset. |
sb_t_err sb_project_get_sensitivity | ( | SB_HANDLE | handle, |
const char *const | model_name, | ||
float | scale, | ||
float *const | sensitivity | ||
) |
Gets the classification threshold from the project handle.
[in] | handle | The project handle |
[in] | model_name | Model name. |
[in] | scale | Scale value. Used only by Surface projects. |
[out] | sensitivity | The variable is filled with the classification sensitivity. |
Gets the statistics from the handle.
[in] | handle | Module handle. |
[out] | stat | Pointer to the statistics structure. On successful return, this parameter will be filled with the pointer to a sb_t_stat structure. The structure should be freed using the function sb_stat_destroy. The field par in the structure sb_t_stat is valorized with the parameters saved when the sb_project_detection function was last called. |
sb_t_err sb_project_get_svl_version | ( | SB_HANDLE | handle, |
sb_t_version *const | version, | ||
char *const | version_str, | ||
int | size_version_str | ||
) |
Returns the version of the SB library when the last SVL was made.
[in] | handle | Project handle. |
[out] | version | Pointer of the version structure. |
[out] | version_str | Pointer to the string, is filled with the SVL version for example "1.8.0.0". This parameter can be left to NULL if not necessary. |
[in] | size_version_str | Size of the version_str string. |
Eliminates the training of the models.
After calling this function it is necessary to do an SVL before to call again the functions sb_project_detection.
[in] | handle | Project Handle. |
[in] | model_name | Name of the model to be invalidated. If NULL all models will be invalidated. |
[in] | scale | Level / Scale to be invalidated. If 0 all levels will be invalidated. Used only by Surface projects. |
sb_t_err sb_project_load | ( | SB_HANDLE * | phandle, |
const char *const | solution_file, | ||
const char *const | project_uuid, | ||
sb_t_project_mode | mode | ||
) |
Loads an existing project from a solution file.
The project resides in a solution together with other projects for which it is necessary to specify the UUID of the project that uniquely identifies it.
[out] | phandle | Pointer to the project handle |
[in] | solution_file | Full name of the solution file in which the project exists |
[in] | project_uuid | uuid of the project. To get the project uuid use the function sb_solution_get_info . |
[in] | mode | Loading mode of a project from a solution.
|
Starting from the pytorch weights, it generates the openvino weights.
The name of the weights conversion programm is pytorch_to_onnx_converter.exe on Windows and pytorch_to_onnx_converter on Linux.
You can found it in the folder "C:Program Files\SqueezeBrains\1.16\win_x64\dl_framework" for Windows or "/opt/SqueezeBrains/1.16/linux_x64/dl_framework" for Linux.
If you need to run the detection using Intel OpenVino technology on SB_DEVICE_CPU , SB_DEVICE_IGPU_INTEL or SB_DEVICE_DGPU_INTEL device, you have to call this function after sb_svl_run in order to generate the openvino weights.
[in] | handle | The project handle. |
[in] | converter_path | Name of the weights conversion programm with path. It can be null, in this case the executable must be in the current directory or in the PATH environment variable the path in which the conversion program resides must have been added. |
Resets the internal statistics of the elaborations.
[in] | handle | Module handle. |
sb_t_err sb_project_save | ( | SB_HANDLE | handle, |
const char *const | solution_file, | ||
sb_t_project_mode | mode | ||
) |
Saves the project to file.
The project is saved in a solution along with other projects.
[in] | handle | The project handle |
[in] | solution_file | Filename of the solution where to save the project. If NULL the function uses the parameter solution_file of the function sb_project_load used to create the project. |
[in] | mode | Saving mode of a project into a solution.
|
Sets the name into the project handle.
[in,out] | handle | Project handle. |
[in] | name | Name to be written. The string must be compliant to UTF-8 format. |
Sets the note into the project handle.
[in,out] | handle | Project handle. |
[in] | note | Note to be written. The string must be compliant to UTF-8 format. |
Sets the parameters structure into the project handle.
The function can invalidate the training if some critical parameter is changed.
In the following the list for each project type:
You can call the function sb_project_get_par_changes_info to know which models will be invalidated in a subsequent call of the function sb_project_set_par.
The following table describe all the possible situations in which a model (Retina and Surface) or a level (Surface) or the SVL (Deep Cortex and Deep Surface) will be invalidated or not.
Project type | Changes in parameters sb_t_par | Model is invalidated | Level is invalidated | SVL invalidated |
---|---|---|---|---|
Retina | The size of the model is changed | yes | ||
One of the models it collaborates with is invalidated due to changes in size | yes | |||
One of the models it collaborates with is deleted | yes | |||
The model's collaborations have been changed | yes | |||
The model is deleted | yes | |||
The order in the model array has been changed | no | |||
One of the models it collaborates with is disabled | no | |||
The model is disabled | no | |||
The parameter sb_t_svl_par::image_circularity_type is changed | yes | |||
Surface | One of the models it collaborates with is deleted | yes | ||
The model's collaborations have been changed | yes | |||
The model is deleted | yes | |||
The order in the model array has been changed | no | |||
One of the models it collaborates with is disabled | no | |||
The model is disabled | no | |||
The automatic choice of levels is enabled | yes | |||
The level is deleted | yes | |||
The level is disabled | no | |||
The parameter sb_t_par_sl::detection_out_of_roi is changed | yes | |||
The parameter sb_t_svl_par::image_circularity_type is changed | yes | |||
Deep Cortex | The network is changed | yes | ||
The order in the model array has been changed | yes | |||
A model is added | yes | |||
A model is deleted | yes | |||
The pre-training file is set or removed | yes | |||
The model's collaborations have been changed | yes | |||
sb_t_svl_dl_par_network::features_multiplier is changed | yes | |||
A model is disabled | no | |||
Deep Surface | The network is changed | yes | ||
The pre-training file is set or removed | yes | |||
The scale is changed | yes (if tiling mode is equal to SB_TILING_MODE_AUTO ) | |||
The tiling mode is changed | yes | |||
The number of tiles is changed | yes (if tiling mode is equal to SB_TILING_MODE_MANUAL ) | |||
The order in the model array has been changed | yes | |||
A model is added | yes | |||
A model is deleted | yes | |||
The model's collaborations have been changed | yes | |||
The parameter sb_t_svl_par::image_circularity_type is changed | yes | |||
sb_t_svl_dl_par_network::features_multiplier is changed | yes | |||
A model is disabled | no |
[in,out] | handle | Project handle. |
[in] | par | Pointer to the parameters structure. |
sb_t_err sb_project_set_scale_offset_par | ( | SB_HANDLE | handle, |
sb_t_scale_offset_par | scale_offset | ||
) |
Sets in the project handle the scale offset used at detection time.
The scale offset give the possibility to the user to vary the scale range used by sb_project_detection when tiling mode is equal to to SB_TILING_MODE_AUTO. It consists in four values that are added to the sb_t_svl_dl_tiling_par::scale parameter in order to change both horizontal and vertical scale ranges used at detection time. The scale offset allows the user to change both the minimum and maximum value of the scale range. Call this function may be useful when detection is performed over images at different resolution but at the same time is necessary to maintain fixed the number of tiles effectively used by the algorithm and the elaboration times. However, the usage by detection of a scale different from that used by SVL, may affect the results. Therefore it is not recommended to set sb_t_scale_offset_par::width_max and sb_t_scale_offset_par::height_max scale values higher than 1.0 or lower than -1.0.
The sum of sb_t_svl_dl_tiling_par::scale plus the value set with the function must be greater or equal than SB_DL_SCALE_MIN and less or equal than SB_DL_SCALE_MAX. Furthermore, the value must have the granularity SB_DL_SCALE_GRANULARITY.
The function limits the value between the minimum and maximum and approximates it to the nearest granular value.
If the maximum value of the scale range plus sb_t_scale_offset_par::width_max is less than the minimum value of the scale range plus sb_t_scale_offset_par::width_min, than the function corrects the scale offset according to the following rules:
It works only for Deep Surface projects.
[in] | handle | The project handle |
[in] | scale_offset | New value of scale offset to be set |
sb_t_err sb_project_set_sensitivity | ( | SB_HANDLE | handle, |
const char *const | model_name, | ||
float | scale, | ||
float | sensitivity | ||
) |
Sets the sensitivity of the detection in the project handle.
The sensitivity affects only the results of the detection and does not affect training in any way.
[in] | handle | The project handle. |
[in] | model_name | Name of the model to be set. If NULL all models will be set. |
[in] | scale | Level / Scale value. If 0 all levels will be set. Used only by Surface projects. |
[in] | sensitivity | New value of sensitivity to be set. The range of acceptable values is between -1 and 1 excluded. If the value is greater than 1 or less than -1, it is rounded to 1 and -1 respectively. |
const char * sb_project_training_status_format | ( | sb_t_project_training_status | training_status | ) |
Returns the string of the training status.
Interprets the contents of the training_status and converts it to a C-string containing a human-readable version of the corresponding training status.
The string must not be freed.
[in] | training_status | Training status. |
const char * sb_project_type_format | ( | sb_t_project_type | type | ) |
Returns the string of the project type.
Interprets the contents of the code and converts it to a C-string containing a human-readable version of the corresponding value.
[in] | type | Project type. |