Lens AI Profiler Cpp
|
Class for computing and managing various model statistics. More...
Public Member Functions | |
ModelProfile (std::string model_id, std::string conf_path, int save_interval, int top_classes) | |
Constructor to initialize ModelProfile object. More... | |
int | log_classification_model_stats (float inference_latency, const ClassificationResults &results) |
Logs statistics for a classification model. More... | |
int | log_embeddings (const std::vector< float > &embeddings) |
Logs model embeddings from the model. More... | |
int | log_embeddings (const std::vector< float > &embeddings, int cls) |
Logs Class wise model embeddings. More... | |
int | getNumDistributionBoxes () const |
const distributionBox & | getDistributionBox (unsigned int index) const |
void | registerStatistics () |
Public Attributes | |
frequent_class_sketch * | sketch1 |
Class for computing and managing various model statistics.
ModelProfile::ModelProfile | ( | std::string | model_id, |
std::string | conf_path, | ||
int | save_interval, | ||
int | top_classes | ||
) |
Constructor to initialize ModelProfile object.
ModelProfile class constructor.
model_id | Unique identifier for the model |
no_of_classes | Number of classes the model predicts |
saver | Reference to a Saver object used for saving model statistics |
int ModelProfile::log_classification_model_stats | ( | float | inference_latency, |
const ClassificationResults & | results | ||
) |
Logs statistics for a classification model.
Logs classification model statistics.
inference_latency | Time taken for model inference |
results | Reference to the classification results |
inference_latency | Time taken for model inference |
results | Reference to the classification results |
This function iterates through the provided results and logs statistics for the most frequent classes. It updates the model_classes_stat
map with scores for each class.
int ModelProfile::log_embeddings | ( | const std::vector< float > & | embeddings | ) |
Logs model embeddings from the model.
Logs embeddings.
vector | of embeddings return 0 on sucess, negative value on error |
int ModelProfile::log_embeddings | ( | const std::vector< float > & | embeddings, |
int | cls | ||
) |
Logs Class wise model embeddings.
Computes and logs selected image statistics.
vector | of embeddings |
class | id return 0 on success , negative value on error |
img | OpenCV image matrix |
save_sample | Flag indicating whether to save samples exceeding thresholds |