我用这些代码列出图像:
for folder in folder_list:
img = os.path.join(f"{train_dir}/{folder}/00001.png")
print(img)
输出为:
Fish/train/Black Sea Sprat/00001.png/Fish/train/Gilt-Head Bream/00001.png Fish/train/Horse Mackerel/00001.png Fish/train/Red Sea Bream/00001.png Fish/train/Sea Bass/00001.png Fish/train/Shrimp/00001.png/Fish/train/Striped Red Mullet/00001.png下载/Fish/train/Trout/00001.有9张图片。
1条答案
按热度按时间ruarlubt1#
您只是打印图像文件名。您需要enumerate图像列表并使用plt.sublot逐个绘制