C言語のDLLにyolov4の物体検出モデルをロードする方法
조회 수: 8 (최근 30일)
이전 댓글 표시
function [bboxes, scores, labels, annotatedImage] = yolov4Detect(imageData)
% コード生成対応モデルの読み込み
persistent yolov4Detector;
if isempty(yolov4Detector)
yolov4Detector = coder.loadDeepLearningNetwork("yolov4Detector.mat");
end
% 固定サイズの設定
height = 224; % YOLOv4が使用する高さ
width = 224; % YOLOv4が使用する幅
numChannels = 3; % RGB画像の場合のチャンネル数
% 画像データを再構築
I = reshape(imageData, [height, width, numChannels]);
% 物体検出
[bboxes, scores, labels] = detect(yolov4Detector, I);
% 画像に検出結果を描画
if ~isempty(bboxes)
% バウンディングボックスとラベルを描画
annotatedImage = insertObjectAnnotation(I, 'rectangle', bboxes, labels);
else
% 検出結果がない場合はそのまま返す
annotatedImage = I;
end
end
//
5行目
yolov4Detector = coder.loadDeepLearningNetwork("yolov4Detector.mat");
に対してエラーが発生しました。
The full file path to MAT file or function name 'yolov4Detector.mat' contains unsupported non ASCII characters. For code generation, the full file path must contain ASCII characters only.
どうすれば良いですか
댓글 수: 0
답변 (1개)
Image Analyst
2024년 10월 16일
Seems like it's saying it doesn't like some of the characters in your path. Your current folder probably has an unsupported character in it. Try using a path with all Western/Latin/English letters in it.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!