C言語のDLLにyolov4の物体検出モデルをロードする方法
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Image Analyst
el 16 de Oct. de 2024
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 comentarios
Ver también
Categorías
Más información sobre Image Data Workflows en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!