sh MindStudio-ubuntu/bin/MindStudio.sh
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200328152302815.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2RvbmdrYWl3ZW40OA==,
cp /home/user/modelzoo/resnet18/device/resnet18.om /home/user/AscendProjects/classificationTest/
if (file == nullptr) {
HIAI_ENGINE_LOG(HIAI_IDE_ERROR,
"[DataInput] Failed to open file %s.", path);
return ret;
}
if (imageBufferLen != fread(imageBufferPtr, 1, imageBufferLen, file)){
HIAI_ENGINE_LOG(HIAI_IDE_ERROR,
"[DataInput] Failed to call fread for length(%u).", imageBufferLen);
break;
}
if (0 != DvppCtl(pidvppapi_, DVPP_CTL_JPEGD_PROC, &dvppApiCtlMsg)) {
HIAI_ENGINE_LOG(HIAI_IDE_ERROR,
"[ImagePreProcess] Failed to call DvppCtl for JPEGD, FrameID: %u", imageFrameID_);
jpegdOutData.cbFree(); //release memory from caller.
return HIAI_ERROR;
}
if (0 != DvppCtl(pidvppapi_, DVPP_CTL_VPC_PROC, &dvppApiCtlMsg)) {
HIAI_ENGINE_LOG(HIAI_IDE_ERROR,
"[ImagePreProcess] Failed to call DvppCtl for VPC.");
HIAI_DVPP_DFree(outputConfigure->addr);
outputConfigure->addr = nullptr;
return HIAI_ERROR;
}
hiai::AIContext aiContext;
hiaiRet = aiModelManager_->Process(aiContext, inputDataVec_, outputDataVec_, 0);
if (hiai::SUCCESS != hiaiRet) {
ClearOutData();
HIAI_ENGINE_LOG(HIAI_IDE_ERROR, "[MindInferenceEngine] Failed to call Process for AIModelManager, error code: %u", hiaiRet);
return HIAI_ERROR;
}
putText(mat,labels, Point(2, 20), cv::FONT_HERSHEY_COMPLEX, 0.5, cv::Scalar(0, 0, 255), 1, 8, 0);