#给定一个目录字符串 path = "./data/images/"+str(lable) #其中lable是一个数字标签 if not os.path.exists(path):#判断目录是否存在 os.makedirs(path)#如不存在创建目录 img.save(path+"/"+name1,"png")#使用目录,这里使用目录进行保存文件
#给定一个目录字符串 path = "./data/images/"+str(lable) #其中lable是一个数字标签 if not os.path.exists(path):#判断目录是否存在 os.makedirs(path)#如不存在创建目录 img.save(path+"/"+name1,"png")#使用目录,这里使用目录进行保存文件