49 Console.WriteLine(
"Sb Init");
50 err =
Sb.
Init(
"../../../sb.lic");
53 Console.WriteLine(
"Sb.Init failed with error " + err);
58 Console.WriteLine(
"Wait for license...");
59 err = Common.WaitLicense();
62 Console.WriteLine(
"SbLicense.WaitLicense failed with error " + err);
70 Console.WriteLine(
"Sb.InitDl failed with error " + err);
77 if (solutionInfo ==
null || solutionInfo.
Error() !=
SbError.SB_ERR_NONE)
79 err = solutionInfo ==
null ?
SbError.SB_ERR_INSUFFICIENT_FREE_MEMORY : solutionInfo.
Error();
80 Console.WriteLine(
"SbSolution.GetInfo failed");
83 else if (solutionInfo.
projects.Length == 0)
85 err =
SbError.SB_ERR_PROJECT_NOT_FOUND;
86 Console.WriteLine(
"SbSolution.GetInfo no projects found");
89 Console.WriteLine(
"GetInfo, found " + solutionInfo.
projects.Length +
" project/s");
95 err = prj ==
null ?
SbError.SB_ERR_INSUFFICIENT_FREE_MEMORY : prj.
Error();
96 Console.WriteLine(
"SbProject.Load failed with error " + err);
108 Console.WriteLine(
"SbProject.SetPar failed with error " + err);
115 for (
int i = 0; i < folder.
files.Length; i++)
121 Console.WriteLine(
"SbImage.Load " + folder.
files[i] +
" failed");
122 err = img ==
null ?
SbError.SB_ERR_INTERNAL : img.
Error();
128 if (err !=
SbError.SB_ERR_NONE)
130 Console.WriteLine(
"SbProject.Detection failed with error " + err);
138 err = res ==
null ?
SbError.SB_ERR_INSUFFICIENT_FREE_MEMORY : prj.
Error();
139 Console.WriteLine(
"SbProject.GetRes failed with error " + err);
144 Console.WriteLine(
"image: " + folder.
files[i]);
145 Console.WriteLine(
"\tmodel=" + res.
samples[0].model_name +
",\tweight=" + res.
samples[0].weight);
171 Console.WriteLine(
"Release SqueezeBrains library");
174 Console.WriteLine(
"Press ENTER to terminate");
180 static void Main(
string[] args)
Tutorial 3 - Deep Cortex - How to elaborate images
SbError Error()
Returns the error code of the last operation. If no error SbError.SB_ERR_NONE is returned.
static const String SbSolutionExt
Solution file extension
array< int > id
Identifier of the devices to be used
SbDeviceType type
Device computational type
Folder Class that wraps the sb_t_folder structure
static SbFolder Load(String^ path, String ^ext, bool sort, int verbosity)
Creates the list of the name of the files in a specified folder.
array< String^> files
Array of files.
static SbError Release()
Releases all the resources allocated in the library
static SbError InitDl(String^ search_path, SbDlLibraryType LibType)
Init the Deep Learning SB Library. The function enables the SbProject::Detection and SVL functions fo...
static SbError Init(String ^ license_file)
Init the SB Library. The function initializes all the functionalities of the library including the li...
SbImage class that wraps the sb_t_image structure. You must call the Dispose() method to free all the...
static SbImage Load(String^ filename)
Loads an image from file.
Parameters Class that wraps the sb_t_par structure. You must call the Dispose() method to free all th...
SbDevicesPar devices
Devices used for inference.
Project Class You must call the Dispose() method to free all the resources of the returned instance.
static SbProject Load(String^ solution_file, String^ project_uuid, SbProjectMode mode)
Loads an existing project from file.
SbRes GetRes(bool details)
Retrieves the results of the last processed image
SbError Detection(SbImage ^img, SbRoi ^roi)
The function elaborates the image inside the ROI. For Surface projects the function computes also the...
SbPar GetPar()
Retrieves the project parameters structure.
SbError SetPar(SbPar^ par)
Sets the project parameters.
Class of the results of the image elaboration with the SbProject::Detection method....
array< SbSample^> samples
Samples results. Only Retina projects
static SbSolutionInfo GetInfo(String^ solution_file)
Returns the information contained in the solution_file.
Solution Info Class that wraps the sb_t_solution_info structure
array< SbProjectInfo^> projects
Array of the projects information of the solution. sb_t_solution_info.projects
SbDlLibraryType
Deep Learning library types
SbProjectMode
Project loading or saving mode that wraps the sb_t_project_mode enum
SbDeviceType
Device type that wraps the sb_t_device_type enum