SqueezeBrains SDK 1.18
retina_svl_simple.c File Reference

Tutorial 4 - Retina - How to create a project, set samples and execute the training (SVL). More...

#include "../common/common.h"
Include dependency graph for retina_svl_simple.c:

Go to the source code of this file.

Functions

sb_t_err create_retina_project_file (SB_HANDLE *retina)
 Create a retina project file. More...
 
sb_t_err set_samples (SB_HANDLE retina)
 Set samples. More...
 
sb_t_err execute_training (void)
 Execute training. More...
 
int main (void)
 

Detailed Description

Tutorial 4 - Retina - How to create a project, set samples and execute the training (SVL).

This tutorial shows you what you should do to train a model using a set of images and starting from scratch, i.e. without using the "SB GUI". You should follow the following steps:

  1. create a new project with the function sb_project_create
  2. add a model to the project and set its parameters with the functions sb_project_get_par and sb_project_set_par
  3. label the image, i.e. set the occurrences of the model in the dataset images
  4. execute the training with the function sb_svl_run
    See also
    sb_init
    sb_release
    sb_get_info
    sb_license_get_info
    sb_project_create
    sb_solution_get_info
    sb_solution_destroy_info
    sb_project_load
    sb_project_destroy
    sb_project_save
    sb_project_get_par
    sb_project_set_par
    sb_par_add_model
    sb_image_info_load
    sb_image_info_destroy
    sb_image_info_save
    sb_image_info_reset
    sb_get_uuid
    sb_svl_reset
    sb_svl_run
    sb_svl_get_res
    sb_svl_destroy_res

Definition in file retina_svl_simple.c.

Function Documentation

◆ create_retina_project_file()

sb_t_err create_retina_project_file ( SB_HANDLE retina)

Create a retina project file.

  1. Set model parameters
    • Set the model name
    • Set the object size
    • Set the objects minimum distance (that is the minimum distance between two objects of the same model)
    • Set the object stride coarse and fine (that is the coarse and fine scanning step)
    • Set the model perturbations (in this case a vertical flip)
  2. Save the project file.

Definition at line 97 of file retina_svl_simple.c.

Here is the call graph for this function:

◆ execute_training()

sb_t_err execute_training ( void  )

Execute training.

  1. Get the solution information.
  2. Load the project.
  3. Reset a previous training.
  4. Set training parameters.
  5. Execute the training (SVL).
  6. Get training results.
  7. Save the training.
  8. Destroy the handles.

Definition at line 191 of file retina_svl_simple.c.

Here is the call graph for this function:

◆ main()

int main ( void  )

In the following the list of the program steps:

  1. Initialization of the SqueezeBrains library.
  2. Wait until the license is active.
  3. Create Retina project file.
  4. Add samples to images.
  5. Execute training.
  6. Destroy the project handle.
  7. Release the library.

Definition at line 56 of file retina_svl_simple.c.

Here is the call graph for this function:

◆ set_samples()

sb_t_err set_samples ( SB_HANDLE  retina)

Set samples.

  1. Set the parameters common to all the samples. For each sample:
    • Set the sample as required
    • Set the scale to 1.0, i.e. no scaling
    • Set the model name of the sample
  2. Add the samples of the images. For each image and sample:
    • Set the flag classified of the image in order for the image to be considered for the learning
    • Set the sample centre position
    • Set the sample UUID in order to uniquely identify the sample
    • Add the sample to the image

Definition at line 130 of file retina_svl_simple.c.