📝Step 2: Integrating Lens AI Cpp Profiler on Edge
Last updated
Last updated
The current version of the Lens AI supports vision data in the next releases supports audio , timeseries and text data.
Lens AI Cpp profiler should be integrated on the edge device, where the inference happens.
Build & Install the Cpp library on the device there are also prebuilt packages for Ubuntu x64-86 and Arm architectures.
docker pull vsnm/lensai_profiler_cpp:latest
docker run -it --rm vsnm/lensai_profiler_cpp
Once the library is built and successfully installed then integrate the profiling code in your inference script
Define the configuration file based on the output from the previous step of computing the thresholds.
sampling
Sampling data where model is most uncertain.
MARGINCONFIDENCE
Margin Confidence of the classes are above the threshold then sample those data points
LEASTCONFIDENCE
Least Confidence of the classes are above the threshold then sam
RATIOCONFIDENCE
Ratio Confidence of the classes are above the threshold then sam
FILEPATH
Path in which to save the metrics and samples
Image
Image related metrics.
NOISE
BRIGHTNESS
SHARPNESS
CHANNELS
HISTOGRAM
FILEPATH
Path to image related metrics and samples
model
Model Metrics.
FILEPATH
Path to the model related metrics and samples
The metrics always a lower and upper threshold is defined to capture the samples at the tails of the distribution. default values for the confidence are 0.01 and 0.9 meaning it samples the images that model is 99.9 % confident or above or below 10 % confident.
define the frequency at which you want to save the metrics
In the inference part after the inference, you can ass the following line to start profiling