SqueezeBrains SDK 1.18
cs_sb.h
1#pragma once
2#include <windows.h>
3#include "sb.h"
4using namespace System;
5using namespace System::Runtime::InteropServices;
6#include "cs_common.h"
7
11namespace sb_cs
12{
39 public enum class SbDlLibraryType :int {
43 };
44
48 public ref class SbRgba {
49 public:
50 unsigned char r;
51 unsigned char g;
52 unsigned char b;
53 unsigned char a;
54 SbRgba();
55 SbRgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
56 internal:
57 SbRgba(const sb_t_rgba* const src);
58 SbError CopyFromNative(const sb_t_rgba* const src);
59 SbError CopyToNative(sb_t_rgba* dst);
60 };
61
65 public ref class SbBgra {
66 public:
67 unsigned char b;
68 unsigned char g;
69 unsigned char r;
70 unsigned char a;
71 SbBgra();
72 SbBgra(unsigned char b, unsigned char g, unsigned char r, unsigned char a);
73 internal:
74 SbBgra(const sb_t_bgra* const src);
75 SbError CopyFromNative(const sb_t_bgra* const src);
76 SbError CopyToNative(sb_t_bgra* dst);
77 };
78
82 public ref class SbSize {
83 public:
84 int width;
85 int height;
86 SbSize();
87 SbSize(int width, int height);
94 String^ ToString() override;
95 internal:
96 SbSize(const sb_t_size* const src);
97 SbError CopyFromNative(const sb_t_size* const src);
98 SbError CopyToNative(sb_t_size* dst);
99 };
100
104 public ref class SbSizeFlt {
105 public:
106 float width;
107 float height;
108 SbSizeFlt();
109 SbSizeFlt(float width, float height);
116 String^ ToString() override;
117 internal:
118 SbSizeFlt(const sb_t_size_flt* const src);
119 SbError CopyFromNative(const sb_t_size_flt* const src);
120 SbError CopyToNative(sb_t_size_flt* dst);
121 };
122
126 public ref class SbRange {
127 public:
128 int min;
129 int max;
130 SbRange();
131 SbRange(int _min, int _max);
138 String^ ToString() override;
139 internal:
140 SbRange(const sb_t_range* const src);
141 SbError CopyFromNative(const sb_t_range* const src);
142 SbError CopyToNative(sb_t_range* dst);
143 };
144
148 public ref class SbRangeFlt {
149 public:
150 float min;
151 float max;
152 SbRangeFlt();
153 SbRangeFlt(float min, float max);
160 String^ ToString() override;
161 internal:
162 SbRangeFlt(const sb_t_range_flt* const src);
163 SbError CopyFromNative(const sb_t_range_flt* const src);
164 SbError CopyToNative(sb_t_range_flt* dst);
165 };
166
170 public ref class SbPoint {
171 public:
172 int x;
173 int y;
174 SbPoint();
175 SbPoint(int x, int y);
182 String^ ToString() override;
183 internal:
184 SbPoint(const sb_t_point* const src);
185 SbError CopyFromNative(const sb_t_point* const src);
186 SbError CopyToNative(sb_t_point* dst);
187 };
188
192 public ref class SbPoint2dF {
193 public:
194 float x;
195 float y;
196 SbPoint2dF();
197 SbPoint2dF(float x, float y);
204 String^ ToString() override;
205 internal:
206 SbPoint2dF(const sb_t_point2d_f* const src);
207 SbError CopyFromNative(const sb_t_point2d_f* const src);
208 SbError CopyToNative(sb_t_point2d_f* dst);
209 };
210
214 public ref class SbRect {
215 public:
216 int x;
217 int y;
218 int width;
219 int height;
220 SbRect(int x, int y, int width, int height);
221 SbRect();
228 String^ ToString() override;
229 internal:
230 SbRect(const sb_t_rect* const src);
231 SbError CopyFromNative(const sb_t_rect* const src);
232 };
233
237 public ref class SbMemoryInfo {
238 public:
239 signed long long proc_virtual_used;
240 signed long long proc_virtual_used_max;
241 signed long long proc_virtual_max;
242 signed long long proc_physical_used;
243 signed long long proc_physical_used_max;
244 signed long long system_total;
245 signed long long system_used;
246 signed long long system_free;
247 internal:
248 SbMemoryInfo(const sb_t_memory_info* const src);
249 SbError CopyFromNative(const sb_t_memory_info* const src);
250 };
251
255 public ref class SbDeviceInfo {
256 public:
262
267 array<SbFrameworkType^>^ frameworks;
268
273 String^ name;
274
280
285 int id;
286
292 internal:
293 SbDeviceInfo(const sb_t_device_info* const src);
294 SbError CopyFromNative(const sb_t_device_info* const src);
295 };
296
300 public ref class SbMetrics
301 {
302 public:
306 float accuracy;
310 float recall;
318 float f1_score;
323 internal:
324 SbMetrics(const sb_t_metrics* const sb_metrics);
325 SbError CopyFromNative(const sb_t_metrics* const sb_metrics);
326 };
327
332 public ref class SbInfo: SbCommon
333 {
334 public:
344 String^ version_str;
359 signed long long malloc_size;
364 signed long long malloc_size_max;
374 array<SbDeviceInfo^>^ devices;
381 SbError Refresh(int dl_devices_info);
389 String^ Format();
390 internal:
391 SbInfo();
392 ~SbInfo();
393 SbError CopyFromNative(sb_t_info* const src);
394 sb_t_info* sb_info;
395 };
396
400 public ref class Sb
401 {
402 public:
412 static SbError Init(String ^ license_file);
424 static SbError InitDl(String^ search_path, SbDlLibraryType LibType);
430 static SbError Release();
452 static SbInfo^ GetInfo(int dl_devices_info);
464 static String^ FormatDeviceType(SbDeviceType value);
471 };
472
477 {
478 public:
479 static SbError StringCopyToNative(char* const dst, int dst_size, String^ src);
480 static String^ StringCopyFromNative(const char* const src);
481 static String^ StringCopyFromNative(char* const src);
482 }; // group_cs_common
484 // group_cs
486}
487
488#include "cs_folder.h"
489#include "cs_license.h"
490#include "cs_image.h"
491#include "cs_sample.h"
492#include "cs_blob.h"
493#include "cs_par.h"
494#include "cs_roi.h"
495#include "cs_res.h"
496#include "cs_project.h"
497#include "cs_solution.h"
bgra class that wraps the sb_t_bgra structure
Definition: cs_sb.h:65
unsigned char g
green component of color
Definition: cs_sb.h:68
unsigned char a
trasparency of color
Definition: cs_sb.h:70
unsigned char b
blue component of color
Definition: cs_sb.h:67
unsigned char r
red component of color
Definition: cs_sb.h:69
Common class
Definition: cs_common.h:242
Characteristics of a computing device. It wraps the sb_t_device_info structure.
Definition: cs_sb.h:255
SbMemoryInfo memory
Memory information of the device and the process.
Definition: cs_sb.h:291
array< SbFrameworkType^> frameworks
Frameworks compatible with the device.
Definition: cs_sb.h:267
int id
Identifier of the device.
Definition: cs_sb.h:285
String name
Device name.
Definition: cs_sb.h:273
SbDeviceType type
Device type.
Definition: cs_sb.h:261
String compute_capability
Device CUDA Compute capability.
Definition: cs_sb.h:279
Sb Main Class
Definition: cs_sb.h:401
static SbError Release()
Releases all the resources allocated in the library
static SbError CheckMemoryLeak()
Checks if the library has a memory leak.
static String SbInitNoLicenseKey
SB_INIT_NO_LICENSE_KEY
Definition: cs_sb.h:458
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 String SbInitOnlySbLicenseKey
SB_INIT_ONLY_SB_LICENSE_KEY
Definition: cs_sb.h:456
static String SbInitOnlyHwLicenseKey
SB_INIT_ONLY_HW_LICENSE_KEY
Definition: cs_sb.h:454
static SbError CheckMemoryLeakReset()
Resets the memory leak control
static SbInfo GetInfo(int dl_devices_info)
The function gets information of the sb library and the available computational devices
static SbError Init(String ^ license_file)
Init the SB Library. The function initializes all the functionalities of the library including the li...
static String FormatDeviceType(SbDeviceType value)
The function gets the device type description
static String FormatFrameworkType(SbFrameworkType value)
The function gets the framework type description
Info class that wraps the sb_t_info structure. You must call the Dispose() method to free all the re...
Definition: cs_sb.h:333
signed long long malloc_size_max
Maximum allocated memory, expressed in bytes, by sb the library. sb_t_info.malloc_size_max
Definition: cs_sb.h:364
int dl_modules_enabled
Value is different from 0 if Deep Learning modules are enabled. sb_t_info.dl_modules_enabled
Definition: cs_sb.h:369
SbVersion version
Version of the sb library. sb_t_info.version
Definition: cs_sb.h:339
SbError Refresh(int dl_devices_info)
Refresh the sb library information
String compile_time
String of the compile time of the sb library sb_t_info.compile_time
Definition: cs_sb.h:354
String Format()
Formats SbInfo parameters in a string.
array< SbDeviceInfo^> devices
Array of available devices sb_t_info.devices
Definition: cs_sb.h:374
String version_str
String of the version of the sb library. sb_t_info.version_str
Definition: cs_sb.h:344
String compile_date
String of the compile date of the sb library. sb_t_info.compile_date
Definition: cs_sb.h:349
signed long long malloc_size
Current allocated memory, expressed in bytes, by sb the library. sb_t_info.malloc_size
Definition: cs_sb.h:359
Memory information. It wraps the sb_t_memory_info structure.
Definition: cs_sb.h:237
signed long long proc_virtual_max
maximum virtual memory usable by the process, in bytes
Definition: cs_sb.h:241
signed long long system_total
system physical memory, in bytes
Definition: cs_sb.h:244
signed long long proc_virtual_used
virtual memory used by process, in bytes
Definition: cs_sb.h:239
signed long long proc_physical_used_max
maximum physical memory used by the process, in bytes
Definition: cs_sb.h:243
signed long long system_free
system free physical memory, in bytes
Definition: cs_sb.h:246
signed long long proc_virtual_used_max
maximum virtual memory used by the process, in bytes
Definition: cs_sb.h:240
signed long long proc_physical_used
physical memory used by the process, in bytes
Definition: cs_sb.h:242
signed long long system_used
system used physical memory, in bytes
Definition: cs_sb.h:245
Surface res Class that wraps the sb_t_surface_res structure
Definition: cs_sb.h:301
float f1_score
F1-Score
Definition: cs_sb.h:318
float specificity
Specificity
Definition: cs_sb.h:322
float accuracy
Accuracy
Definition: cs_sb.h:306
float precision
Precision
Definition: cs_sb.h:314
float recall
Recall
Definition: cs_sb.h:310
Point class that wraps the sb_t_point2d_f structure
Definition: cs_sb.h:192
float y
y coordinate
Definition: cs_sb.h:195
float x
x coordinate
Definition: cs_sb.h:194
String ToString() override
Formats the sample coordinate in a readable string (x;y).
Point class that wraps the sb_t_point structure
Definition: cs_sb.h:170
String ToString() override
Formats the sample coordinate in a readable string (x;y).
int x
x coordinate
Definition: cs_sb.h:172
int y
y coordinate
Definition: cs_sb.h:173
Range value class that wraps the sb_t_range_flt structure
Definition: cs_sb.h:148
float min
minumum value
Definition: cs_sb.h:150
String ToString() override
Formats the range in a readable string (min;max).
float max
maximum value
Definition: cs_sb.h:151
Range value class that wraps the sb_t_range structure
Definition: cs_sb.h:126
String ToString() override
Formats the range in a readable string (min;max).
int min
mininum value
Definition: cs_sb.h:128
int max
maximum value
Definition: cs_sb.h:129
Rectangle class that wraps the sb_t_rect structure
Definition: cs_sb.h:214
int x
x coordinate of the upper left corner of the rectangle
Definition: cs_sb.h:216
int y
y coordinate of the upper left corner of the rectangle
Definition: cs_sb.h:217
int width
width of the rectangle
Definition: cs_sb.h:218
String ToString() override
Formats the rectangle in a readable string ul=(x;y) size=(width;height).
int height
height of the rectangle
Definition: cs_sb.h:219
rgba class that wraps the sb_t_rgba structure
Definition: cs_sb.h:48
unsigned char r
red component of color
Definition: cs_sb.h:50
unsigned char g
green component of color
Definition: cs_sb.h:51
unsigned char b
blue component of color
Definition: cs_sb.h:52
unsigned char a
trasparency of color
Definition: cs_sb.h:53
Size class that wraps the sb_t_size_flt structure
Definition: cs_sb.h:104
float width
width
Definition: cs_sb.h:106
float height
height
Definition: cs_sb.h:107
String ToString() override
Formats the size in a readable string (width;height).
Size class that wraps the sb_t_size structure
Definition: cs_sb.h:82
int height
height
Definition: cs_sb.h:85
String ToString() override
Formats the size in a readable string (width:height).
int width
width
Definition: cs_sb.h:84
Utils Class
Definition: cs_sb.h:477
Version class that wraps the sb_t_version structure
Definition: cs_common.h:199
SbDlLibraryType
Deep Learning library types
Definition: cs_sb.h:39
@ SB_DL_LIBRARY_PYTORCH
SB_DL_LIBRARY_OPENVINO.
@ SB_DL_LIBRARY_NONE
No libraries defined.
@ SB_DL_LIBRARY_OPENVINO
Openvino library. Can be used only for inference with sb_project_detection function.
SbError
Enum error codes
Definition: cs_common.h:13
SbFrameworkType
Framework type that wraps the sb_t_framework_type enum
Definition: cs_common.h:231
SbDeviceType
Device type that wraps the sb_t_device_type enum
Definition: cs_common.h:219
#define SB_INIT_ONLY_HW_LICENSE_KEY
Use this define with sb_init in order to manage only hardware license keys.
Definition: sb.h:6666
#define SB_INIT_NO_LICENSE_KEY
Use this define with sb_init in order to not manage license keys.
Definition: sb.h:6678
#define SB_INIT_ONLY_SB_LICENSE_KEY
Use this define with sb_init in order to manage only SqueezeBrains software license keys.
Definition: sb.h:6672
SB Namespace
Definition: cs_common.h:3
SqueezeBrains libraries header file.
Defines the color in the format BGRA.
Definition: sb.h:6961
Information about a computing device.
Definition: sb.h:6878
General information about sb library and computing devices like CPU and GPUs.
Definition: sb.h:6946
Memory information.
Definition: sb.h:6816
Metrics calculated on counters.
Definition: sb.h:12306
Represents an ordered pair of float x and y coordinates that defines a point in a two-dimensional pla...
Definition: sb.h:6488
Represents an ordered pair of integer x and y coordinates that defines a point in a two-dimensional p...
Definition: sb.h:6479
Represents an ordered pair of float minimum and maximum values that defines a range.
Definition: sb.h:6524
Represents an ordered pair of 32 bits signed integer minimum and maximum values that defines a range.
Definition: sb.h:6515
Defines the position and size of a rectangle in a two-dimensional plane.
Definition: sb.h:6533
Defines the color in the format RGBA.
Definition: sb.h:6994
Represents an ordered pair of float x and y length that defines a rectangle in a two-dimensional plan...
Definition: sb.h:6506
Represents an ordered pair of integer x and y length that defines a rectangle in a two-dimensional pl...
Definition: sb.h:6497