算法C编程详解
1. 加载bmodel
c语言接口示例
...
const char *model_name = "VGG_VOC0712_SSD_300x300_deploy";
...
// init bmruntime contxt
p_bmrt_ = bmrt_create(bm_handle_);
if (NULL == p_bmrt_) {
cout << "ERROR: get handle failed!" << endl;
exit(1);
}
// load bmodel from file
ret = bmrt_load_bmodel(p_bmrt_, bmodel.c_str());
if (!ret) {
cout << "ERROR: Load bmodel[" << bmodel << "] failed" << endl;
exit(1);
}
// get model info by model name
net_info_ = bmrt_get_network_info(p_bmrt_, model_name);
if (NULL == net_info_) {
cout << "ERROR: get net-info failed!" << endl;
exit(1);
}
...2. 预处理
3. 推理
4. 算法开发注意事项汇总
Last updated
Was this helpful?