[请益]关于insertObjectAnnotation出现错误

楼主: relax2048 (枫叶飘逸)   2020-09-08 19:06:06
不好意想要请教各位
我目前正在学习使用Faster-RCNN来做目标检测
整体训练过程问题不大
但是在使用insertObjectAnnotation时
如果没有检测到目标
程式会直接强制停止
Command Windows上会显示
Erroe using insertObjectAnnotation
LABEL to be nonempty
由于程式是循环检测
本来就会出现没有物体的状况
想请教该如何让程式跳过出现错误的那一帧
直接进入下一帧的循环呢?
附上程式码
for i=1:6000
img=imread(['E:\硕士课程\影像资料\2\测试\frame
(',int2str(i),').jpg']);
[bbox,score,label]=detect(detector,img);
index = find(score>0.55);
bbox = bbox(index,:);
score = score(index,:);
label = label(index,:);
img=insertObjectAnnotation(img,'Rectangle',bbox,score);
detectedImg=insertShape(img,'Rectangle',bbox);
figure(1);
imshow(detectedImg);
end
目前有看到似乎可以利用try?或者是continue忽略接续
但是不清楚该如何使用
还请各位指导,谢谢!

Links booklink

Contact Us: admin [ a t ] ucptt.com