ImFusion C++ SDK 4.5.0
ImFusion::ML::ModelInfo Struct Reference

#include <ImFusion/ML/ModelManager.h>

ModelInfo contains all the information to identify a Machine Learning model. More...

Detailed Description

ModelInfo contains all the information to identify a Machine Learning model.

It also includes critical information like whether commercial use of the model is permitted. The "setName" is displayed in the UI. All models with the same setName will download together. Plugin developers should define their own name.

Public Member Functions

bool operator== (const ModelInfo &rhs) const
 Equality of the catalog fields: plugin, setName, modelName, configFileName, modelFileName, allowCommercialUsage, hash, and fileSizeBytes.
bool isValid () const
std::string toJson () const
 Serializes this structure to JSON for persistence in the local model list.

Static Public Member Functions

static ModelInfo fromJson (const std::string &jsonString)
 Parses one model entry from JSON (same shape as entries in the remote/local ml_models.json lists).

Public Attributes

std::string plugin
std::string setName
std::string modelName
std::string configFileName
std::string modelFileName
bool allowCommercialUsage = false
 true when the model license permits commercial use; false when use is limited to non-commercial contexts only.
std::string hash
std::int64_t fileSizeBytes = 0
 Size of the model weights file (modelFileName) in bytes as published in the catalog. Initialized to 0 when unknown or when not verified after download.
std::optional< PropertiesextraProperties

Member Function Documentation

◆ operator==()

bool ImFusion::ML::ModelInfo::operator== ( const ModelInfo & rhs) const

Equality of the catalog fields: plugin, setName, modelName, configFileName, modelFileName, allowCommercialUsage, hash, and fileSizeBytes.

extraProperties is not compared.

◆ isValid()

bool ImFusion::ML::ModelInfo::isValid ( ) const
Returns
true if all required identifiers are non-empty: plugin, setName, modelName, configFileName, and modelFileName. Otherwise false (invalid for listing, download, or disk layout).

◆ fromJson()

ModelInfo ImFusion::ML::ModelInfo::fromJson ( const std::string & jsonString)
static

Parses one model entry from JSON (same shape as entries in the remote/local ml_models.json lists).

Malformed JSON or read errors yield a default-constructed ModelInfo, log an error, and isValid is false.


The documentation for this struct was generated from the following file:
  • ImFusion/ML/ModelManager.h
Search Tab / S to search, Esc to close