When python downloads and saves images, it is automatically saved to the training, verification, and test directories at a specified ratio

foreword

The load_dataset method of the datasets package can directly load the dataset from the directory and divide it into training, validation
and test sets, as follows:

from datasets import load_dataset

# 加载数据集
ds = load_dataset('imagefolder', data_dir=r'E:\数据集\mydatasets2333')
print(ds)
# DatasetDict({
   
    
    
#     train: Dataset({
   
    
    
#         features: ['image', 'label'],

Guess you like

Origin blog.csdn.net/weixin_43721000/article/details/129837126