MIT67室内场景数据集,共67个分类。划分为训练集和测试集的代码。
http://web.mit.edu/torralba/www/indoor.html
划分代码;
# *_*coding: utf-8 *_*
# author --liming--
"""
读取images.txt文件,获得每个图像的标签
读取train.txt文件和test.txt文件,获取每个图像划分到哪个数据集
"""
import os
import shutil
import numpy as np
import time
time_start = time.time()
path='C:\\Users\\hp\\Desktop\\'
# 文件路径
path_train = path + 'train.txt'
path_test = path + 'test.txt'
trian_save_path = path + 'dataset/train/'
test_save_path = path + 'dataset/test/'
# 读取images.txt文件,25 001.Black_footed_Albatross/Black_Footed_Albatross_0008_796083.jpg
'''images = []
with open(path_images, 'r') as f:
for line in f:
images.append(list(line.strip('\n'