训练集4000张图片,测试集5532张图片,官方的文件夹有两个分别是图片数据文件夹JPEGImages以及划分标签文件夹ImageSplits:
import os
import shutil
dir = 'D:\Stanford40_JPEGImages'
data_dir = dir + '\\JPEGImages'
train_dir = dir + '\\train'
test_dir = dir + '\\test'
txt_path = dir + '\\ImageSplits'
if not os.path.exists(train_dir):
os.makedirs(train_dir)
if not os.path