- Ensure images are present in the location folder.
- Modify the line str=['location',str] to str=['location/',str];
Resizing the image to 224*224 for resnet50
2 次查看(过去 30 天)
显示 更早的评论
clc;
clear all;
close all;
path=dir('location');
n=length(path);
for i=3:n
str=path(i).name;
[p ,fname]=fileparts(str);
str=['location',str];
im=imread(str);
im=imresize(im,[224,224]);
im=im2gray(im);
% newmap = rgb2gray(map)
imwrite(im,strcat(fname,'.jpg'))
end
0 个评论
回答(2 个)
Aakash
2023-6-15
Ok so going by the tags associated with your question:
2 个评论
Aakash
2023-6-15
Looks like location folder is not in current directory where matlab is considering, so give full path of your location folder and check.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!