Model
模型加载、推理、元信息读取与并发调度。
类结构
Model // 模型实例
│
├── meta → ModelMeta // 模型元信息
│ ├── path → std::string // 模型文件路径
│ ├── task → std::string // 任务短名
│ ├── class_count → int64_t // 类别数
│ ├── labels → std::vector<std::string> // 类别名
│ ├── input_width → uint32_t // 输入宽
│ ├── input_height → uint32_t // 输入高
│ ├── input_channels → uint32_t // 输入通道数
│ ├── meta_json → std::string // 元信息 JSON
│ └── is_encrypted → bool // 是否加密
├── config → ModelConfig // 运行配置
├── runtime → ModelRuntime // 运行期只读面
│ └── diagnostics → Diagnostics // 本机环境快照
│
├── phase → Phase // 生命周期状态
├── license → ModelState // 授权态
├── last_error → LastError // 上次失败
│
└── 方法
├── Model(path) // 构造,即读元信息
├── Open(password?) // 打开(解锁)
├── close() // 释放
├── infer // 推理
├── submit / wait // 并发投递与取结果
├── set_labels / clear_labels // 类别名,随时可调,`open` 后生效
└── diagnostics // 环境快照(静态)