showing boundingboxes and label on my image detected by my trained model

14 ビュー (過去 30 日間)
ahmad
ahmad 2023 年 9 月 15 日
コメント済み: Image Analyst 2023 年 10 月 2 日
hi everyone,
i am trinig to show label and boundingboxes by detecting by yolov2 trained model but error appera as and it can show any boxes on images
>> untitled3
Incorrect number or types of inputs or outputs for function 'detect'.
Error in untitled3 (line 4)
[bboxes,scores,labels] = detect(dnet,img,'Threshold',thrusholdvalue);

採用された回答

Moksh
Moksh 2023 年 9 月 27 日
編集済み: Moksh 2023 年 9 月 29 日
Hi Ahmad,
I understand that you are using the “yolov2” pre-trained model to detect regions of interest, and subsequently, you aim to add bounding boxes around these detected regions.
While using the “detect” function two inputs need to be passed:
  • Detector - A YOLO object detector.
  • Image – Input image on which detection needs to be performed.
Further, the threshold can be passed using the “Threshold” parameter followed by a double value.
Here is an example code:
% Loading a pretrained yolov2 for vechicle detection
vehicleDetector = load('yolov2VehicleDetector.mat','detector');
detector = vehicleDetector.detector;
% Reading a sample image
I = imread('highway.png');
% imshow(I);
% Running the model on sample image for detection
[bboxes,scores,labels] = detect(detector,I,"Threshold",0.2);
% Plotting the bounding box on detected regions
if ~isempty(bboxes)
detectedI = insertObjectAnnotation(I,'rectangle',bboxes,cellstr(labels));
end
figure
imshow(detectedI)
For more information about the detect function, please refer to the following documentation:
Hope this information helps!
Best Regards,
Moksh Aggarwal
  2 件のコメント
ahmad
ahmad 2023 年 10 月 2 日
But my detector shows multiple boxes on same object.second think is that when I change threshold from 0.1 to 0?5 it doesn't detecte any thing.
Image Analyst
Image Analyst 2023 年 10 月 2 日
Well you accepted the answer so I guess youi got it figured out.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by