├── sample ├── __init__.py └── eval_results.py ├── loaders ├── __init__.py ├── .DS_Store ├── __init__.pyc ├── data_list.pyc ├── __pycache__ │ ├── __init__.cpython-36.pyc │ └── data_list.cpython-36.pyc ├── cfg │ ├── digits-s-1.json │ ├── digits-s-3.json │ ├── digits-s-5.json │ ├── digits-s-7.json │ ├── office31-t.json │ ├── office31-s.json │ ├── digits-a-25.json │ ├── digits-a.json │ └── visda17.json └── dsne_loader.py ├── model ├── __init__.py ├── .DS_Store ├── basenet.pyc ├── resnet.pyc ├── __init__.pyc ├── __pycache__ │ ├── basenet.cpython-36.pyc │ ├── resnet.cpython-36.pyc │ ├── LeNetPlus.cpython-36.pyc │ └── __init__.cpython-36.pyc ├── LeNetPlus.py ├── basenet.py └── resnet.py ├── utils ├── __init__.py ├── .DS_Store ├── loss.pyc ├── utils.pyc ├── __init__.pyc ├── lr_schedule.pyc ├── return_dataset.pyc ├── __pycache__ │ ├── loss.cpython-36.pyc │ ├── utils.cpython-36.pyc │ ├── __init__.cpython-36.pyc │ ├── tpn_task.cpython-36.pyc │ ├── lr_schedule.cpython-36.pyc │ ├── randaugment.cpython-36.pyc │ └── return_dataset.cpython-36.pyc ├── path_change.py ├── path_change_office.py ├── path_change_officehome.py ├── lr_schedule.py ├── copy_list_txt.py ├── copy_list_office.py ├── utils.py ├── mmd.py ├── randaugment.py └── loss.py ├── pretrained └── __init__.py ├── .DS_Store ├── data ├── .DS_Store └── txt │ ├── .DS_Store │ ├── visda │ ├── set1_labeled_target_images_sketch_3.txt │ └── set2_labeled_target_images_sketch_3.txt │ ├── office_home │ ├── labeled_target_images_Art_1.txt │ ├── labeled_target_images_Real_1.txt │ ├── labeled_target_images_Clipart_1.txt │ ├── labeled_target_images_Product_1.txt │ ├── labeled_target_images_Art_3.txt │ ├── validation_target_images_Art_3.txt │ ├── labeled_target_images_Real_3.txt │ ├── validation_target_images_Real_3.txt │ ├── labeled_target_images_Clipart_3.txt │ ├── labeled_target_images_Product_3.txt │ ├── validation_target_images_Clipart_3.txt │ └── validation_target_images_Product_3.txt │ └── multi │ ├── labeled_target_images_real_1.txt │ ├── labeled_target_images_sketch_1.txt │ ├── labeled_target_images_clipart_1.txt │ ├── labeled_target_images_painting_1.txt │ ├── labeled_target_images_real_3.txt │ ├── validation_target_images_real_3.txt │ └── labeled_target_images_sketch_3.txt ├── log_utils ├── .DS_Store └── __pycache__ │ ├── utils.cpython-35.pyc │ ├── utils.cpython-36.pyc │ └── utils.cpython-37.pyc ├── requirements.txt ├── logs └── r2s_proto_resnet_num1_semi_kld_hard ├── download_data.sh ├── README.md └── eval.py /sample/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /loaders/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /model/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /utils/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /pretrained/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/.DS_Store -------------------------------------------------------------------------------- /data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/data/.DS_Store -------------------------------------------------------------------------------- /model/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/model/.DS_Store -------------------------------------------------------------------------------- /utils/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/.DS_Store -------------------------------------------------------------------------------- /utils/loss.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/loss.pyc -------------------------------------------------------------------------------- /utils/utils.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/utils.pyc -------------------------------------------------------------------------------- /loaders/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/loaders/.DS_Store -------------------------------------------------------------------------------- /model/basenet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/model/basenet.pyc -------------------------------------------------------------------------------- /model/resnet.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/model/resnet.pyc -------------------------------------------------------------------------------- /data/txt/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/data/txt/.DS_Store -------------------------------------------------------------------------------- /loaders/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/loaders/__init__.pyc -------------------------------------------------------------------------------- /log_utils/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/log_utils/.DS_Store -------------------------------------------------------------------------------- /model/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/model/__init__.pyc -------------------------------------------------------------------------------- /utils/__init__.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/__init__.pyc -------------------------------------------------------------------------------- /loaders/data_list.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/loaders/data_list.pyc -------------------------------------------------------------------------------- /utils/lr_schedule.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/lr_schedule.pyc -------------------------------------------------------------------------------- /utils/return_dataset.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/return_dataset.pyc -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | torch==0.4.0 2 | numpy==1.14.3 3 | torchvision==0.2.1 4 | tqdm==4.26.0 5 | Pillow==6.2.0 -------------------------------------------------------------------------------- /utils/__pycache__/loss.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/__pycache__/loss.cpython-36.pyc -------------------------------------------------------------------------------- /model/__pycache__/basenet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/model/__pycache__/basenet.cpython-36.pyc -------------------------------------------------------------------------------- /model/__pycache__/resnet.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/model/__pycache__/resnet.cpython-36.pyc -------------------------------------------------------------------------------- /utils/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /log_utils/__pycache__/utils.cpython-35.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/log_utils/__pycache__/utils.cpython-35.pyc -------------------------------------------------------------------------------- /log_utils/__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/log_utils/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /log_utils/__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/log_utils/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /model/__pycache__/LeNetPlus.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/model/__pycache__/LeNetPlus.cpython-36.pyc -------------------------------------------------------------------------------- /model/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/model/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /utils/__pycache__/tpn_task.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/__pycache__/tpn_task.cpython-36.pyc -------------------------------------------------------------------------------- /loaders/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/loaders/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /loaders/__pycache__/data_list.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/loaders/__pycache__/data_list.cpython-36.pyc -------------------------------------------------------------------------------- /utils/__pycache__/lr_schedule.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/__pycache__/lr_schedule.cpython-36.pyc -------------------------------------------------------------------------------- /utils/__pycache__/randaugment.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/__pycache__/randaugment.cpython-36.pyc -------------------------------------------------------------------------------- /utils/__pycache__/return_dataset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kailigo/pacl/HEAD/utils/__pycache__/return_dataset.cpython-36.pyc -------------------------------------------------------------------------------- /logs/r2s_proto_resnet_num1_semi_kld_hard: -------------------------------------------------------------------------------- 1 | 126 classes in this dataset 2 | Ep: 0 lr: 0.01, loss_all: 5.239571, loss_c: 5.016991, loss_d: 2.225803, loss_u: 0.000000, loss_mme: 0.463399 3 | -------------------------------------------------------------------------------- /loaders/cfg/digits-s-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "MT": { 3 | "DATA": "datasets/MNIST/mnist.pkl", 4 | "SRC-N": 2000, 5 | "TGT-N": 10 6 | }, 7 | "US": { 8 | "DATA": "datasets/USPS/usps.pkl", 9 | "SRC-N": 1800, 10 | "TGT-N": 10 11 | } 12 | } -------------------------------------------------------------------------------- /loaders/cfg/digits-s-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "MT": { 3 | "DATA": "datasets/MNIST/mnist.pkl", 4 | "SRC-N": 2000, 5 | "TGT-N": 30 6 | }, 7 | "US": { 8 | "DATA": "datasets/USPS/usps.pkl", 9 | "SRC-N": 1800, 10 | "TGT-N": 30 11 | } 12 | } -------------------------------------------------------------------------------- /loaders/cfg/digits-s-5.json: -------------------------------------------------------------------------------- 1 | { 2 | "MT": { 3 | "DATA": "datasets/MNIST/mnist.pkl", 4 | "SRC-N": 2000, 5 | "TGT-N": 50 6 | }, 7 | "US": { 8 | "DATA": "datasets/USPS/usps.pkl", 9 | "SRC-N": 1800, 10 | "TGT-N": 50 11 | } 12 | } -------------------------------------------------------------------------------- /loaders/cfg/digits-s-7.json: -------------------------------------------------------------------------------- 1 | { 2 | "MT": { 3 | "DATA": "datasets/MNIST/mnist.pkl", 4 | "SRC-N": 2000, 5 | "TGT-N": 70 6 | }, 7 | "US": { 8 | "DATA": "datasets/USPS/usps.pkl", 9 | "SRC-N": 1800, 10 | "TGT-N": 70 11 | } 12 | } -------------------------------------------------------------------------------- /download_data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # mkdir data data/multi 3 | 4 | 5 | 6 | cd data/multi 7 | wget http://csr.bu.edu/ftp/visda/2019/multi-source/real.zip -O real.zip 8 | wget http://csr.bu.edu/ftp/visda/2019/multi-source/sketch.zip -O sketch.zip 9 | unzip real.zip 10 | unzip sketch.zip 11 | 12 | -------------------------------------------------------------------------------- /loaders/cfg/office31-t.json: -------------------------------------------------------------------------------- 1 | { 2 | "A": { 3 | "DATA": "datasets/Office31/amazon/images", 4 | "SRC-N": 0, 5 | "TGT-N": 93 6 | }, 7 | "D": { 8 | "DATA": "datasets/Office31/dslr/images", 9 | "SRC-N": 0, 10 | "TGT-N": 93 11 | }, 12 | "W": { 13 | "DATA": "datasets/Office31/webcam/images", 14 | "SRC-N": 0, 15 | "TGT-N": 93 16 | } 17 | } -------------------------------------------------------------------------------- /loaders/cfg/office31-s.json: -------------------------------------------------------------------------------- 1 | { 2 | "A": { 3 | "DATA": "datasets/Office31/amazon/images", 4 | "SRC-N": 630, 5 | "TGT-N": 93 6 | }, 7 | "D": { 8 | "DATA": "datasets/Office31/dslr/images", 9 | "SRC-N": 248, 10 | "TGT-N": 93 11 | }, 12 | "W": { 13 | "DATA": "datasets/Office31/webcam/images", 14 | "SRC-N": 248, 15 | "TGT-N": 93 16 | } 17 | } -------------------------------------------------------------------------------- /loaders/cfg/digits-a-25.json: -------------------------------------------------------------------------------- 1 | { 2 | "MT": { 3 | "DATA": "datasets/MNIST/mnist.pkl", 4 | "SRC-N": 0, 5 | "TGT-N": 250 6 | }, 7 | "MM": { 8 | "DATA": "datasets/MNIST-M/mnist_m.pkl", 9 | "SRC-N": 0, 10 | "TGT-N": 250 11 | }, 12 | "SN": { 13 | "DATA": "datasets/SVHN/svhn.pkl", 14 | "SRC-N": 0, 15 | "TGT-N": 250 16 | }, 17 | "US": { 18 | "DATA": "datasets/USPS/usps.pkl", 19 | "SRC-N": 0, 20 | "TGT-N": 250 21 | } 22 | } -------------------------------------------------------------------------------- /loaders/cfg/digits-a.json: -------------------------------------------------------------------------------- 1 | { 2 | "MT": { 3 | "DATA": "datasets/MNIST/mnist.pkl", 4 | "SRC-N": 0, 5 | "TGT-N": 100 6 | }, 7 | "MM": { 8 | "DATA": "datasets/MNIST-M/mnist_m.pkl", 9 | "SRC-N": 0, 10 | "TGT-N": 100 11 | }, 12 | "SN": { 13 | "DATA": "datasets/SVHN/svhn.pkl", 14 | "SRC-N": 0, 15 | "TGT-N": 100 16 | }, 17 | "US": { 18 | "DATA": "datasets/USPS/usps.pkl", 19 | "SRC-N": 0, 20 | "TGT-N": 100 21 | } 22 | } -------------------------------------------------------------------------------- /loaders/cfg/visda17.json: -------------------------------------------------------------------------------- 1 | { 2 | "SRC": { 3 | "TRAIN": "datasets/VisDA17/src-0.rec" 4 | }, 5 | "TGT": { 6 | "TRAIN": "datasets/VisDA17/tgt-120.rec", 7 | "TEST": "datasets/VisDA17/tgt-55268.rec" 8 | }, 9 | "Label": { 10 | "0": "aeroplane", 11 | "1": "bicycle", 12 | "2": "bus", 13 | "3": "car", 14 | "4": "horse", 15 | "5": "knife", 16 | "6": "motorcycle", 17 | "7": "person", 18 | "8": "plant", 19 | "9": "skateboard", 20 | "10": "train", 21 | "11": "truck" 22 | } 23 | } -------------------------------------------------------------------------------- /utils/path_change.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | p_path = "/home/grad3/keisaito/project/da/semisupervised/data/txt" 4 | txts = os.listdir(p_path) 5 | for txt in txts: 6 | txt_path = os.path.join(p_path, txt) 7 | lines = open(txt_path, "r").readlines() 8 | new_file = open(txt_path, "w") 9 | for line in lines: 10 | file_path = line.split(" ")[0].split("/")[-1] 11 | dir_path = line.split(" ")[0].split("/")[-2] 12 | d_path = line.split(" ")[0].split("/")[-3] 13 | class_n = line.split(" ")[1] 14 | new_file.write(os.path.join(d_path, dir_path, file_path) + " " + class_n) 15 | 16 | 17 | -------------------------------------------------------------------------------- /utils/path_change_office.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | p_path = "/home/grad3/keisaito/project/da/semisupervised/data/txt/office" 4 | txts = os.listdir(p_path) 5 | for txt in txts: 6 | txt_path = os.path.join(p_path, txt) 7 | lines = open(txt_path, "r").readlines() 8 | new_file = open(txt_path, "w") 9 | for line in lines: 10 | file_path = line.split(" ")[0].split("/")[-1] 11 | dir_path = line.split(" ")[0].split("/")[-2] 12 | d_path = line.split(" ")[0].split("/")[-4] 13 | class_n = line.split(" ")[1] 14 | new_file.write(os.path.join(d_path, "images", dir_path, file_path) + " " + class_n) 15 | 16 | 17 | -------------------------------------------------------------------------------- /utils/path_change_officehome.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | import os 3 | p_path = "/home/grad3/keisaito/project/da/semisupervised/data/txt/office_home" 4 | txts = os.listdir(p_path) 5 | for txt in txts: 6 | txt_path = os.path.join(p_path, txt) 7 | lines = open(txt_path, "r").readlines() 8 | new_file = open(txt_path, "w") 9 | for line in lines: 10 | file_path = line.split(" ")[0].split("/")[-1] 11 | dir_path = line.split(" ")[0].split("/")[-2] 12 | d_path = line.split(" ")[0].split("/")[-3] 13 | class_n = line.split(" ")[1] 14 | new_file.write(os.path.join(d_path, dir_path, file_path) + " " + class_n) 15 | 16 | 17 | -------------------------------------------------------------------------------- /utils/lr_schedule.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | 3 | 4 | def inv_lr_scheduler(param_lr, optimizer, iter_num, gamma=0.0001, 5 | power=0.75, init_lr=0.001): 6 | """Decay learning rate by a factor of 0.1 every lr_decay_epoch epochs.""" 7 | lr = init_lr * (1 + gamma * iter_num) ** (- power) 8 | i = 0 9 | for param_group in optimizer.param_groups: 10 | param_group['lr'] = lr * param_lr[i] 11 | i += 1 12 | return optimizer 13 | 14 | 15 | def calc_coeff(iter_num, high=1.0, low=0.0, alpha=10.0, max_iter=10000.0): 16 | return np.float(2.0 * (high - low) / 17 | (1.0 + np.exp(- alpha * iter_num / max_iter)) - 18 | (high - low) + low) 19 | -------------------------------------------------------------------------------- /utils/copy_list_txt.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | 4 | domains =["real", "clipart", "painting", "sketch"] 5 | p1 = "/research/masaito/multisource_data/few_shot_DA_data/split_iccv/labeled_source_images_%s.txt" 6 | p2 = "/research/masaito/multisource_data/few_shot_DA_data/split_iccv/labeled_target_images_%s_3.txt" 7 | p3 = "/research/masaito/multisource_data/few_shot_DA_data/split_iccv/unlabeled_target_images_%s_3.txt" 8 | p4 = "/research/masaito/multisource_data/few_shot_DA_data/split_iccv/validation_target_images_%s_3.txt" 9 | paths = [p1, p2, p3, p4] 10 | for dom in domains: 11 | for p in paths: 12 | txt = p % dom 13 | cmd = "cp " + txt + " ../data/txt/." 14 | print(cmd) 15 | subprocess.call(cmd, shell=True) 16 | -------------------------------------------------------------------------------- /utils/copy_list_office.py: -------------------------------------------------------------------------------- 1 | import subprocess 2 | 3 | 4 | domains =["amazon", "dslr", "webcam"] 5 | p1 = "/research/masaito/office/source_images_%s.txt" 6 | p2 = "/research/masaito/office/split_iccv/labeled_target_images_%s_3.txt" 7 | p3 = "/research/masaito/office/split_iccv/unsupervised_target_images_%s_3.txt" 8 | p4 = "/research/masaito/office/split_iccv/validation_target_images_%s_3.txt" 9 | paths = [p1, p2, p3, p4] 10 | for dom in domains: 11 | for i, p in enumerate(paths): 12 | txt = p % dom 13 | if i == 0: 14 | cmd = "cp " + txt + " ../data/txt/labeled_source_images_%s.txt" % dom 15 | elif i == 2: 16 | cmd = "cp " + txt + " ../data/txt/unlabeled_target_images_%s.txt" % dom 17 | else: 18 | cmd = "cp " + txt + " ../data/txt/." 19 | 20 | print(cmd) 21 | subprocess.call(cmd, shell=True) 22 | -------------------------------------------------------------------------------- /utils/utils.py: -------------------------------------------------------------------------------- 1 | import os 2 | import torch 3 | import torch.nn as nn 4 | import shutil 5 | 6 | 7 | def weights_init(m): 8 | classname = m.__class__.__name__ 9 | if classname.find('Conv') != -1: 10 | m.weight.data.normal_(0.0, 0.1) 11 | elif classname.find('Linear') != -1: 12 | nn.init.xavier_normal_(m.weight) 13 | nn.init.zeros_(m.bias) 14 | elif classname.find('BatchNorm') != -1: 15 | m.weight.data.normal_(1.0, 0.1) 16 | m.bias.data.fill_(0) 17 | 18 | 19 | def save_checkpoint(state, is_best, checkpoint='checkpoint', 20 | filename='checkpoint.pth.tar'): 21 | filepath = os.path.join(checkpoint, filename) 22 | torch.save(state, filepath) 23 | if is_best: 24 | shutil.copyfile(filepath, os.path.join(checkpoint, 25 | 'model_best.pth.tar')) 26 | -------------------------------------------------------------------------------- /data/txt/visda/set1_labeled_target_images_sketch_3.txt: -------------------------------------------------------------------------------- 1 | truck/truck_1369993.jpg 11 2 | truck/truck_1197331.jpg 11 3 | truck/truck_395457.jpg 11 4 | train/train_169504.jpg 10 5 | train/train_173550.jpg 10 6 | train/train_169996.jpg 10 7 | bicycle/bicycle_124911.jpg 1 8 | bicycle/bicycle_129376.jpg 1 9 | bicycle/bicycle_124708.jpg 1 10 | aeroplane/aeroplane_157258.jpg 0 11 | aeroplane/aeroplane_160335.jpg 0 12 | aeroplane/aeroplane_158818.jpg 0 13 | car/car_2036422.jpg 3 14 | car/car_1773099.jpg 3 15 | car/car_356916.jpg 3 16 | bus/bus_366099.jpg 2 17 | bus/bus_168700.jpg 2 18 | bus/bus_164364.jpg 2 19 | knife/knife_1521939.jpg 5 20 | knife/knife_2103918.jpg 5 21 | knife/knife_700217.jpg 5 22 | horse/horse_53529.jpg 4 23 | horse/horse_60364.jpg 4 24 | horse/horse_56732.jpg 4 25 | person/person_1216033.jpg 7 26 | person/person_1200934.jpg 7 27 | person/person_1220386.jpg 7 28 | motorcycle/motorcycle_1790861.jpg 6 29 | motorcycle/motorcycle_148666.jpg 6 30 | motorcycle/motorcycle_148795.jpg 6 31 | skateboard/skateboard_641822.jpg 9 32 | skateboard/skateboard_639171.jpg 9 33 | skateboard/skateboard_638789.jpg 9 34 | plant/plant_1955534.jpg 8 35 | plant/plant_1955191.jpg 8 36 | plant/plant_26591.jpg 8 37 | -------------------------------------------------------------------------------- /data/txt/visda/set2_labeled_target_images_sketch_3.txt: -------------------------------------------------------------------------------- 1 | truck/truck_398610.jpg 11 2 | truck/truck_1370375.jpg 11 3 | truck/truck_1370692.jpg 11 4 | train/train_171741.jpg 10 5 | train/train_169664.jpg 10 6 | train/train_366839.jpg 10 7 | bicycle/bicycle_130144.jpg 1 8 | bicycle/bicycle_128564.jpg 1 9 | bicycle/bicycle_1335259.jpg 1 10 | aeroplane/aeroplane_159675.jpg 0 11 | aeroplane/aeroplane_1363068.jpg 0 12 | aeroplane/aeroplane_160742.jpg 0 13 | car/car_348553.jpg 3 14 | car/car_347780.jpg 3 15 | car/car_145351.jpg 3 16 | bus/bus_165809.jpg 2 17 | bus/bus_366037.jpg 2 18 | bus/bus_164541.jpg 2 19 | knife/knife_1521317.jpg 5 20 | knife/knife_698301.jpg 5 21 | knife/knife_698030.jpg 5 22 | horse/horse_55158.jpg 4 23 | horse/horse_58268.jpg 4 24 | horse/horse_57632.jpg 4 25 | person/person_1212540.jpg 7 26 | person/person_1189534.jpg 7 27 | person/person_1220394.jpg 7 28 | motorcycle/motorcycle_153561.jpg 6 29 | motorcycle/motorcycle_1793050.jpg 6 30 | motorcycle/motorcycle_1790694.jpg 6 31 | skateboard/skateboard_642913.jpg 9 32 | skateboard/skateboard_641559.jpg 9 33 | skateboard/skateboard_637848.jpg 9 34 | plant/plant_23351.jpg 8 35 | plant/plant_24078.jpg 8 36 | plant/plant_1608571.jpg 8 37 | -------------------------------------------------------------------------------- /data/txt/office_home/labeled_target_images_Art_1.txt: -------------------------------------------------------------------------------- 1 | Art/Alarm_Clock/00045.jpg 0 2 | Art/Backpack/00019.jpg 1 3 | Art/Batteries/00023.jpg 2 4 | Art/Bed/00033.jpg 3 5 | Art/Bike/00020.jpg 4 6 | Art/Bottle/00044.jpg 5 7 | Art/Bucket/00022.jpg 6 8 | Art/Calculator/00009.jpg 7 9 | Art/Calendar/00005.jpg 8 10 | Art/Candles/00038.jpg 9 11 | Art/Chair/00008.jpg 10 12 | Art/Clipboards/00016.jpg 11 13 | Art/Computer/00004.jpg 12 14 | Art/Couch/00011.jpg 13 15 | Art/Curtains/00012.jpg 14 16 | Art/Desk_Lamp/00016.jpg 15 17 | Art/Drill/00004.jpg 16 18 | Art/Eraser/00016.jpg 17 19 | Art/Exit_Sign/00016.jpg 18 20 | Art/Fan/00024.jpg 19 21 | Art/File_Cabinet/00002.jpg 20 22 | Art/Flipflops/00018.jpg 21 23 | Art/Flowers/00064.jpg 22 24 | Art/Folder/00006.jpg 23 25 | Art/Fork/00046.jpg 24 26 | Art/Glasses/00015.jpg 25 27 | Art/Hammer/00021.jpg 26 28 | Art/Helmet/00074.jpg 27 29 | Art/Kettle/00017.jpg 28 30 | Art/Keyboard/00008.jpg 29 31 | Art/Knives/00037.jpg 30 32 | Art/Lamp_Shade/00029.jpg 31 33 | Art/Laptop/00005.jpg 32 34 | Art/Marker/00004.jpg 33 35 | Art/Monitor/00017.jpg 34 36 | Art/Mop/00004.jpg 35 37 | Art/Mouse/00002.jpg 36 38 | Art/Mug/00033.jpg 37 39 | Art/Notebook/00016.jpg 38 40 | Art/Oven/00016.jpg 39 41 | Art/Pan/00018.jpg 40 42 | Art/Paper_Clip/00016.jpg 41 43 | Art/Pen/00012.jpg 42 44 | Art/Pencil/00005.jpg 43 45 | Art/Postit_Notes/00017.jpg 44 46 | Art/Printer/00009.jpg 45 47 | Art/Push_Pin/00024.jpg 46 48 | Art/Radio/00036.jpg 47 49 | Art/Refrigerator/00022.jpg 48 50 | Art/Ruler/00010.jpg 49 51 | Art/Scissors/00019.jpg 50 52 | Art/Screwdriver/00007.jpg 51 53 | Art/Shelf/00008.jpg 52 54 | Art/Sink/00003.jpg 53 55 | Art/Sneakers/00017.jpg 54 56 | Art/Soda/00001.jpg 55 57 | Art/Speaker/00005.jpg 56 58 | Art/Spoon/00045.jpg 57 59 | Art/Table/00005.jpg 58 60 | Art/Telephone/00020.jpg 59 61 | Art/ToothBrush/00026.jpg 60 62 | Art/Toys/00017.jpg 61 63 | Art/Trash_Can/00019.jpg 62 64 | Art/TV/00010.jpg 63 65 | Art/Webcam/00016.jpg 64 66 | -------------------------------------------------------------------------------- /data/txt/office_home/labeled_target_images_Real_1.txt: -------------------------------------------------------------------------------- 1 | Real/Alarm_Clock/00085.jpg 0 2 | Real/Backpack/00062.jpg 1 3 | Real/Batteries/00041.jpg 2 4 | Real/Bed/00055.jpg 3 5 | Real/Bike/00056.jpg 4 6 | Real/Bottle/00078.jpg 5 7 | Real/Bucket/00064.jpg 6 8 | Real/Calculator/00044.jpg 7 9 | Real/Calendar/00064.jpg 8 10 | Real/Candles/00097.jpg 9 11 | Real/Chair/00069.jpg 10 12 | Real/Clipboards/00040.jpg 11 13 | Real/Computer/00004.jpg 12 14 | Real/Couch/00037.jpg 13 15 | Real/Curtains/00001.jpg 14 16 | Real/Desk_Lamp/00003.jpg 15 17 | Real/Drill/00038.jpg 16 18 | Real/Eraser/00040.jpg 17 19 | Real/Exit_Sign/00014.jpg 18 20 | Real/Fan/00050.jpg 19 21 | Real/File_Cabinet/00032.jpg 20 22 | Real/Flipflops/00077.jpg 21 23 | Real/Flowers/00028.jpg 22 24 | Real/Folder/00020.jpg 23 25 | Real/Fork/00011.jpg 24 26 | Real/Glasses/00031.jpg 25 27 | Real/Hammer/00022.jpg 26 28 | Real/Helmet/00034.jpg 27 29 | Real/Kettle/00055.jpg 28 30 | Real/Keyboard/00064.jpg 29 31 | Real/Knives/00010.jpg 30 32 | Real/Lamp_Shade/00026.jpg 31 33 | Real/Laptop/00051.jpg 32 34 | Real/Marker/00009.jpg 33 35 | Real/Monitor/00055.jpg 34 36 | Real/Mop/00044.jpg 35 37 | Real/Mouse/00028.jpg 36 38 | Real/Mug/00042.jpg 37 39 | Real/Notebook/00013.jpg 38 40 | Real/Oven/00036.jpg 39 41 | Real/Pan/00011.jpg 40 42 | Real/Paper_Clip/00034.jpg 41 43 | Real/Pen/00064.jpg 42 44 | Real/Pencil/00046.jpg 43 45 | Real/Postit_Notes/00064.jpg 44 46 | Real/Printer/00027.jpg 45 47 | Real/Push_Pin/00034.jpg 46 48 | Real/Radio/00003.jpg 47 49 | Real/Refrigerator/00039.jpg 48 50 | Real/Ruler/00035.jpg 49 51 | Real/Scissors/00036.jpg 50 52 | Real/Screwdriver/00038.jpg 51 53 | Real/Shelf/00018.jpg 52 54 | Real/Sink/00063.jpg 53 55 | Real/Sneakers/00072.jpg 54 56 | Real/Soda/00052.jpg 55 57 | Real/Speaker/00014.jpg 56 58 | Real/Spoon/00019.jpg 57 59 | Real/Table/00025.jpg 58 60 | Real/Telephone/00041.jpg 59 61 | Real/ToothBrush/00051.jpg 60 62 | Real/Toys/00002.jpg 61 63 | Real/Trash_Can/00077.jpg 62 64 | Real/TV/00015.jpg 63 65 | Real/Webcam/00033.jpg 64 66 | -------------------------------------------------------------------------------- /data/txt/office_home/labeled_target_images_Clipart_1.txt: -------------------------------------------------------------------------------- 1 | Clipart/Alarm_Clock/00032.jpg 0 2 | Clipart/Backpack/00052.jpg 1 3 | Clipart/Batteries/00043.jpg 2 4 | Clipart/Bed/00073.jpg 3 5 | Clipart/Bike/00023.jpg 4 6 | Clipart/Bottle/00059.jpg 5 7 | Clipart/Bucket/00006.jpg 6 8 | Clipart/Calculator/00007.jpg 7 9 | Clipart/Calendar/00009.jpg 8 10 | Clipart/Candles/00004.jpg 9 11 | Clipart/Chair/00060.jpg 10 12 | Clipart/Clipboards/00033.jpg 11 13 | Clipart/Computer/00036.jpg 12 14 | Clipart/Couch/00063.jpg 13 15 | Clipart/Curtains/00032.jpg 14 16 | Clipart/Desk_Lamp/00004.jpg 15 17 | Clipart/Drill/00035.jpg 16 18 | Clipart/Eraser/00015.jpg 17 19 | Clipart/Exit_Sign/00032.jpg 18 20 | Clipart/Fan/00027.jpg 19 21 | Clipart/File_Cabinet/00030.jpg 20 22 | Clipart/Flipflops/00012.jpg 21 23 | Clipart/Flowers/00039.jpg 22 24 | Clipart/Folder/00095.jpg 23 25 | Clipart/Fork/00018.jpg 24 26 | Clipart/Glasses/00014.jpg 25 27 | Clipart/Hammer/00098.jpg 26 28 | Clipart/Helmet/00051.jpg 27 29 | Clipart/Kettle/00027.jpg 28 30 | Clipart/Keyboard/00053.jpg 29 31 | Clipart/Knives/00037.jpg 30 32 | Clipart/Lamp_Shade/00031.jpg 31 33 | Clipart/Laptop/00061.jpg 32 34 | Clipart/Marker/00065.jpg 33 35 | Clipart/Monitor/00089.jpg 34 36 | Clipart/Mop/00032.jpg 35 37 | Clipart/Mouse/00044.jpg 36 38 | Clipart/Mug/00088.jpg 37 39 | Clipart/Notebook/00065.jpg 38 40 | Clipart/Oven/00008.jpg 39 41 | Clipart/Pan/00035.jpg 40 42 | Clipart/Paper_Clip/00015.jpg 41 43 | Clipart/Pen/00004.jpg 42 44 | Clipart/Pencil/00072.jpg 43 45 | Clipart/Postit_Notes/00002.jpg 44 46 | Clipart/Printer/00056.jpg 45 47 | Clipart/Push_Pin/00025.jpg 46 48 | Clipart/Radio/00030.jpg 47 49 | Clipart/Refrigerator/00017.jpg 48 50 | Clipart/Ruler/00050.jpg 49 51 | Clipart/Scissors/00073.jpg 50 52 | Clipart/Screwdriver/00062.jpg 51 53 | Clipart/Shelf/00021.jpg 52 54 | Clipart/Sink/00023.jpg 53 55 | Clipart/Sneakers/00019.jpg 54 56 | Clipart/Soda/00029.jpg 55 57 | Clipart/Speaker/00037.jpg 56 58 | Clipart/Spoon/00046.jpg 57 59 | Clipart/Table/00041.jpg 58 60 | Clipart/Telephone/00048.jpg 59 61 | Clipart/ToothBrush/00007.jpg 60 62 | Clipart/Toys/00021.jpg 61 63 | Clipart/Trash_Can/00003.jpg 62 64 | Clipart/TV/00012.jpg 63 65 | Clipart/Webcam/00006.jpg 64 66 | -------------------------------------------------------------------------------- /data/txt/office_home/labeled_target_images_Product_1.txt: -------------------------------------------------------------------------------- 1 | Product/Alarm_Clock/00003.jpg 0 2 | Product/Backpack/00095.jpg 1 3 | Product/Batteries/00050.jpg 2 4 | Product/Bed/00008.jpg 3 5 | Product/Bike/00004.jpg 4 6 | Product/Bottle/00028.jpg 5 7 | Product/Bucket/00019.jpg 6 8 | Product/Calculator/00014.jpg 7 9 | Product/Calendar/00067.jpg 8 10 | Product/Candles/00052.jpg 9 11 | Product/Chair/00038.jpg 10 12 | Product/Clipboards/00049.jpg 11 13 | Product/Computer/00081.jpg 12 14 | Product/Couch/00039.jpg 13 15 | Product/Curtains/00058.jpg 14 16 | Product/Desk_Lamp/00036.jpg 15 17 | Product/Drill/00063.jpg 16 18 | Product/Eraser/00027.jpg 17 19 | Product/Exit_Sign/00004.jpg 18 20 | Product/Fan/00045.jpg 19 21 | Product/File_Cabinet/00058.jpg 20 22 | Product/Flipflops/00039.jpg 21 23 | Product/Flowers/00079.jpg 22 24 | Product/Folder/00034.jpg 23 25 | Product/Fork/00022.jpg 24 26 | Product/Glasses/00053.jpg 25 27 | Product/Hammer/00005.jpg 26 28 | Product/Helmet/00046.jpg 27 29 | Product/Kettle/00062.jpg 28 30 | Product/Keyboard/00033.jpg 29 31 | Product/Knives/00039.jpg 30 32 | Product/Lamp_Shade/00017.jpg 31 33 | Product/Laptop/00048.jpg 32 34 | Product/Marker/00003.jpg 33 35 | Product/Monitor/00013.jpg 34 36 | Product/Mop/00036.jpg 35 37 | Product/Mouse/00023.jpg 36 38 | Product/Mug/00039.jpg 37 39 | Product/Notebook/00010.jpg 38 40 | Product/Oven/00016.jpg 39 41 | Product/Pan/00053.jpg 40 42 | Product/Paper_Clip/00002.jpg 41 43 | Product/Pen/00048.jpg 42 44 | Product/Pencil/00002.jpg 43 45 | Product/Postit_Notes/00001.jpg 44 46 | Product/Printer/00018.jpg 45 47 | Product/Push_Pin/00039.jpg 46 48 | Product/Radio/00011.jpg 47 49 | Product/Refrigerator/00024.jpg 48 50 | Product/Ruler/00001.jpg 49 51 | Product/Scissors/00072.jpg 50 52 | Product/Screwdriver/00015.jpg 51 53 | Product/Shelf/00037.jpg 52 54 | Product/Sink/00024.jpg 53 55 | Product/Sneakers/00061.jpg 54 56 | Product/Soda/00041.jpg 55 57 | Product/Speaker/00071.jpg 56 58 | Product/Spoon/00038.jpg 57 59 | Product/Table/00043.jpg 58 60 | Product/Telephone/00011.jpg 59 61 | Product/ToothBrush/00002.jpg 60 62 | Product/Toys/00037.jpg 61 63 | Product/Trash_Can/00090.jpg 62 64 | Product/TV/00029.jpg 63 65 | Product/Webcam/00064.jpg 64 66 | -------------------------------------------------------------------------------- /sample/eval_results.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import numpy as np 3 | 4 | 5 | def return_label_list(file): 6 | tmp = open(file, "r") 7 | lines = tmp.readlines() 8 | labels = [int(line.strip().split(" ")[1]) for line in lines] 9 | file_name = [line.strip().split(" ")[0] for line in lines] 10 | return labels, file_name 11 | 12 | 13 | def return_label2cat(file): 14 | tmp = open(file, "r") 15 | lines = tmp.readlines() 16 | dict = {} 17 | for line in lines: 18 | dict[int(line.strip().split(" ")[0])] = line.strip().split(" ")[1] 19 | return dict 20 | 21 | 22 | def check_file_name(file1, file2): 23 | for i, fil_1 in enumerate(file1): 24 | fil_2 = file2[i] 25 | if fil_1 != fil_2: 26 | return False 27 | return True 28 | 29 | 30 | def acc_perclass(gt, submit, label2cat_file, output="sample.txt"): 31 | gt_labels, file_gt = return_label_list(gt) 32 | submit_labels, file_sb = return_label_list(submit) 33 | label2cat = return_label2cat(label2cat_file) 34 | try: 35 | assert len(gt_labels) == len(submit_labels) 36 | except: 37 | print('Number of submitted files and GT is different!') 38 | try: 39 | assert check_file_name(file_gt, file_sb) 40 | except: 41 | print('Submitted files do not correpond to GT files!') 42 | result_np = np.zeros((max(gt_labels) + 1, max(gt_labels) + 1)) 43 | for i, gt in enumerate(gt_labels): 44 | submit_l = submit_labels[i] 45 | result_np[gt, submit_l] += 1 46 | mean_acc_all = np.sum(np.diag(result_np)) / len(submit_labels) * 100.0 47 | acc_for_classes = np.diag(result_np) / np.sum(result_np, axis=1) 48 | mean_acc_classes = np.mean(acc_for_classes) * 100.0 49 | print("ACC All %f ACC Averaged over Classes %f" % (mean_acc_all, mean_acc_classes)) 50 | with open(output, "w") as out_per_class: 51 | for label, acc in enumerate(acc_for_classes): 52 | cat_name = label2cat[label] 53 | out_per_class.write("%s: %f\n" % (cat_name, acc)) 54 | 55 | 56 | gt_file = sys.argv[1] 57 | submit_file = sys.argv[2] 58 | label2category = sys.argv[3] 59 | acc_perclass(gt_file, submit_file, label2category) 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ECACL: A Holistic Framework for Semi-Supervised Domain Adaptation 2 | 3 | This repository includes the PyTorch implementation of ECACL introduced in the following paper: 4 | 5 | [Kai Li](http://kailigo.github.io/), [Chang Liu](https://sites.google.com/view/cliu5/home), [Handong Zhao](https://hdzhao.github.io/) [Yulun Zhang](http://yulunzhang.com/), and [Yun Fu](http://www1.ece.neu.edu/~yunfu/), "ECACL: A Holistic Framework for Semi-Supervised Domain Adaptation", [ICCV 2021](https://openaccess.thecvf.com/content/ICCV2021/papers/Li_ECACL_A_Holistic_Framework_for_Semi-Supervised_Domain_Adaptation_ICCV_2021_paper.pdf) 6 | 7 | ## Install 8 | 9 | `pip install -r requirements.txt` 10 | 11 | The code is written for Pytorch 0.4.1, but should work for other version 12 | with some modifications. 13 | 14 | ## Data preparation 15 | 16 | For all the datasets, we provide the splits in './data/txt' 17 | 18 | ### DomainNet 19 | 20 | To get data, run 21 | 22 | `sh download_data.sh` 23 | 24 | The images will be stored in the following way. 25 | 26 | `./data/multi/real/category_name` 27 | 28 | `./data/multi/sketch/category_name` 29 | 30 | ### Office-home 31 | 32 | Download the dataset and put it under the './data' folder as 33 | 34 | `./data/office_home/` 35 | 36 | ### VisDA2017 37 | 38 | Download the dataset and put it under the './data' folder as 39 | 40 | `./data/visda/` 41 | 42 | ## Training 43 | 44 | The following scripts reproduce our results for the adaptation result between Real and Sketch domains from the DomainNet dataset under the 3-shot settings, with AlexNet and ResNet-34 as the backbone respectively. Other results can be obtained by changing the parameter '--source' and '--target' and '--trg_shots', which specify the source domain, target domain, and number of labeled samples from the target, respectively. 45 | 46 | `CUDA_VISIBLE_DEVICES=0 python main.py --beta 1.0 --alpha 0.1 --threshold 0.8 --align_type proto --log_file r2s_proto_resnet_num3_semi_kld_hard --kld --labeled_hard --trg_shots 3 --num 3 --net resnet34 --source real --target sketch` 47 | 48 | `CUDA_VISIBLE_DEVICES=0 python main.py --beta 1.0 --alpha 0.1 --threshold 0.8 --align_type proto --log_file r2s_proto_alex_num3_semi_kld_hard --kld --labeled_hard --trg_shots 3 --num 3 --net alexnet --source real --target sketch` 49 | 50 | 51 | ## Test 52 | 53 | ### Pretrained models 54 | 55 | Our trained models for the adaptation from the real domain to the sketch domain from the DomainNet dataset are available in [GoogleDrive](https://drive.google.com/drive/folders/1bOBwD4ilX4p3eFxO8Zh8AI4XU0DrcWw5?usp=sharing). 56 | 57 | Within the folder, We provide the models with the AlexNet and ResNet-34 as the backbone for the 3-shot settings. 58 | 59 | Download the models and save them in the './pretrained' folder. 60 | 61 | ### Evaluation 62 | 63 | Run the following scripts and get the evaluation results: 64 | 65 | `CUDA_VISIBLE_DEVICES=0 python eval.py --dataset multi --source real --target sketch --checkpath pretrained --net resnet34 --num 3` 66 | 67 | `CUDA_VISIBLE_DEVICES=0 python eval.py --dataset multi --source real --target sketch --checkpath pretrained --net alexnet --num 3` 68 | 69 | 70 | 71 | 72 | ## Citation 73 | 74 | 75 | ``` 76 | @inproceedings{li2021ECACL, 77 | title={ECACL: A Holistic Framework for Semi-Supervised Domain Adaptation}, 78 | author={Li, Kai and Liu, Chang and Zhao, Handong and Zhang, Yulun and Fu, Yun}, 79 | booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision}, 80 | pages={}, 81 | year={2021} 82 | } 83 | 84 | 85 | ``` 86 | 87 | 88 | ## Acknowledgment 89 | This code is developed based on the implementation of [MME](https://github.com/VisionLearningGroup/SSDA_MME). 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /utils/mmd.py: -------------------------------------------------------------------------------- 1 | # Unofficial pytorch implementation for Contrastive Adaptation Network for Unsupervised Domain Adaptation 2 | # https://arxiv.org/pdf/1901.00976.pdf 3 | 4 | import torch 5 | from torch import nn 6 | from torch.autograd import Variable 7 | import torch.nn.functional as F 8 | import numpy as np 9 | # from lib.config import cfg 10 | 11 | class MMDLoss(nn.Module): 12 | def __init__(self): 13 | super(MMDLoss, self).__init__() 14 | self.kernel_mul = 2.0 15 | # cfg.LOSSES.KERNEL_MUL 16 | self.kernel_num = 5 17 | # cfg.LOSSES.KERNEL_NUM 18 | self.fix_sigma = None 19 | 20 | def guassian_kernel(self, x, y, kernel_mul=2.0, kernel_num=5, fix_sigma=None): 21 | x_size = x.size(0) 22 | y_size = y.size(0) 23 | dim = x.size(1) 24 | n_samples = x_size + y_size 25 | x = x.unsqueeze(1) # (x_size, 1, dim) 26 | y = y.unsqueeze(0) # (1, y_size, dim) 27 | tiled_x = x.expand(x_size, y_size, dim) 28 | tiled_y = y.expand(x_size, y_size, dim) 29 | L2_distance = ((tiled_x-tiled_y)**2).sum(2) 30 | if fix_sigma: 31 | bandwidth = fix_sigma 32 | else: 33 | bandwidth = torch.sum(L2_distance.data) / (n_samples**2-n_samples) 34 | bandwidth /= kernel_mul ** (kernel_num // 2) 35 | bandwidth_list = [bandwidth * (kernel_mul**i) + 1e-14 for i in range(kernel_num)] 36 | kernel_val = [torch.exp(-L2_distance / bandwidth_temp) for bandwidth_temp in bandwidth_list] 37 | return sum(kernel_val) 38 | 39 | def compute_mmd(self, x, y): 40 | x_kernel = self.guassian_kernel(x, x, self.kernel_mul, self.kernel_num, self.fix_sigma) 41 | y_kernel = self.guassian_kernel(y, y, self.kernel_mul, self.kernel_num, self.fix_sigma) 42 | xy_kernel = self.guassian_kernel(x, y, self.kernel_mul, self.kernel_num, self.fix_sigma) 43 | mmd = x_kernel.mean() + y_kernel.mean() - 2 * xy_kernel.mean() 44 | return mmd 45 | 46 | def forward(self, x, y, x_labels, y_labels): 47 | if y_labels is None: 48 | mmd = self.compute_mmd(x, y) 49 | return mmd, ('03. mmd loss: ', mmd.data.cpu().numpy()) 50 | else: 51 | labels = list(x_labels.data.cpu().numpy()) 52 | labels = list(set(labels)) 53 | pos_num = len(labels) 54 | neg_num = len(labels) * (len(labels) - 1) 55 | 56 | x_c = [] 57 | y_c = [] 58 | n_labels = len(labels) 59 | for label in labels: 60 | x_c.append(x[x_labels == label]) 61 | y_c.append(y[y_labels == label]) 62 | 63 | xk_c = torch.zeros(n_labels).cuda() 64 | yk_c = torch.zeros(n_labels).cuda() 65 | xyk_c = torch.zeros(n_labels, n_labels).cuda() 66 | for i in range(n_labels): 67 | x_kernel = self.guassian_kernel(x_c[i], x_c[i], self.kernel_mul, self.kernel_num, self.fix_sigma) 68 | xk_c[i] = x_kernel.mean() 69 | 70 | y_kernel = self.guassian_kernel(y_c[i], y_c[i], self.kernel_mul, self.kernel_num, self.fix_sigma) 71 | yk_c[i] = y_kernel.mean() 72 | 73 | for j in range(n_labels): 74 | xy_kernel = self.guassian_kernel(x_c[i], y_c[j], self.kernel_mul, self.kernel_num, self.fix_sigma) 75 | xyk_c[i, j] = xy_kernel.mean() 76 | 77 | xk_c_sum = xk_c.sum() 78 | yk_c_sum = yk_c.sum() 79 | xyk_c_diag = torch.eye(n_labels, n_labels).cuda() * xyk_c 80 | xyk_c_antidiag = (1 - torch.eye(n_labels, n_labels).cuda()) * xyk_c 81 | 82 | mmd = (xk_c_sum + yk_c_sum - 2 * xyk_c_diag.sum()) / pos_num 83 | mmd -= cfg.LOSSES.MMD_NEG_WEIGHT * ( (n_labels - 1) * (xk_c_sum + yk_c_sum) - 2 * xyk_c_antidiag.sum() ) / neg_num 84 | 85 | return mmd, ('03. mmd loss: ', mmd.data.cpu().numpy()) -------------------------------------------------------------------------------- /model/LeNetPlus.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn as nn 3 | import torch.nn.functional as F 4 | from pdb import set_trace as breakpoint 5 | 6 | 7 | 8 | 9 | class LeNetPlus(nn.Module): 10 | def __init__(self): 11 | super(LeNetPlus, self).__init__() 12 | self.conv1 = nn.Conv2d(3, 32, kernel_size=3, stride=1, padding=2) 13 | self.conv2 = nn.Conv2d(32, 32, kernel_size=3, stride=1, padding=2) 14 | self.conv3 = nn.Conv2d(32, 64, kernel_size=3, stride=1, padding=2) 15 | self.conv4 = nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=2) 16 | self.conv5 = nn.Conv2d(64, 128, kernel_size=3, stride=1, padding=2) 17 | self.conv6 = nn.Conv2d(128, 128, kernel_size=3, stride=1, padding=2) 18 | 19 | self.fc1 = nn.Linear(6272, 512) 20 | self.fc2 = nn.Linear(512, 10) 21 | 22 | def forward(self, x): 23 | 24 | x = F.instance_norm(x) 25 | x = F.leaky_relu(self.conv1(x), 0.2) 26 | x = F.leaky_relu(self.conv2(x), 0.2) 27 | x = F.max_pool2d(x, kernel_size=2) 28 | 29 | # breakpoint() 30 | x = F.leaky_relu(self.conv3(x), 0.2) 31 | x = F.leaky_relu(self.conv4(x), 0.2) 32 | x = F.max_pool2d(x, kernel_size=2, ) 33 | x = F.dropout(x) 34 | 35 | x = F.leaky_relu(self.conv5(x), 0.2) 36 | x = F.leaky_relu(self.conv6(x), 0.2) 37 | x = F.max_pool2d(x, kernel_size=2) 38 | x = F.dropout(x) 39 | 40 | # breakpoint() 41 | 42 | x = x.view(x.size(0), -1) 43 | x = self.fc1(x) 44 | 45 | # x = F.relu(x) 46 | # x = F.leaky_relu(x, 0.2) 47 | 48 | prop = self.fc2(x) 49 | 50 | return prop, x 51 | 52 | 53 | 54 | class LeNetPlus_Triplet(nn.Module): 55 | def __init__(self): 56 | super(LeNetPlus_Triplet, self).__init__() 57 | self.conv1 = nn.Conv2d(3, 32, kernel_size=3, stride=1, padding=2) 58 | self.conv2 = nn.Conv2d(32, 32, kernel_size=3, stride=1, padding=2) 59 | self.conv3 = nn.Conv2d(32, 64, kernel_size=3, stride=1, padding=2) 60 | self.conv4 = nn.Conv2d(64, 64, kernel_size=3, stride=1, padding=2) 61 | self.conv5 = nn.Conv2d(64, 128, kernel_size=3, stride=1, padding=2) 62 | self.conv6 = nn.Conv2d(128, 128, kernel_size=3, stride=1, padding=2) 63 | 64 | self.fc1 = nn.Linear(6272, 512) 65 | # self.fc2 = nn.Linear(512, 10) 66 | 67 | def forward(self, x): 68 | 69 | 70 | x = F.instance_norm(x) 71 | x = F.leaky_relu(self.conv1(x), 0.2) 72 | x = F.leaky_relu(self.conv2(x), 0.2) 73 | x = F.max_pool2d(x, kernel_size=2) 74 | 75 | x = F.leaky_relu(self.conv3(x), 0.2) 76 | x = F.leaky_relu(self.conv4(x), 0.2) 77 | x = F.max_pool2d(x, kernel_size=2, ) 78 | x = F.dropout(x) 79 | 80 | x = F.leaky_relu(self.conv5(x), 0.2) 81 | x = F.leaky_relu(self.conv6(x), 0.2) 82 | x = F.max_pool2d(x, kernel_size=2) 83 | x = F.dropout(x) 84 | 85 | x = x.view(x.size(0), -1) 86 | x = self.fc1(x) 87 | # x = F.relu(x) 88 | # prop = self.fc2(x) 89 | 90 | return x 91 | 92 | 93 | 94 | class Predictor(nn.Module): 95 | def __init__(self, inc=512, num_class=10): 96 | super(Predictor, self).__init__() 97 | self.fc = nn.Linear(inc, num_class) 98 | 99 | def forward(self, x): 100 | x_out = self.fc(x) 101 | return x_out 102 | 103 | 104 | 105 | class Instance_Classifier(nn.Module): 106 | def __init__(self, inc, hidden_dim): 107 | super(Instance_Classifier, self).__init__() 108 | self.dc_ip1 = nn.Linear(inc, hidden_dim) 109 | self.dc_relu1 = nn.ReLU() 110 | self.dc_drop1 = nn.Dropout(p=0.5) 111 | self.clssifer = nn.Linear(hidden_dim, 2) 112 | 113 | def forward(self, x): 114 | x=self.dc_drop1(self.dc_relu1(self.dc_ip1(x))) 115 | x=self.clssifer(x) 116 | return x 117 | -------------------------------------------------------------------------------- /eval.py: -------------------------------------------------------------------------------- 1 | from __future__ import print_function 2 | 3 | 4 | import argparse 5 | import os 6 | import torch 7 | from model.resnet import resnet34, resnet50 8 | from torch.autograd import Variable 9 | from tqdm import tqdm 10 | from model.basenet import AlexNetBase, VGGBase, Predictor, Predictor_deep 11 | from utils.return_dataset import return_dataset_test 12 | 13 | # Training settings 14 | parser = argparse.ArgumentParser(description='Visda Classification') 15 | parser.add_argument('--T', type=float, default=0.05, metavar='T', 16 | help='temperature (default: 0.05)') 17 | parser.add_argument('--step', type=int, default=1000, metavar='step', 18 | help='loading step') 19 | parser.add_argument('--checkpath', type=str, default='./save_model_ssda', 20 | help='dir to save checkpoint') 21 | 22 | parser.add_argument('--num', type=int, default=3, 23 | help='number of labeled examples in the target') 24 | 25 | # parser.add_argument('--method', type=str, default='MME', 26 | # choices=['S+T', 'ENT', 'MME'], 27 | # help='MME is proposed method, ENT is entropy minimization,' 28 | # 'S+T is training only on labeled examples') 29 | parser.add_argument('--output', type=str, default='./output.txt', 30 | help='path to store result file') 31 | parser.add_argument('--net', type=str, default='resnet34', metavar='B', 32 | help='which network ') 33 | parser.add_argument('--source', type=str, default='real', metavar='B', 34 | help='board dir') 35 | parser.add_argument('--target', type=str, default='sketch', metavar='B', 36 | help='board dir') 37 | parser.add_argument('--dataset', type=str, default='multi_all', 38 | choices=['multi', 'office', 'office_home', 'visda'], 39 | help='the name of dataset, multi is large scale dataset') 40 | args = parser.parse_args() 41 | 42 | # print('dataset %s source %s target %s network %s' % 43 | # (args.dataset, args.source, args.target, args.net)) 44 | 45 | target_loader_unl, class_list = return_dataset_test(args) 46 | use_gpu = torch.cuda.is_available() 47 | 48 | if args.net == 'resnet34': 49 | G = resnet34() 50 | inc = 512 51 | elif args.net == 'resnet50': 52 | G = resnet50() 53 | inc = 2048 54 | elif args.net == "alexnet": 55 | G = AlexNetBase() 56 | inc = 4096 57 | elif args.net == "vgg": 58 | G = VGGBase() 59 | inc = 4096 60 | else: 61 | raise ValueError('Model cannot be recognized.') 62 | 63 | 64 | if "resnet" in args.net: 65 | F1 = Predictor_deep(num_class=len(class_list), 66 | inc=inc) 67 | else: 68 | F1 = Predictor(num_class=len(class_list), inc=inc, temp=args.T) 69 | G.cuda() 70 | F1.cuda() 71 | 72 | 73 | G.load_state_dict(torch.load(os.path.join(args.checkpath, "G_{}_to_{}_{}.pth.tar".format(args.source, args.target, args.net)))) 74 | F1.load_state_dict(torch.load(os.path.join(args.checkpath, "F1_{}_to_{}_{}.pth.tar".format(args.source, args.target, args.net)))) 75 | 76 | 77 | 78 | 79 | im_data_t = torch.FloatTensor(1) 80 | gt_labels_t = torch.LongTensor(1) 81 | 82 | im_data_t = im_data_t.cuda() 83 | gt_labels_t = gt_labels_t.cuda() 84 | 85 | im_data_t = Variable(im_data_t) 86 | gt_labels_t = Variable(gt_labels_t) 87 | if os.path.exists(args.checkpath) == False: 88 | os.mkdir(args.checkpath) 89 | 90 | 91 | def eval(loader, output_file="output.txt"): 92 | G.eval() 93 | F1.eval() 94 | size = 0 95 | correct = 0 96 | # with open(output_file, "w") as f: 97 | with torch.no_grad(): 98 | for batch_idx, data_t in tqdm(enumerate(loader)): 99 | im_data_t.data.resize_(data_t[0].size()).copy_(data_t[0]) 100 | gt_labels_t.data.resize_(data_t[1].size()).copy_(data_t[1]) 101 | paths = data_t[2] 102 | feat = G(im_data_t) 103 | output1 = F1(feat) 104 | size += im_data_t.size(0) 105 | pred1 = output1.data.max(1)[1] 106 | # for i, path in enumerate(paths): 107 | # f.write("%s %d\n" % (path, pred1[i])) 108 | 109 | correct += pred1.eq(gt_labels_t.data).cpu().sum() 110 | # test_loss += criterion(output1, gt_labels_t) / len(loader) 111 | 112 | print('\n Accuracy: {}/{} F1 ({:.4f}%)\n'.format(correct, size, 113 | 100. * float(correct) / size)) 114 | 115 | # return test_loss.data, 100. * float(correct) / size 116 | 117 | eval(target_loader_unl) 118 | -------------------------------------------------------------------------------- /data/txt/multi/labeled_target_images_real_1.txt: -------------------------------------------------------------------------------- 1 | real/aircraft_carrier/real_001_000200.jpg 0 2 | real/alarm_clock/real_003_000456.jpg 1 3 | real/ant/real_007_000269.jpg 2 4 | real/anvil/real_008_000016.jpg 3 5 | real/asparagus/real_011_000496.jpg 4 6 | real/axe/real_012_000239.jpg 5 7 | real/banana/real_014_000024.jpg 6 8 | real/basket/real_019_000440.jpg 7 9 | real/bathtub/real_022_000111.jpg 8 10 | real/bear/real_024_000425.jpg 9 11 | real/bee/real_027_000300.jpg 10 12 | real/bird/real_032_000316.jpg 11 13 | real/blackberry/real_034_000189.jpg 12 14 | real/blueberry/real_035_000655.jpg 13 15 | real/bottlecap/real_038_000311.jpg 14 16 | real/broccoli/real_044_000251.jpg 15 17 | real/bus/real_048_000524.jpg 16 18 | real/butterfly/real_050_000154.jpg 17 19 | real/cactus/real_051_000152.jpg 18 20 | real/cake/real_052_000185.jpg 19 21 | real/calculator/real_053_000268.jpg 20 22 | real/camel/real_055_000344.jpg 21 23 | real/camera/real_056_000252.jpg 22 24 | real/candle/real_059_000511.jpg 23 25 | real/cannon/real_060_000247.jpg 24 26 | real/canoe/real_061_000232.jpg 25 27 | real/carrot/real_063_000028.jpg 26 28 | real/castle/real_064_000589.jpg 27 29 | real/cat/real_065_000767.jpg 28 30 | real/ceiling_fan/real_066_000069.jpg 29 31 | real/cello/real_067_000044.jpg 30 32 | real/cell_phone/real_068_000134.jpg 31 33 | real/chair/real_069_000214.jpg 32 34 | real/chandelier/real_070_000044.jpg 33 35 | real/coffee_cup/real_076_000440.jpg 34 36 | real/compass/real_077_000005.jpg 35 37 | real/computer/real_078_000209.jpg 36 38 | real/cow/real_082_000463.jpg 37 39 | real/crab/real_083_000352.jpg 38 40 | real/crocodile/real_085_000297.jpg 39 41 | real/cruise_ship/real_087_000156.jpg 40 42 | real/dog/real_092_000208.jpg 41 43 | real/dolphin/real_093_000463.jpg 42 44 | real/dragon/real_096_000214.jpg 43 45 | real/drums/real_099_000092.jpg 44 46 | real/duck/real_100_000251.jpg 45 47 | real/dumbbell/real_101_000459.jpg 46 48 | real/elephant/real_104_000017.jpg 47 49 | real/eyeglasses/real_108_000272.jpg 48 50 | real/feather/real_111_000061.jpg 49 51 | real/fence/real_112_000080.jpg 50 52 | real/fish/real_117_000375.jpg 51 53 | real/flamingo/real_118_000337.jpg 52 54 | real/flower/real_122_000021.jpg 53 55 | real/foot/real_124_000300.jpg 54 56 | real/fork/real_125_000191.jpg 55 57 | real/frog/real_126_000227.jpg 56 58 | real/giraffe/real_130_000246.jpg 57 59 | real/goatee/real_131_000255.jpg 58 60 | real/grapes/real_133_000545.jpg 59 61 | real/guitar/real_135_000044.jpg 60 62 | real/hammer/real_137_000250.jpg 61 63 | real/helicopter/real_143_000480.jpg 62 64 | real/helmet/real_144_000019.jpg 63 65 | real/horse/real_148_000068.jpg 64 66 | real/kangaroo/real_160_000357.jpg 65 67 | real/lantern/real_166_000304.jpg 66 68 | real/laptop/real_167_000267.jpg 67 69 | real/leaf/real_168_000132.jpg 68 70 | real/lion/real_175_000073.jpg 69 71 | real/lipstick/real_176_000184.jpg 70 72 | real/lobster/real_177_000036.jpg 71 73 | real/microphone/real_185_000443.jpg 72 74 | real/monkey/real_187_000205.jpg 73 75 | real/mosquito/real_189_000473.jpg 74 76 | real/mouse/real_192_000131.jpg 75 77 | real/mug/real_195_000182.jpg 76 78 | real/mushroom/real_196_000452.jpg 77 79 | real/onion/real_203_000574.jpg 78 80 | real/panda/real_209_000009.jpg 79 81 | real/peanut/real_215_000281.jpg 80 82 | real/pear/real_216_000402.jpg 81 83 | real/peas/real_217_000097.jpg 82 84 | real/pencil/real_218_000153.jpg 83 85 | real/penguin/real_219_000567.jpg 84 86 | real/pig/real_223_000158.jpg 85 87 | real/pillow/real_224_000491.jpg 86 88 | real/pineapple/real_225_000300.jpg 87 89 | real/potato/real_233_000233.jpg 88 90 | real/power_outlet/real_234_000457.jpg 89 91 | real/purse/real_235_000479.jpg 90 92 | real/rabbit/real_236_000043.jpg 91 93 | real/raccoon/real_237_000646.jpg 92 94 | real/rhinoceros/real_243_000011.jpg 93 95 | real/rifle/real_244_000256.jpg 94 96 | real/saxophone/real_251_000374.jpg 95 97 | real/screwdriver/real_255_000373.jpg 96 98 | real/sea_turtle/real_256_000591.jpg 97 99 | real/see_saw/real_257_000125.jpg 98 100 | real/sheep/real_259_000462.jpg 99 101 | real/shoe/real_260_000411.jpg 100 102 | real/skateboard/real_264_000119.jpg 101 103 | real/snake/real_270_000027.jpg 102 104 | real/speedboat/real_276_000041.jpg 103 105 | real/spider/real_277_000458.jpg 104 106 | real/squirrel/real_282_000351.jpg 105 107 | real/strawberry/real_291_000148.jpg 106 108 | real/streetlight/real_292_000011.jpg 107 109 | real/string_bean/real_293_000457.jpg 108 110 | real/submarine/real_294_000383.jpg 109 111 | real/swan/real_297_000102.jpg 110 112 | real/table/real_302_000530.jpg 111 113 | real/teapot/real_303_000389.jpg 112 114 | real/teddy-bear/real_304_000117.jpg 113 115 | real/television/real_306_000200.jpg 114 116 | real/The_Eiffel_Tower/real_309_000463.jpg 115 117 | real/The_Great_Wall_of_China/real_310_000277.jpg 116 118 | real/tiger/real_312_000581.jpg 117 119 | real/toe/real_314_000278.jpg 118 120 | real/train/real_322_000036.jpg 119 121 | real/truck/real_326_000129.jpg 120 122 | real/umbrella/real_329_000080.jpg 121 123 | real/vase/real_332_000455.jpg 122 124 | real/watermelon/real_335_000145.jpg 123 125 | real/whale/real_337_000394.jpg 124 126 | real/zebra/real_344_000380.jpg 125 127 | -------------------------------------------------------------------------------- /data/txt/multi/labeled_target_images_sketch_1.txt: -------------------------------------------------------------------------------- 1 | sketch/aircraft_carrier/sketch_001_000028.jpg 0 2 | sketch/alarm_clock/sketch_003_000011.jpg 1 3 | sketch/ant/sketch_007_000002.jpg 2 4 | sketch/anvil/sketch_008_000087.jpg 3 5 | sketch/asparagus/sketch_011_000069.jpg 4 6 | sketch/axe/sketch_012_000028.jpg 5 7 | sketch/banana/sketch_014_000021.jpg 6 8 | sketch/basket/sketch_019_000174.jpg 7 9 | sketch/bathtub/sketch_022_000148.jpg 8 10 | sketch/bear/sketch_024_000067.jpg 9 11 | sketch/bee/sketch_027_000070.jpg 10 12 | sketch/bird/sketch_032_000120.jpg 11 13 | sketch/blackberry/sketch_034_000009.jpg 12 14 | sketch/blueberry/sketch_035_000079.jpg 13 15 | sketch/bottlecap/sketch_038_000121.jpg 14 16 | sketch/broccoli/sketch_044_000119.jpg 15 17 | sketch/bus/sketch_048_000196.jpg 16 18 | sketch/butterfly/sketch_050_000191.jpg 17 19 | sketch/cactus/sketch_051_000014.jpg 18 20 | sketch/cake/sketch_052_000024.jpg 19 21 | sketch/calculator/sketch_053_000037.jpg 20 22 | sketch/camel/sketch_055_000015.jpg 21 23 | sketch/camera/sketch_056_000081.jpg 22 24 | sketch/candle/sketch_059_000049.jpg 23 25 | sketch/cannon/sketch_060_000013.jpg 24 26 | sketch/canoe/sketch_061_000091.jpg 25 27 | sketch/carrot/sketch_063_000034.jpg 26 28 | sketch/castle/sketch_064_000013.jpg 27 29 | sketch/cat/sketch_065_000122.jpg 28 30 | sketch/ceiling_fan/sketch_066_000004.jpg 29 31 | sketch/cello/sketch_067_000028.jpg 30 32 | sketch/cell_phone/sketch_068_000011.jpg 31 33 | sketch/chair/sketch_069_000080.jpg 32 34 | sketch/chandelier/sketch_070_000017.jpg 33 35 | sketch/coffee_cup/sketch_076_000013.jpg 34 36 | sketch/compass/sketch_077_000014.jpg 35 37 | sketch/computer/sketch_078_000002.jpg 36 38 | sketch/cow/sketch_082_000009.jpg 37 39 | sketch/crab/sketch_083_000105.jpg 38 40 | sketch/crocodile/sketch_085_000043.jpg 39 41 | sketch/cruise_ship/sketch_087_000092.jpg 40 42 | sketch/dog/sketch_092_000194.jpg 41 43 | sketch/dolphin/sketch_093_000082.jpg 42 44 | sketch/dragon/sketch_096_000047.jpg 43 45 | sketch/drums/sketch_099_000045.jpg 44 46 | sketch/duck/sketch_100_000267.jpg 45 47 | sketch/dumbbell/sketch_101_000106.jpg 46 48 | sketch/elephant/sketch_104_000135.jpg 47 49 | sketch/eyeglasses/sketch_108_000119.jpg 48 50 | sketch/feather/sketch_111_000194.jpg 49 51 | sketch/fence/sketch_112_000016.jpg 50 52 | sketch/fish/sketch_117_000264.jpg 51 53 | sketch/flamingo/sketch_118_000016.jpg 52 54 | sketch/flower/sketch_122_000292.jpg 53 55 | sketch/foot/sketch_124_000088.jpg 54 56 | sketch/fork/sketch_125_000053.jpg 55 57 | sketch/frog/sketch_126_000082.jpg 56 58 | sketch/giraffe/sketch_130_000019.jpg 57 59 | sketch/goatee/sketch_131_000020.jpg 58 60 | sketch/grapes/sketch_133_000019.jpg 59 61 | sketch/guitar/sketch_135_000038.jpg 60 62 | sketch/hammer/sketch_137_000044.jpg 61 63 | sketch/helicopter/sketch_143_000063.jpg 62 64 | sketch/helmet/sketch_144_000081.jpg 63 65 | sketch/horse/sketch_148_000002.jpg 64 66 | sketch/kangaroo/sketch_160_000075.jpg 65 67 | sketch/lantern/sketch_166_000019.jpg 66 68 | sketch/laptop/sketch_167_000075.jpg 67 69 | sketch/leaf/sketch_168_000336.jpg 68 70 | sketch/lion/sketch_175_000088.jpg 69 71 | sketch/lipstick/sketch_176_000056.jpg 70 72 | sketch/lobster/sketch_177_000061.jpg 71 73 | sketch/microphone/sketch_185_000150.jpg 72 74 | sketch/monkey/sketch_187_000031.jpg 73 75 | sketch/mosquito/sketch_189_000038.jpg 74 76 | sketch/mouse/sketch_192_000121.jpg 75 77 | sketch/mug/sketch_195_000141.jpg 76 78 | sketch/mushroom/sketch_196_000107.jpg 77 79 | sketch/onion/sketch_203_000005.jpg 78 80 | sketch/panda/sketch_209_000019.jpg 79 81 | sketch/peanut/sketch_215_000044.jpg 80 82 | sketch/pear/sketch_216_000105.jpg 81 83 | sketch/peas/sketch_217_000028.jpg 82 84 | sketch/pencil/sketch_218_000025.jpg 83 85 | sketch/penguin/sketch_219_000021.jpg 84 86 | sketch/pig/sketch_223_000157.jpg 85 87 | sketch/pillow/sketch_224_000097.jpg 86 88 | sketch/pineapple/sketch_225_000031.jpg 87 89 | sketch/potato/sketch_233_000060.jpg 88 90 | sketch/power_outlet/sketch_234_000079.jpg 89 91 | sketch/purse/sketch_235_000067.jpg 90 92 | sketch/rabbit/sketch_236_000058.jpg 91 93 | sketch/raccoon/sketch_237_000293.jpg 92 94 | sketch/rhinoceros/sketch_243_000160.jpg 93 95 | sketch/rifle/sketch_244_000065.jpg 94 96 | sketch/saxophone/sketch_251_000280.jpg 95 97 | sketch/screwdriver/sketch_255_000041.jpg 96 98 | sketch/sea_turtle/sketch_256_000104.jpg 97 99 | sketch/see_saw/sketch_257_000106.jpg 98 100 | sketch/sheep/sketch_259_000424.jpg 99 101 | sketch/shoe/sketch_260_000601.jpg 100 102 | sketch/skateboard/sketch_264_000201.jpg 101 103 | sketch/snake/sketch_270_000298.jpg 102 104 | sketch/speedboat/sketch_276_000331.jpg 103 105 | sketch/spider/sketch_277_000530.jpg 104 106 | sketch/squirrel/sketch_282_000358.jpg 105 107 | sketch/strawberry/sketch_291_000020.jpg 106 108 | sketch/streetlight/sketch_292_000191.jpg 107 109 | sketch/string_bean/sketch_293_000010.jpg 108 110 | sketch/submarine/sketch_294_000112.jpg 109 111 | sketch/swan/sketch_297_000154.jpg 110 112 | sketch/table/sketch_302_000041.jpg 111 113 | sketch/teapot/sketch_303_000313.jpg 112 114 | sketch/teddy-bear/sketch_304_000016.jpg 113 115 | sketch/television/sketch_306_000064.jpg 114 116 | sketch/The_Eiffel_Tower/sketch_309_000177.jpg 115 117 | sketch/The_Great_Wall_of_China/sketch_310_000016.jpg 116 118 | sketch/tiger/sketch_312_000231.jpg 117 119 | sketch/toe/sketch_314_000034.jpg 118 120 | sketch/train/sketch_322_000229.jpg 119 121 | sketch/truck/sketch_326_000089.jpg 120 122 | sketch/umbrella/sketch_329_000143.jpg 121 123 | sketch/vase/sketch_332_000150.jpg 122 124 | sketch/watermelon/sketch_335_000103.jpg 123 125 | sketch/whale/sketch_337_000235.jpg 124 126 | sketch/zebra/sketch_344_000036.jpg 125 127 | -------------------------------------------------------------------------------- /data/txt/office_home/labeled_target_images_Art_3.txt: -------------------------------------------------------------------------------- 1 | Art/Alarm_Clock/00013.jpg 0 2 | Art/Alarm_Clock/00039.jpg 0 3 | Art/Alarm_Clock/00048.jpg 0 4 | Art/Backpack/00026.jpg 1 5 | Art/Backpack/00021.jpg 1 6 | Art/Backpack/00039.jpg 1 7 | Art/Batteries/00012.jpg 2 8 | Art/Batteries/00008.jpg 2 9 | Art/Batteries/00021.jpg 2 10 | Art/Bed/00024.jpg 3 11 | Art/Bed/00038.jpg 3 12 | Art/Bed/00027.jpg 3 13 | Art/Bike/00066.jpg 4 14 | Art/Bike/00017.jpg 4 15 | Art/Bike/00005.jpg 4 16 | Art/Bottle/00001.jpg 5 17 | Art/Bottle/00003.jpg 5 18 | Art/Bottle/00014.jpg 5 19 | Art/Bucket/00035.jpg 6 20 | Art/Bucket/00018.jpg 6 21 | Art/Bucket/00003.jpg 6 22 | Art/Calculator/00027.jpg 7 23 | Art/Calculator/00017.jpg 7 24 | Art/Calculator/00028.jpg 7 25 | Art/Calendar/00007.jpg 8 26 | Art/Calendar/00013.jpg 8 27 | Art/Calendar/00005.jpg 8 28 | Art/Candles/00043.jpg 9 29 | Art/Candles/00010.jpg 9 30 | Art/Candles/00018.jpg 9 31 | Art/Chair/00034.jpg 10 32 | Art/Chair/00017.jpg 10 33 | Art/Chair/00061.jpg 10 34 | Art/Clipboards/00019.jpg 11 35 | Art/Clipboards/00023.jpg 11 36 | Art/Clipboards/00011.jpg 11 37 | Art/Computer/00041.jpg 12 38 | Art/Computer/00011.jpg 12 39 | Art/Computer/00007.jpg 12 40 | Art/Couch/00033.jpg 13 41 | Art/Couch/00003.jpg 13 42 | Art/Couch/00019.jpg 13 43 | Art/Curtains/00040.jpg 14 44 | Art/Curtains/00003.jpg 14 45 | Art/Curtains/00039.jpg 14 46 | Art/Desk_Lamp/00013.jpg 15 47 | Art/Desk_Lamp/00001.jpg 15 48 | Art/Desk_Lamp/00015.jpg 15 49 | Art/Drill/00007.jpg 16 50 | Art/Drill/00006.jpg 16 51 | Art/Drill/00009.jpg 16 52 | Art/Eraser/00009.jpg 17 53 | Art/Eraser/00001.jpg 17 54 | Art/Eraser/00013.jpg 17 55 | Art/Exit_Sign/00009.jpg 18 56 | Art/Exit_Sign/00001.jpg 18 57 | Art/Exit_Sign/00020.jpg 18 58 | Art/Fan/00012.jpg 19 59 | Art/Fan/00025.jpg 19 60 | Art/Fan/00026.jpg 19 61 | Art/File_Cabinet/00016.jpg 20 62 | Art/File_Cabinet/00020.jpg 20 63 | Art/File_Cabinet/00001.jpg 20 64 | Art/Flipflops/00034.jpg 21 65 | Art/Flipflops/00030.jpg 21 66 | Art/Flipflops/00001.jpg 21 67 | Art/Flowers/00019.jpg 22 68 | Art/Flowers/00018.jpg 22 69 | Art/Flowers/00012.jpg 22 70 | Art/Folder/00020.jpg 23 71 | Art/Folder/00002.jpg 23 72 | Art/Folder/00006.jpg 23 73 | Art/Fork/00040.jpg 24 74 | Art/Fork/00024.jpg 24 75 | Art/Fork/00005.jpg 24 76 | Art/Glasses/00039.jpg 25 77 | Art/Glasses/00006.jpg 25 78 | Art/Glasses/00007.jpg 25 79 | Art/Hammer/00010.jpg 26 80 | Art/Hammer/00027.jpg 26 81 | Art/Hammer/00024.jpg 26 82 | Art/Helmet/00076.jpg 27 83 | Art/Helmet/00034.jpg 27 84 | Art/Helmet/00021.jpg 27 85 | Art/Kettle/00029.jpg 28 86 | Art/Kettle/00034.jpg 28 87 | Art/Kettle/00032.jpg 28 88 | Art/Keyboard/00007.jpg 29 89 | Art/Keyboard/00017.jpg 29 90 | Art/Keyboard/00003.jpg 29 91 | Art/Knives/00052.jpg 30 92 | Art/Knives/00057.jpg 30 93 | Art/Knives/00059.jpg 30 94 | Art/Lamp_Shade/00020.jpg 31 95 | Art/Lamp_Shade/00018.jpg 31 96 | Art/Lamp_Shade/00046.jpg 31 97 | Art/Laptop/00017.jpg 32 98 | Art/Laptop/00013.jpg 32 99 | Art/Laptop/00044.jpg 32 100 | Art/Marker/00010.jpg 33 101 | Art/Marker/00018.jpg 33 102 | Art/Marker/00020.jpg 33 103 | Art/Monitor/00015.jpg 34 104 | Art/Monitor/00020.jpg 34 105 | Art/Monitor/00031.jpg 34 106 | Art/Mop/00013.jpg 35 107 | Art/Mop/00007.jpg 35 108 | Art/Mop/00015.jpg 35 109 | Art/Mouse/00014.jpg 36 110 | Art/Mouse/00016.jpg 36 111 | Art/Mouse/00005.jpg 36 112 | Art/Mug/00038.jpg 37 113 | Art/Mug/00010.jpg 37 114 | Art/Mug/00013.jpg 37 115 | Art/Notebook/00012.jpg 38 116 | Art/Notebook/00021.jpg 38 117 | Art/Notebook/00003.jpg 38 118 | Art/Oven/00002.jpg 39 119 | Art/Oven/00017.jpg 39 120 | Art/Oven/00005.jpg 39 121 | Art/Pan/00018.jpg 40 122 | Art/Pan/00012.jpg 40 123 | Art/Pan/00016.jpg 40 124 | Art/Paper_Clip/00013.jpg 41 125 | Art/Paper_Clip/00010.jpg 41 126 | Art/Paper_Clip/00006.jpg 41 127 | Art/Pen/00003.jpg 42 128 | Art/Pen/00006.jpg 42 129 | Art/Pen/00017.jpg 42 130 | Art/Pencil/00020.jpg 43 131 | Art/Pencil/00013.jpg 43 132 | Art/Pencil/00006.jpg 43 133 | Art/Postit_Notes/00016.jpg 44 134 | Art/Postit_Notes/00003.jpg 44 135 | Art/Postit_Notes/00011.jpg 44 136 | Art/Printer/00013.jpg 45 137 | Art/Printer/00014.jpg 45 138 | Art/Printer/00006.jpg 45 139 | Art/Push_Pin/00015.jpg 46 140 | Art/Push_Pin/00024.jpg 46 141 | Art/Push_Pin/00016.jpg 46 142 | Art/Radio/00022.jpg 47 143 | Art/Radio/00020.jpg 47 144 | Art/Radio/00015.jpg 47 145 | Art/Refrigerator/00025.jpg 48 146 | Art/Refrigerator/00027.jpg 48 147 | Art/Refrigerator/00041.jpg 48 148 | Art/Ruler/00012.jpg 49 149 | Art/Ruler/00015.jpg 49 150 | Art/Ruler/00004.jpg 49 151 | Art/Scissors/00001.jpg 50 152 | Art/Scissors/00007.jpg 50 153 | Art/Scissors/00002.jpg 50 154 | Art/Screwdriver/00008.jpg 51 155 | Art/Screwdriver/00002.jpg 51 156 | Art/Screwdriver/00013.jpg 51 157 | Art/Shelf/00032.jpg 52 158 | Art/Shelf/00021.jpg 52 159 | Art/Shelf/00027.jpg 52 160 | Art/Sink/00006.jpg 53 161 | Art/Sink/00041.jpg 53 162 | Art/Sink/00007.jpg 53 163 | Art/Sneakers/00030.jpg 54 164 | Art/Sneakers/00031.jpg 54 165 | Art/Sneakers/00017.jpg 54 166 | Art/Soda/00028.jpg 55 167 | Art/Soda/00040.jpg 55 168 | Art/Soda/00013.jpg 55 169 | Art/Speaker/00015.jpg 56 170 | Art/Speaker/00008.jpg 56 171 | Art/Speaker/00018.jpg 56 172 | Art/Spoon/00032.jpg 57 173 | Art/Spoon/00001.jpg 57 174 | Art/Spoon/00014.jpg 57 175 | Art/Table/00015.jpg 58 176 | Art/Table/00007.jpg 58 177 | Art/Table/00003.jpg 58 178 | Art/Telephone/00044.jpg 59 179 | Art/Telephone/00041.jpg 59 180 | Art/Telephone/00010.jpg 59 181 | Art/ToothBrush/00017.jpg 60 182 | Art/ToothBrush/00015.jpg 60 183 | Art/ToothBrush/00006.jpg 60 184 | Art/Toys/00013.jpg 61 185 | Art/Toys/00001.jpg 61 186 | Art/Toys/00007.jpg 61 187 | Art/Trash_Can/00004.jpg 62 188 | Art/Trash_Can/00015.jpg 62 189 | Art/Trash_Can/00008.jpg 62 190 | Art/TV/00018.jpg 63 191 | Art/TV/00029.jpg 63 192 | Art/TV/00015.jpg 63 193 | Art/Webcam/00011.jpg 64 194 | Art/Webcam/00014.jpg 64 195 | Art/Webcam/00004.jpg 64 196 | -------------------------------------------------------------------------------- /data/txt/office_home/validation_target_images_Art_3.txt: -------------------------------------------------------------------------------- 1 | Art/Alarm_Clock/00015.jpg 0 2 | Art/Alarm_Clock/00063.jpg 0 3 | Art/Alarm_Clock/00032.jpg 0 4 | Art/Backpack/00038.jpg 1 5 | Art/Backpack/00025.jpg 1 6 | Art/Backpack/00030.jpg 1 7 | Art/Batteries/00015.jpg 2 8 | Art/Batteries/00010.jpg 2 9 | Art/Batteries/00003.jpg 2 10 | Art/Bed/00008.jpg 3 11 | Art/Bed/00001.jpg 3 12 | Art/Bed/00006.jpg 3 13 | Art/Bike/00020.jpg 4 14 | Art/Bike/00036.jpg 4 15 | Art/Bike/00031.jpg 4 16 | Art/Bottle/00091.jpg 5 17 | Art/Bottle/00072.jpg 5 18 | Art/Bottle/00076.jpg 5 19 | Art/Bucket/00007.jpg 6 20 | Art/Bucket/00004.jpg 6 21 | Art/Bucket/00019.jpg 6 22 | Art/Calculator/00022.jpg 7 23 | Art/Calculator/00025.jpg 7 24 | Art/Calculator/00001.jpg 7 25 | Art/Calendar/00015.jpg 8 26 | Art/Calendar/00008.jpg 8 27 | Art/Calendar/00009.jpg 8 28 | Art/Candles/00058.jpg 9 29 | Art/Candles/00013.jpg 9 30 | Art/Candles/00062.jpg 9 31 | Art/Chair/00037.jpg 10 32 | Art/Chair/00009.jpg 10 33 | Art/Chair/00033.jpg 10 34 | Art/Clipboards/00015.jpg 11 35 | Art/Clipboards/00017.jpg 11 36 | Art/Clipboards/00021.jpg 11 37 | Art/Computer/00014.jpg 12 38 | Art/Computer/00042.jpg 12 39 | Art/Computer/00036.jpg 12 40 | Art/Couch/00026.jpg 13 41 | Art/Couch/00017.jpg 13 42 | Art/Couch/00039.jpg 13 43 | Art/Curtains/00012.jpg 14 44 | Art/Curtains/00028.jpg 14 45 | Art/Curtains/00036.jpg 14 46 | Art/Desk_Lamp/00023.jpg 15 47 | Art/Desk_Lamp/00012.jpg 15 48 | Art/Desk_Lamp/00010.jpg 15 49 | Art/Drill/00012.jpg 16 50 | Art/Drill/00008.jpg 16 51 | Art/Drill/00013.jpg 16 52 | Art/Eraser/00014.jpg 17 53 | Art/Eraser/00018.jpg 17 54 | Art/Eraser/00011.jpg 17 55 | Art/Exit_Sign/00018.jpg 18 56 | Art/Exit_Sign/00007.jpg 18 57 | Art/Exit_Sign/00002.jpg 18 58 | Art/Fan/00028.jpg 19 59 | Art/Fan/00019.jpg 19 60 | Art/Fan/00029.jpg 19 61 | Art/File_Cabinet/00006.jpg 20 62 | Art/File_Cabinet/00018.jpg 20 63 | Art/File_Cabinet/00011.jpg 20 64 | Art/Flipflops/00003.jpg 21 65 | Art/Flipflops/00004.jpg 21 66 | Art/Flipflops/00027.jpg 21 67 | Art/Flowers/00002.jpg 22 68 | Art/Flowers/00083.jpg 22 69 | Art/Flowers/00077.jpg 22 70 | Art/Folder/00018.jpg 23 71 | Art/Folder/00012.jpg 23 72 | Art/Folder/00005.jpg 23 73 | Art/Fork/00012.jpg 24 74 | Art/Fork/00007.jpg 24 75 | Art/Fork/00028.jpg 24 76 | Art/Glasses/00036.jpg 25 77 | Art/Glasses/00017.jpg 25 78 | Art/Glasses/00030.jpg 25 79 | Art/Hammer/00029.jpg 26 80 | Art/Hammer/00004.jpg 26 81 | Art/Hammer/00021.jpg 26 82 | Art/Helmet/00013.jpg 27 83 | Art/Helmet/00043.jpg 27 84 | Art/Helmet/00040.jpg 27 85 | Art/Kettle/00007.jpg 28 86 | Art/Kettle/00019.jpg 28 87 | Art/Kettle/00017.jpg 28 88 | Art/Keyboard/00013.jpg 29 89 | Art/Keyboard/00012.jpg 29 90 | Art/Keyboard/00005.jpg 29 91 | Art/Knives/00036.jpg 30 92 | Art/Knives/00058.jpg 30 93 | Art/Knives/00028.jpg 30 94 | Art/Lamp_Shade/00011.jpg 31 95 | Art/Lamp_Shade/00009.jpg 31 96 | Art/Lamp_Shade/00035.jpg 31 97 | Art/Laptop/00032.jpg 32 98 | Art/Laptop/00038.jpg 32 99 | Art/Laptop/00018.jpg 32 100 | Art/Marker/00007.jpg 33 101 | Art/Marker/00016.jpg 33 102 | Art/Marker/00006.jpg 33 103 | Art/Monitor/00039.jpg 34 104 | Art/Monitor/00005.jpg 34 105 | Art/Monitor/00033.jpg 34 106 | Art/Mop/00031.jpg 35 107 | Art/Mop/00028.jpg 35 108 | Art/Mop/00009.jpg 35 109 | Art/Mouse/00004.jpg 36 110 | Art/Mouse/00011.jpg 36 111 | Art/Mouse/00008.jpg 36 112 | Art/Mug/00042.jpg 37 113 | Art/Mug/00035.jpg 37 114 | Art/Mug/00017.jpg 37 115 | Art/Notebook/00017.jpg 38 116 | Art/Notebook/00019.jpg 38 117 | Art/Notebook/00008.jpg 38 118 | Art/Oven/00001.jpg 39 119 | Art/Oven/00014.jpg 39 120 | Art/Oven/00006.jpg 39 121 | Art/Pan/00004.jpg 40 122 | Art/Pan/00005.jpg 40 123 | Art/Pan/00014.jpg 40 124 | Art/Paper_Clip/00014.jpg 41 125 | Art/Paper_Clip/00016.jpg 41 126 | Art/Paper_Clip/00003.jpg 41 127 | Art/Pen/00009.jpg 42 128 | Art/Pen/00011.jpg 42 129 | Art/Pen/00015.jpg 42 130 | Art/Pencil/00004.jpg 43 131 | Art/Pencil/00009.jpg 43 132 | Art/Pencil/00019.jpg 43 133 | Art/Postit_Notes/00013.jpg 44 134 | Art/Postit_Notes/00009.jpg 44 135 | Art/Postit_Notes/00012.jpg 44 136 | Art/Printer/00003.jpg 45 137 | Art/Printer/00009.jpg 45 138 | Art/Printer/00015.jpg 45 139 | Art/Push_Pin/00022.jpg 46 140 | Art/Push_Pin/00019.jpg 46 141 | Art/Push_Pin/00010.jpg 46 142 | Art/Radio/00027.jpg 47 143 | Art/Radio/00006.jpg 47 144 | Art/Radio/00025.jpg 47 145 | Art/Refrigerator/00017.jpg 48 146 | Art/Refrigerator/00016.jpg 48 147 | Art/Refrigerator/00049.jpg 48 148 | Art/Ruler/00005.jpg 49 149 | Art/Ruler/00001.jpg 49 150 | Art/Ruler/00014.jpg 49 151 | Art/Scissors/00009.jpg 50 152 | Art/Scissors/00016.jpg 50 153 | Art/Scissors/00018.jpg 50 154 | Art/Screwdriver/00028.jpg 51 155 | Art/Screwdriver/00023.jpg 51 156 | Art/Screwdriver/00020.jpg 51 157 | Art/Shelf/00030.jpg 52 158 | Art/Shelf/00003.jpg 52 159 | Art/Shelf/00020.jpg 52 160 | Art/Sink/00027.jpg 53 161 | Art/Sink/00022.jpg 53 162 | Art/Sink/00010.jpg 53 163 | Art/Sneakers/00041.jpg 54 164 | Art/Sneakers/00020.jpg 54 165 | Art/Sneakers/00008.jpg 54 166 | Art/Soda/00022.jpg 55 167 | Art/Soda/00001.jpg 55 168 | Art/Soda/00025.jpg 55 169 | Art/Speaker/00002.jpg 56 170 | Art/Speaker/00004.jpg 56 171 | Art/Speaker/00014.jpg 56 172 | Art/Spoon/00010.jpg 57 173 | Art/Spoon/00045.jpg 57 174 | Art/Spoon/00023.jpg 57 175 | Art/Table/00006.jpg 58 176 | Art/Table/00012.jpg 58 177 | Art/Table/00009.jpg 58 178 | Art/Telephone/00013.jpg 59 179 | Art/Telephone/00036.jpg 59 180 | Art/Telephone/00025.jpg 59 181 | Art/ToothBrush/00024.jpg 60 182 | Art/ToothBrush/00016.jpg 60 183 | Art/ToothBrush/00037.jpg 60 184 | Art/Toys/00002.jpg 61 185 | Art/Toys/00020.jpg 61 186 | Art/Toys/00019.jpg 61 187 | Art/Trash_Can/00014.jpg 62 188 | Art/Trash_Can/00005.jpg 62 189 | Art/Trash_Can/00017.jpg 62 190 | Art/TV/00036.jpg 63 191 | Art/TV/00027.jpg 63 192 | Art/TV/00002.jpg 63 193 | Art/Webcam/00016.jpg 64 194 | Art/Webcam/00010.jpg 64 195 | Art/Webcam/00006.jpg 64 196 | -------------------------------------------------------------------------------- /data/txt/multi/labeled_target_images_clipart_1.txt: -------------------------------------------------------------------------------- 1 | clipart/aircraft_carrier/clipart_001_000017.jpg 0 2 | clipart/alarm_clock/clipart_003_000058.jpg 1 3 | clipart/ant/clipart_007_000030.jpg 2 4 | clipart/anvil/clipart_008_000072.jpg 3 5 | clipart/asparagus/clipart_011_000042.jpg 4 6 | clipart/axe/clipart_012_000014.jpg 5 7 | clipart/banana/clipart_014_000022.jpg 6 8 | clipart/basket/clipart_019_000028.jpg 7 9 | clipart/bathtub/clipart_022_000093.jpg 8 10 | clipart/bear/clipart_024_000075.jpg 9 11 | clipart/bee/clipart_027_000169.jpg 10 12 | clipart/bird/clipart_032_000046.jpg 11 13 | clipart/blackberry/clipart_034_000034.jpg 12 14 | clipart/blueberry/clipart_035_000153.jpg 13 15 | clipart/bottlecap/clipart_038_000029.jpg 14 16 | clipart/broccoli/clipart_044_000069.jpg 15 17 | clipart/bus/clipart_048_000054.jpg 16 18 | clipart/butterfly/clipart_050_000074.jpg 17 19 | clipart/cactus/clipart_051_000090.jpg 18 20 | clipart/cake/clipart_052_000108.jpg 19 21 | clipart/calculator/clipart_053_000034.jpg 20 22 | clipart/camel/clipart_055_000130.jpg 21 23 | clipart/camera/clipart_056_000050.jpg 22 24 | clipart/candle/clipart_059_000102.jpg 23 25 | clipart/cannon/clipart_060_000006.jpg 24 26 | clipart/canoe/clipart_061_000019.jpg 25 27 | clipart/carrot/clipart_063_000029.jpg 26 28 | clipart/castle/clipart_064_000028.jpg 27 29 | clipart/cat/clipart_065_000011.jpg 28 30 | clipart/ceiling_fan/clipart_066_000016.jpg 29 31 | clipart/cello/clipart_067_000062.jpg 30 32 | clipart/cell_phone/clipart_068_000010.jpg 31 33 | clipart/chair/clipart_069_000091.jpg 32 34 | clipart/chandelier/clipart_070_000109.jpg 33 35 | clipart/coffee_cup/clipart_076_000203.jpg 34 36 | clipart/compass/clipart_077_000128.jpg 35 37 | clipart/computer/clipart_078_000073.jpg 36 38 | clipart/cow/clipart_082_000141.jpg 37 39 | clipart/crab/clipart_083_000002.jpg 38 40 | clipart/crocodile/clipart_085_000030.jpg 39 41 | clipart/cruise_ship/clipart_087_000022.jpg 40 42 | clipart/dog/clipart_092_000042.jpg 41 43 | clipart/dolphin/clipart_093_000014.jpg 42 44 | clipart/dragon/clipart_096_000085.jpg 43 45 | clipart/drums/clipart_099_000098.jpg 44 46 | clipart/duck/clipart_100_000089.jpg 45 47 | clipart/dumbbell/clipart_101_000318.jpg 46 48 | clipart/elephant/clipart_104_000082.jpg 47 49 | clipart/eyeglasses/clipart_108_000008.jpg 48 50 | clipart/feather/clipart_111_000154.jpg 49 51 | clipart/fence/clipart_112_000130.jpg 50 52 | clipart/fish/clipart_117_000054.jpg 51 53 | clipart/flamingo/clipart_118_000234.jpg 52 54 | clipart/flower/clipart_122_000195.jpg 53 55 | clipart/foot/clipart_124_000009.jpg 54 56 | clipart/fork/clipart_125_000126.jpg 55 57 | clipart/frog/clipart_126_000037.jpg 56 58 | clipart/giraffe/clipart_130_000014.jpg 57 59 | clipart/goatee/clipart_131_000251.jpg 58 60 | clipart/grapes/clipart_133_000080.jpg 59 61 | clipart/guitar/clipart_135_000031.jpg 60 62 | clipart/hammer/clipart_137_000147.jpg 61 63 | clipart/helicopter/clipart_143_000053.jpg 62 64 | clipart/helmet/clipart_144_000126.jpg 63 65 | clipart/horse/clipart_148_000089.jpg 64 66 | clipart/kangaroo/clipart_160_000053.jpg 65 67 | clipart/lantern/clipart_166_000022.jpg 66 68 | clipart/laptop/clipart_167_000021.jpg 67 69 | clipart/leaf/clipart_168_000004.jpg 68 70 | clipart/lion/clipart_175_000041.jpg 69 71 | clipart/lipstick/clipart_176_000043.jpg 70 72 | clipart/lobster/clipart_177_000080.jpg 71 73 | clipart/microphone/clipart_185_000085.jpg 72 74 | clipart/monkey/clipart_187_000038.jpg 73 75 | clipart/mosquito/clipart_189_000049.jpg 74 76 | clipart/mouse/clipart_192_000013.jpg 75 77 | clipart/mug/clipart_195_000151.jpg 76 78 | clipart/mushroom/clipart_196_000134.jpg 77 79 | clipart/onion/clipart_203_000087.jpg 78 80 | clipart/panda/clipart_209_000047.jpg 79 81 | clipart/peanut/clipart_215_000024.jpg 80 82 | clipart/pear/clipart_216_000052.jpg 81 83 | clipart/peas/clipart_217_000034.jpg 82 84 | clipart/pencil/clipart_218_000020.jpg 83 85 | clipart/penguin/clipart_219_000049.jpg 84 86 | clipart/pig/clipart_223_000091.jpg 85 87 | clipart/pillow/clipart_224_000048.jpg 86 88 | clipart/pineapple/clipart_225_000066.jpg 87 89 | clipart/potato/clipart_233_000043.jpg 88 90 | clipart/power_outlet/clipart_234_000001.jpg 89 91 | clipart/purse/clipart_235_000030.jpg 90 92 | clipart/rabbit/clipart_236_000037.jpg 91 93 | clipart/raccoon/clipart_237_000019.jpg 92 94 | clipart/rhinoceros/clipart_243_000061.jpg 93 95 | clipart/rifle/clipart_244_000074.jpg 94 96 | clipart/saxophone/clipart_251_000124.jpg 95 97 | clipart/screwdriver/clipart_255_000139.jpg 96 98 | clipart/sea_turtle/clipart_256_000009.jpg 97 99 | clipart/see_saw/clipart_257_000227.jpg 98 100 | clipart/sheep/clipart_259_000102.jpg 99 101 | clipart/shoe/clipart_260_000069.jpg 100 102 | clipart/skateboard/clipart_264_000165.jpg 101 103 | clipart/snake/clipart_270_000117.jpg 102 104 | clipart/speedboat/clipart_276_000178.jpg 103 105 | clipart/spider/clipart_277_000004.jpg 104 106 | clipart/squirrel/clipart_282_000197.jpg 105 107 | clipart/strawberry/clipart_291_000292.jpg 106 108 | clipart/streetlight/clipart_292_000139.jpg 107 109 | clipart/string_bean/clipart_293_000086.jpg 108 110 | clipart/submarine/clipart_294_000004.jpg 109 111 | clipart/swan/clipart_297_000312.jpg 110 112 | clipart/table/clipart_302_000219.jpg 111 113 | clipart/teapot/clipart_303_000095.jpg 112 114 | clipart/teddy-bear/clipart_304_000009.jpg 113 115 | clipart/television/clipart_306_000079.jpg 114 116 | clipart/The_Eiffel_Tower/clipart_309_000014.jpg 115 117 | clipart/The_Great_Wall_of_China/clipart_310_000050.jpg 116 118 | clipart/tiger/clipart_312_000005.jpg 117 119 | clipart/toe/clipart_314_000003.jpg 118 120 | clipart/train/clipart_322_000055.jpg 119 121 | clipart/truck/clipart_326_000010.jpg 120 122 | clipart/umbrella/clipart_329_000006.jpg 121 123 | clipart/vase/clipart_332_000053.jpg 122 124 | clipart/watermelon/clipart_335_000032.jpg 123 125 | clipart/whale/clipart_337_000242.jpg 124 126 | clipart/zebra/clipart_344_000111.jpg 125 127 | -------------------------------------------------------------------------------- /data/txt/office_home/labeled_target_images_Real_3.txt: -------------------------------------------------------------------------------- 1 | Real/Alarm_Clock/00037.jpg 0 2 | Real/Alarm_Clock/00031.jpg 0 3 | Real/Alarm_Clock/00018.jpg 0 4 | Real/Backpack/00055.jpg 1 5 | Real/Backpack/00047.jpg 1 6 | Real/Backpack/00085.jpg 1 7 | Real/Batteries/00048.jpg 2 8 | Real/Batteries/00049.jpg 2 9 | Real/Batteries/00052.jpg 2 10 | Real/Bed/00018.jpg 3 11 | Real/Bed/00016.jpg 3 12 | Real/Bed/00002.jpg 3 13 | Real/Bike/00009.jpg 4 14 | Real/Bike/00098.jpg 4 15 | Real/Bike/00078.jpg 4 16 | Real/Bottle/00055.jpg 5 17 | Real/Bottle/00064.jpg 5 18 | Real/Bottle/00001.jpg 5 19 | Real/Bucket/00029.jpg 6 20 | Real/Bucket/00037.jpg 6 21 | Real/Bucket/00054.jpg 6 22 | Real/Calculator/00014.jpg 7 23 | Real/Calculator/00009.jpg 7 24 | Real/Calculator/00026.jpg 7 25 | Real/Calendar/00019.jpg 8 26 | Real/Calendar/00034.jpg 8 27 | Real/Calendar/00064.jpg 8 28 | Real/Candles/00085.jpg 9 29 | Real/Candles/00018.jpg 9 30 | Real/Candles/00042.jpg 9 31 | Real/Chair/00075.jpg 10 32 | Real/Chair/00021.jpg 10 33 | Real/Chair/00047.jpg 10 34 | Real/Clipboards/00025.jpg 11 35 | Real/Clipboards/00037.jpg 11 36 | Real/Clipboards/00010.jpg 11 37 | Real/Computer/00051.jpg 12 38 | Real/Computer/00042.jpg 12 39 | Real/Computer/00040.jpg 12 40 | Real/Couch/00019.jpg 13 41 | Real/Couch/00011.jpg 13 42 | Real/Couch/00043.jpg 13 43 | Real/Curtains/00022.jpg 14 44 | Real/Curtains/00003.jpg 14 45 | Real/Curtains/00040.jpg 14 46 | Real/Desk_Lamp/00028.jpg 15 47 | Real/Desk_Lamp/00062.jpg 15 48 | Real/Desk_Lamp/00010.jpg 15 49 | Real/Drill/00026.jpg 16 50 | Real/Drill/00013.jpg 16 51 | Real/Drill/00028.jpg 16 52 | Real/Eraser/00019.jpg 17 53 | Real/Eraser/00003.jpg 17 54 | Real/Eraser/00039.jpg 17 55 | Real/Exit_Sign/00068.jpg 18 56 | Real/Exit_Sign/00015.jpg 18 57 | Real/Exit_Sign/00045.jpg 18 58 | Real/Fan/00060.jpg 19 59 | Real/Fan/00034.jpg 19 60 | Real/Fan/00030.jpg 19 61 | Real/File_Cabinet/00013.jpg 20 62 | Real/File_Cabinet/00015.jpg 20 63 | Real/File_Cabinet/00002.jpg 20 64 | Real/Flipflops/00057.jpg 21 65 | Real/Flipflops/00076.jpg 21 66 | Real/Flipflops/00068.jpg 21 67 | Real/Flowers/00063.jpg 22 68 | Real/Flowers/00052.jpg 22 69 | Real/Flowers/00018.jpg 22 70 | Real/Folder/00050.jpg 23 71 | Real/Folder/00012.jpg 23 72 | Real/Folder/00022.jpg 23 73 | Real/Fork/00013.jpg 24 74 | Real/Fork/00010.jpg 24 75 | Real/Fork/00004.jpg 24 76 | Real/Glasses/00003.jpg 25 77 | Real/Glasses/00054.jpg 25 78 | Real/Glasses/00043.jpg 25 79 | Real/Hammer/00030.jpg 26 80 | Real/Hammer/00021.jpg 26 81 | Real/Hammer/00001.jpg 26 82 | Real/Helmet/00045.jpg 27 83 | Real/Helmet/00053.jpg 27 84 | Real/Helmet/00001.jpg 27 85 | Real/Kettle/00021.jpg 28 86 | Real/Kettle/00004.jpg 28 87 | Real/Kettle/00024.jpg 28 88 | Real/Keyboard/00016.jpg 29 89 | Real/Keyboard/00061.jpg 29 90 | Real/Keyboard/00052.jpg 29 91 | Real/Knives/00075.jpg 30 92 | Real/Knives/00016.jpg 30 93 | Real/Knives/00044.jpg 30 94 | Real/Lamp_Shade/00056.jpg 31 95 | Real/Lamp_Shade/00007.jpg 31 96 | Real/Lamp_Shade/00068.jpg 31 97 | Real/Laptop/00004.jpg 32 98 | Real/Laptop/00056.jpg 32 99 | Real/Laptop/00050.jpg 32 100 | Real/Marker/00007.jpg 33 101 | Real/Marker/00020.jpg 33 102 | Real/Marker/00017.jpg 33 103 | Real/Monitor/00064.jpg 34 104 | Real/Monitor/00016.jpg 34 105 | Real/Monitor/00047.jpg 34 106 | Real/Mop/00006.jpg 35 107 | Real/Mop/00010.jpg 35 108 | Real/Mop/00021.jpg 35 109 | Real/Mouse/00012.jpg 36 110 | Real/Mouse/00016.jpg 36 111 | Real/Mouse/00060.jpg 36 112 | Real/Mug/00010.jpg 37 113 | Real/Mug/00024.jpg 37 114 | Real/Mug/00013.jpg 37 115 | Real/Notebook/00027.jpg 38 116 | Real/Notebook/00017.jpg 38 117 | Real/Notebook/00001.jpg 38 118 | Real/Oven/00016.jpg 39 119 | Real/Oven/00053.jpg 39 120 | Real/Oven/00057.jpg 39 121 | Real/Pan/00004.jpg 40 122 | Real/Pan/00012.jpg 40 123 | Real/Pan/00001.jpg 40 124 | Real/Paper_Clip/00066.jpg 41 125 | Real/Paper_Clip/00026.jpg 41 126 | Real/Paper_Clip/00021.jpg 41 127 | Real/Pen/00039.jpg 42 128 | Real/Pen/00022.jpg 42 129 | Real/Pen/00017.jpg 42 130 | Real/Pencil/00011.jpg 43 131 | Real/Pencil/00033.jpg 43 132 | Real/Pencil/00032.jpg 43 133 | Real/Postit_Notes/00037.jpg 44 134 | Real/Postit_Notes/00048.jpg 44 135 | Real/Postit_Notes/00008.jpg 44 136 | Real/Printer/00048.jpg 45 137 | Real/Printer/00030.jpg 45 138 | Real/Printer/00020.jpg 45 139 | Real/Push_Pin/00019.jpg 46 140 | Real/Push_Pin/00052.jpg 46 141 | Real/Push_Pin/00014.jpg 46 142 | Real/Radio/00049.jpg 47 143 | Real/Radio/00018.jpg 47 144 | Real/Radio/00033.jpg 47 145 | Real/Refrigerator/00038.jpg 48 146 | Real/Refrigerator/00032.jpg 48 147 | Real/Refrigerator/00024.jpg 48 148 | Real/Ruler/00028.jpg 49 149 | Real/Ruler/00031.jpg 49 150 | Real/Ruler/00024.jpg 49 151 | Real/Scissors/00071.jpg 50 152 | Real/Scissors/00042.jpg 50 153 | Real/Scissors/00022.jpg 50 154 | Real/Screwdriver/00041.jpg 51 155 | Real/Screwdriver/00025.jpg 51 156 | Real/Screwdriver/00004.jpg 51 157 | Real/Shelf/00013.jpg 52 158 | Real/Shelf/00014.jpg 52 159 | Real/Shelf/00050.jpg 52 160 | Real/Sink/00005.jpg 53 161 | Real/Sink/00020.jpg 53 162 | Real/Sink/00055.jpg 53 163 | Real/Sneakers/00045.jpg 54 164 | Real/Sneakers/00058.jpg 54 165 | Real/Sneakers/00038.jpg 54 166 | Real/Soda/00059.jpg 55 167 | Real/Soda/00013.jpg 55 168 | Real/Soda/00054.jpg 55 169 | Real/Speaker/00012.jpg 56 170 | Real/Speaker/00074.jpg 56 171 | Real/Speaker/00020.jpg 56 172 | Real/Spoon/00016.jpg 57 173 | Real/Spoon/00035.jpg 57 174 | Real/Spoon/00014.jpg 57 175 | Real/Table/00010.jpg 58 176 | Real/Table/00052.jpg 58 177 | Real/Table/00049.jpg 58 178 | Real/Telephone/00052.jpg 59 179 | Real/Telephone/00053.jpg 59 180 | Real/Telephone/00011.jpg 59 181 | Real/ToothBrush/00041.jpg 60 182 | Real/ToothBrush/00033.jpg 60 183 | Real/ToothBrush/00046.jpg 60 184 | Real/Toys/00015.jpg 61 185 | Real/Toys/00055.jpg 61 186 | Real/Toys/00045.jpg 61 187 | Real/Trash_Can/00031.jpg 62 188 | Real/Trash_Can/00073.jpg 62 189 | Real/Trash_Can/00013.jpg 62 190 | Real/TV/00040.jpg 63 191 | Real/TV/00004.jpg 63 192 | Real/TV/00053.jpg 63 193 | Real/Webcam/00025.jpg 64 194 | Real/Webcam/00042.jpg 64 195 | Real/Webcam/00018.jpg 64 196 | -------------------------------------------------------------------------------- /data/txt/office_home/validation_target_images_Real_3.txt: -------------------------------------------------------------------------------- 1 | Real/Alarm_Clock/00080.jpg 0 2 | Real/Alarm_Clock/00056.jpg 0 3 | Real/Alarm_Clock/00050.jpg 0 4 | Real/Backpack/00067.jpg 1 5 | Real/Backpack/00026.jpg 1 6 | Real/Backpack/00009.jpg 1 7 | Real/Batteries/00006.jpg 2 8 | Real/Batteries/00024.jpg 2 9 | Real/Batteries/00002.jpg 2 10 | Real/Bed/00051.jpg 3 11 | Real/Bed/00062.jpg 3 12 | Real/Bed/00031.jpg 3 13 | Real/Bike/00002.jpg 4 14 | Real/Bike/00018.jpg 4 15 | Real/Bike/00039.jpg 4 16 | Real/Bottle/00038.jpg 5 17 | Real/Bottle/00052.jpg 5 18 | Real/Bottle/00049.jpg 5 19 | Real/Bucket/00020.jpg 6 20 | Real/Bucket/00073.jpg 6 21 | Real/Bucket/00044.jpg 6 22 | Real/Calculator/00008.jpg 7 23 | Real/Calculator/00017.jpg 7 24 | Real/Calculator/00070.jpg 7 25 | Real/Calendar/00062.jpg 8 26 | Real/Calendar/00066.jpg 8 27 | Real/Calendar/00012.jpg 8 28 | Real/Candles/00031.jpg 9 29 | Real/Candles/00056.jpg 9 30 | Real/Candles/00082.jpg 9 31 | Real/Chair/00019.jpg 10 32 | Real/Chair/00054.jpg 10 33 | Real/Chair/00037.jpg 10 34 | Real/Clipboards/00015.jpg 11 35 | Real/Clipboards/00021.jpg 11 36 | Real/Clipboards/00013.jpg 11 37 | Real/Computer/00011.jpg 12 38 | Real/Computer/00022.jpg 12 39 | Real/Computer/00044.jpg 12 40 | Real/Couch/00027.jpg 13 41 | Real/Couch/00074.jpg 13 42 | Real/Couch/00049.jpg 13 43 | Real/Curtains/00045.jpg 14 44 | Real/Curtains/00065.jpg 14 45 | Real/Curtains/00033.jpg 14 46 | Real/Desk_Lamp/00011.jpg 15 47 | Real/Desk_Lamp/00034.jpg 15 48 | Real/Desk_Lamp/00007.jpg 15 49 | Real/Drill/00016.jpg 16 50 | Real/Drill/00032.jpg 16 51 | Real/Drill/00007.jpg 16 52 | Real/Eraser/00042.jpg 17 53 | Real/Eraser/00026.jpg 17 54 | Real/Eraser/00012.jpg 17 55 | Real/Exit_Sign/00042.jpg 18 56 | Real/Exit_Sign/00024.jpg 18 57 | Real/Exit_Sign/00005.jpg 18 58 | Real/Fan/00049.jpg 19 59 | Real/Fan/00059.jpg 19 60 | Real/Fan/00050.jpg 19 61 | Real/File_Cabinet/00034.jpg 20 62 | Real/File_Cabinet/00035.jpg 20 63 | Real/File_Cabinet/00021.jpg 20 64 | Real/Flipflops/00072.jpg 21 65 | Real/Flipflops/00048.jpg 21 66 | Real/Flipflops/00077.jpg 21 67 | Real/Flowers/00024.jpg 22 68 | Real/Flowers/00009.jpg 22 69 | Real/Flowers/00005.jpg 22 70 | Real/Folder/00053.jpg 23 71 | Real/Folder/00039.jpg 23 72 | Real/Folder/00044.jpg 23 73 | Real/Fork/00023.jpg 24 74 | Real/Fork/00012.jpg 24 75 | Real/Fork/00017.jpg 24 76 | Real/Glasses/00002.jpg 25 77 | Real/Glasses/00057.jpg 25 78 | Real/Glasses/00053.jpg 25 79 | Real/Hammer/00040.jpg 26 80 | Real/Hammer/00041.jpg 26 81 | Real/Hammer/00032.jpg 26 82 | Real/Helmet/00027.jpg 27 83 | Real/Helmet/00015.jpg 27 84 | Real/Helmet/00020.jpg 27 85 | Real/Kettle/00017.jpg 28 86 | Real/Kettle/00068.jpg 28 87 | Real/Kettle/00056.jpg 28 88 | Real/Keyboard/00004.jpg 29 89 | Real/Keyboard/00075.jpg 29 90 | Real/Keyboard/00005.jpg 29 91 | Real/Knives/00021.jpg 30 92 | Real/Knives/00055.jpg 30 93 | Real/Knives/00079.jpg 30 94 | Real/Lamp_Shade/00028.jpg 31 95 | Real/Lamp_Shade/00060.jpg 31 96 | Real/Lamp_Shade/00075.jpg 31 97 | Real/Laptop/00036.jpg 32 98 | Real/Laptop/00057.jpg 32 99 | Real/Laptop/00044.jpg 32 100 | Real/Marker/00009.jpg 33 101 | Real/Marker/00010.jpg 33 102 | Real/Marker/00001.jpg 33 103 | Real/Monitor/00066.jpg 34 104 | Real/Monitor/00014.jpg 34 105 | Real/Monitor/00061.jpg 34 106 | Real/Mop/00033.jpg 35 107 | Real/Mop/00041.jpg 35 108 | Real/Mop/00001.jpg 35 109 | Real/Mouse/00043.jpg 36 110 | Real/Mouse/00009.jpg 36 111 | Real/Mouse/00006.jpg 36 112 | Real/Mug/00057.jpg 37 113 | Real/Mug/00048.jpg 37 114 | Real/Mug/00022.jpg 37 115 | Real/Notebook/00009.jpg 38 116 | Real/Notebook/00053.jpg 38 117 | Real/Notebook/00047.jpg 38 118 | Real/Oven/00050.jpg 39 119 | Real/Oven/00005.jpg 39 120 | Real/Oven/00037.jpg 39 121 | Real/Pan/00002.jpg 40 122 | Real/Pan/00028.jpg 40 123 | Real/Pan/00017.jpg 40 124 | Real/Paper_Clip/00063.jpg 41 125 | Real/Paper_Clip/00005.jpg 41 126 | Real/Paper_Clip/00020.jpg 41 127 | Real/Pen/00051.jpg 42 128 | Real/Pen/00008.jpg 42 129 | Real/Pen/00049.jpg 42 130 | Real/Pencil/00023.jpg 43 131 | Real/Pencil/00022.jpg 43 132 | Real/Pencil/00025.jpg 43 133 | Real/Postit_Notes/00017.jpg 44 134 | Real/Postit_Notes/00046.jpg 44 135 | Real/Postit_Notes/00060.jpg 44 136 | Real/Printer/00035.jpg 45 137 | Real/Printer/00002.jpg 45 138 | Real/Printer/00037.jpg 45 139 | Real/Push_Pin/00027.jpg 46 140 | Real/Push_Pin/00024.jpg 46 141 | Real/Push_Pin/00040.jpg 46 142 | Real/Radio/00039.jpg 47 143 | Real/Radio/00030.jpg 47 144 | Real/Radio/00054.jpg 47 145 | Real/Refrigerator/00031.jpg 48 146 | Real/Refrigerator/00069.jpg 48 147 | Real/Refrigerator/00045.jpg 48 148 | Real/Ruler/00010.jpg 49 149 | Real/Ruler/00011.jpg 49 150 | Real/Ruler/00033.jpg 49 151 | Real/Scissors/00023.jpg 50 152 | Real/Scissors/00058.jpg 50 153 | Real/Scissors/00074.jpg 50 154 | Real/Screwdriver/00024.jpg 51 155 | Real/Screwdriver/00051.jpg 51 156 | Real/Screwdriver/00031.jpg 51 157 | Real/Shelf/00049.jpg 52 158 | Real/Shelf/00025.jpg 52 159 | Real/Shelf/00044.jpg 52 160 | Real/Sink/00070.jpg 53 161 | Real/Sink/00011.jpg 53 162 | Real/Sink/00073.jpg 53 163 | Real/Sneakers/00011.jpg 54 164 | Real/Sneakers/00073.jpg 54 165 | Real/Sneakers/00027.jpg 54 166 | Real/Soda/00062.jpg 55 167 | Real/Soda/00016.jpg 55 168 | Real/Soda/00027.jpg 55 169 | Real/Speaker/00032.jpg 56 170 | Real/Speaker/00075.jpg 56 171 | Real/Speaker/00079.jpg 56 172 | Real/Spoon/00038.jpg 57 173 | Real/Spoon/00040.jpg 57 174 | Real/Spoon/00045.jpg 57 175 | Real/Table/00001.jpg 58 176 | Real/Table/00021.jpg 58 177 | Real/Table/00002.jpg 58 178 | Real/Telephone/00008.jpg 59 179 | Real/Telephone/00032.jpg 59 180 | Real/Telephone/00051.jpg 59 181 | Real/ToothBrush/00065.jpg 60 182 | Real/ToothBrush/00028.jpg 60 183 | Real/ToothBrush/00006.jpg 60 184 | Real/Toys/00016.jpg 61 185 | Real/Toys/00051.jpg 61 186 | Real/Toys/00059.jpg 61 187 | Real/Trash_Can/00027.jpg 62 188 | Real/Trash_Can/00046.jpg 62 189 | Real/Trash_Can/00028.jpg 62 190 | Real/TV/00039.jpg 63 191 | Real/TV/00018.jpg 63 192 | Real/TV/00052.jpg 63 193 | Real/Webcam/00049.jpg 64 194 | Real/Webcam/00039.jpg 64 195 | Real/Webcam/00044.jpg 64 196 | -------------------------------------------------------------------------------- /data/txt/multi/labeled_target_images_painting_1.txt: -------------------------------------------------------------------------------- 1 | painting/aircraft_carrier/painting_001_000113.jpg 0 2 | painting/alarm_clock/painting_003_000064.jpg 1 3 | painting/ant/painting_007_000234.jpg 2 4 | painting/anvil/painting_008_000082.jpg 3 5 | painting/asparagus/painting_011_000316.jpg 4 6 | painting/axe/painting_012_000050.jpg 5 7 | painting/banana/painting_014_000196.jpg 6 8 | painting/basket/painting_019_000115.jpg 7 9 | painting/bathtub/painting_022_000024.jpg 8 10 | painting/bear/painting_024_000140.jpg 9 11 | painting/bee/painting_027_000289.jpg 10 12 | painting/bird/painting_032_000022.jpg 11 13 | painting/blackberry/painting_034_000001.jpg 12 14 | painting/blueberry/painting_035_000029.jpg 13 15 | painting/bottlecap/painting_038_000299.jpg 14 16 | painting/broccoli/painting_044_000045.jpg 15 17 | painting/bus/painting_048_000055.jpg 16 18 | painting/butterfly/painting_050_000298.jpg 17 19 | painting/cactus/painting_051_000071.jpg 18 20 | painting/cake/painting_052_000062.jpg 19 21 | painting/calculator/painting_053_000006.jpg 20 22 | painting/camel/painting_055_000078.jpg 21 23 | painting/camera/painting_056_000010.jpg 22 24 | painting/candle/painting_059_000180.jpg 23 25 | painting/cannon/painting_060_000048.jpg 24 26 | painting/canoe/painting_061_000027.jpg 25 27 | painting/carrot/painting_063_000090.jpg 26 28 | painting/castle/painting_064_000113.jpg 27 29 | painting/cat/painting_065_000327.jpg 28 30 | painting/ceiling_fan/painting_066_000013.jpg 29 31 | painting/cello/painting_067_000149.jpg 30 32 | painting/cell_phone/painting_068_000049.jpg 31 33 | painting/chair/painting_069_000004.jpg 32 34 | painting/chandelier/painting_070_000043.jpg 33 35 | painting/coffee_cup/painting_076_000089.jpg 34 36 | painting/compass/painting_077_000030.jpg 35 37 | painting/computer/painting_078_000012.jpg 36 38 | painting/cow/painting_082_000082.jpg 37 39 | painting/crab/painting_083_000046.jpg 38 40 | painting/crocodile/painting_085_000115.jpg 39 41 | painting/cruise_ship/painting_087_000159.jpg 40 42 | painting/dog/painting_092_000702.jpg 41 43 | painting/dolphin/painting_093_000209.jpg 42 44 | painting/dragon/painting_096_000036.jpg 43 45 | painting/drums/painting_099_000102.jpg 44 46 | painting/duck/painting_100_000148.jpg 45 47 | painting/dumbbell/painting_101_000117.jpg 46 48 | painting/elephant/painting_104_000159.jpg 47 49 | painting/eyeglasses/painting_108_000067.jpg 48 50 | painting/feather/painting_111_000341.jpg 49 51 | painting/fence/painting_112_000037.jpg 50 52 | painting/fish/painting_117_000046.jpg 51 53 | painting/flamingo/painting_118_000048.jpg 52 54 | painting/flower/painting_122_000197.jpg 53 55 | painting/foot/painting_124_000027.jpg 54 56 | painting/fork/painting_125_000074.jpg 55 57 | painting/frog/painting_126_000065.jpg 56 58 | painting/giraffe/painting_130_000073.jpg 57 59 | painting/goatee/painting_131_000047.jpg 58 60 | painting/grapes/painting_133_000105.jpg 59 61 | painting/guitar/painting_135_000176.jpg 60 62 | painting/hammer/painting_137_000002.jpg 61 63 | painting/helicopter/painting_143_000025.jpg 62 64 | painting/helmet/painting_144_000018.jpg 63 65 | painting/horse/painting_148_000447.jpg 64 66 | painting/kangaroo/painting_160_000055.jpg 65 67 | painting/lantern/painting_166_000191.jpg 66 68 | painting/laptop/painting_167_000039.jpg 67 69 | painting/leaf/painting_168_000389.jpg 68 70 | painting/lion/painting_175_000172.jpg 69 71 | painting/lipstick/painting_176_000097.jpg 70 72 | painting/lobster/painting_177_000251.jpg 71 73 | painting/microphone/painting_185_000121.jpg 72 74 | painting/monkey/painting_187_000310.jpg 73 75 | painting/mosquito/painting_189_000012.jpg 74 76 | painting/mouse/painting_192_000433.jpg 75 77 | painting/mug/painting_195_000420.jpg 76 78 | painting/mushroom/painting_196_000155.jpg 77 79 | painting/onion/painting_203_000067.jpg 78 80 | painting/panda/painting_209_000028.jpg 79 81 | painting/peanut/painting_215_000065.jpg 80 82 | painting/pear/painting_216_000369.jpg 81 83 | painting/peas/painting_217_000076.jpg 82 84 | painting/pencil/painting_218_000104.jpg 83 85 | painting/penguin/painting_219_000205.jpg 84 86 | painting/pig/painting_223_000226.jpg 85 87 | painting/pillow/painting_224_000114.jpg 86 88 | painting/pineapple/painting_225_000132.jpg 87 89 | painting/potato/painting_233_000028.jpg 88 90 | painting/power_outlet/painting_234_000072.jpg 89 91 | painting/purse/painting_235_000024.jpg 90 92 | painting/rabbit/painting_236_000149.jpg 91 93 | painting/raccoon/painting_237_000128.jpg 92 94 | painting/rhinoceros/painting_243_000088.jpg 93 95 | painting/rifle/painting_244_000120.jpg 94 96 | painting/saxophone/painting_251_000031.jpg 95 97 | painting/screwdriver/painting_255_000068.jpg 96 98 | painting/sea_turtle/painting_256_000196.jpg 97 99 | painting/see_saw/painting_257_000025.jpg 98 100 | painting/sheep/painting_259_000314.jpg 99 101 | painting/shoe/painting_260_000198.jpg 100 102 | painting/skateboard/painting_264_000069.jpg 101 103 | painting/snake/painting_270_000263.jpg 102 104 | painting/speedboat/painting_276_000029.jpg 103 105 | painting/spider/painting_277_000088.jpg 104 106 | painting/squirrel/painting_282_000766.jpg 105 107 | painting/strawberry/painting_291_000073.jpg 106 108 | painting/streetlight/painting_292_000208.jpg 107 109 | painting/string_bean/painting_293_000044.jpg 108 110 | painting/submarine/painting_294_000115.jpg 109 111 | painting/swan/painting_297_000285.jpg 110 112 | painting/table/painting_302_000037.jpg 111 113 | painting/teapot/painting_303_000122.jpg 112 114 | painting/teddy-bear/painting_304_000120.jpg 113 115 | painting/television/painting_306_000049.jpg 114 116 | painting/The_Eiffel_Tower/painting_309_000115.jpg 115 117 | painting/The_Great_Wall_of_China/painting_310_000028.jpg 116 118 | painting/tiger/painting_312_000129.jpg 117 119 | painting/toe/painting_314_000001.jpg 118 120 | painting/train/painting_322_000212.jpg 119 121 | painting/truck/painting_326_000082.jpg 120 122 | painting/umbrella/painting_329_000236.jpg 121 123 | painting/vase/painting_332_000224.jpg 122 124 | painting/watermelon/painting_335_000235.jpg 123 125 | painting/whale/painting_337_000324.jpg 124 126 | painting/zebra/painting_344_000155.jpg 125 127 | -------------------------------------------------------------------------------- /data/txt/office_home/labeled_target_images_Clipart_3.txt: -------------------------------------------------------------------------------- 1 | Clipart/Alarm_Clock/00055.jpg 0 2 | Clipart/Alarm_Clock/00017.jpg 0 3 | Clipart/Alarm_Clock/00009.jpg 0 4 | Clipart/Backpack/00021.jpg 1 5 | Clipart/Backpack/00042.jpg 1 6 | Clipart/Backpack/00044.jpg 1 7 | Clipart/Batteries/00043.jpg 2 8 | Clipart/Batteries/00013.jpg 2 9 | Clipart/Batteries/00012.jpg 2 10 | Clipart/Bed/00005.jpg 3 11 | Clipart/Bed/00016.jpg 3 12 | Clipart/Bed/00021.jpg 3 13 | Clipart/Bike/00023.jpg 4 14 | Clipart/Bike/00046.jpg 4 15 | Clipart/Bike/00010.jpg 4 16 | Clipart/Bottle/00043.jpg 5 17 | Clipart/Bottle/00006.jpg 5 18 | Clipart/Bottle/00017.jpg 5 19 | Clipart/Bucket/00062.jpg 6 20 | Clipart/Bucket/00009.jpg 6 21 | Clipart/Bucket/00029.jpg 6 22 | Clipart/Calculator/00030.jpg 7 23 | Clipart/Calculator/00012.jpg 7 24 | Clipart/Calculator/00044.jpg 7 25 | Clipart/Calendar/00002.jpg 8 26 | Clipart/Calendar/00049.jpg 8 27 | Clipart/Calendar/00018.jpg 8 28 | Clipart/Candles/00043.jpg 9 29 | Clipart/Candles/00076.jpg 9 30 | Clipart/Candles/00038.jpg 9 31 | Clipart/Chair/00068.jpg 10 32 | Clipart/Chair/00047.jpg 10 33 | Clipart/Chair/00070.jpg 10 34 | Clipart/Clipboards/00010.jpg 11 35 | Clipart/Clipboards/00004.jpg 11 36 | Clipart/Clipboards/00018.jpg 11 37 | Clipart/Computer/00070.jpg 12 38 | Clipart/Computer/00022.jpg 12 39 | Clipart/Computer/00019.jpg 12 40 | Clipart/Couch/00041.jpg 13 41 | Clipart/Couch/00043.jpg 13 42 | Clipart/Couch/00017.jpg 13 43 | Clipart/Curtains/00007.jpg 14 44 | Clipart/Curtains/00004.jpg 14 45 | Clipart/Curtains/00011.jpg 14 46 | Clipart/Desk_Lamp/00035.jpg 15 47 | Clipart/Desk_Lamp/00017.jpg 15 48 | Clipart/Desk_Lamp/00032.jpg 15 49 | Clipart/Drill/00039.jpg 16 50 | Clipart/Drill/00012.jpg 16 51 | Clipart/Drill/00030.jpg 16 52 | Clipart/Eraser/00021.jpg 17 53 | Clipart/Eraser/00017.jpg 17 54 | Clipart/Eraser/00001.jpg 17 55 | Clipart/Exit_Sign/00037.jpg 18 56 | Clipart/Exit_Sign/00018.jpg 18 57 | Clipart/Exit_Sign/00015.jpg 18 58 | Clipart/Fan/00005.jpg 19 59 | Clipart/Fan/00012.jpg 19 60 | Clipart/Fan/00036.jpg 19 61 | Clipart/File_Cabinet/00011.jpg 20 62 | Clipart/File_Cabinet/00035.jpg 20 63 | Clipart/File_Cabinet/00004.jpg 20 64 | Clipart/Flipflops/00027.jpg 21 65 | Clipart/Flipflops/00022.jpg 21 66 | Clipart/Flipflops/00024.jpg 21 67 | Clipart/Flowers/00047.jpg 22 68 | Clipart/Flowers/00040.jpg 22 69 | Clipart/Flowers/00050.jpg 22 70 | Clipart/Folder/00010.jpg 23 71 | Clipart/Folder/00094.jpg 23 72 | Clipart/Folder/00034.jpg 23 73 | Clipart/Fork/00049.jpg 24 74 | Clipart/Fork/00031.jpg 24 75 | Clipart/Fork/00044.jpg 24 76 | Clipart/Glasses/00022.jpg 25 77 | Clipart/Glasses/00028.jpg 25 78 | Clipart/Glasses/00017.jpg 25 79 | Clipart/Hammer/00097.jpg 26 80 | Clipart/Hammer/00056.jpg 26 81 | Clipart/Hammer/00075.jpg 26 82 | Clipart/Helmet/00050.jpg 27 83 | Clipart/Helmet/00060.jpg 27 84 | Clipart/Helmet/00007.jpg 27 85 | Clipart/Kettle/00029.jpg 28 86 | Clipart/Kettle/00021.jpg 28 87 | Clipart/Kettle/00039.jpg 28 88 | Clipart/Keyboard/00086.jpg 29 89 | Clipart/Keyboard/00038.jpg 29 90 | Clipart/Keyboard/00088.jpg 29 91 | Clipart/Knives/00030.jpg 30 92 | Clipart/Knives/00016.jpg 30 93 | Clipart/Knives/00053.jpg 30 94 | Clipart/Lamp_Shade/00026.jpg 31 95 | Clipart/Lamp_Shade/00011.jpg 31 96 | Clipart/Lamp_Shade/00009.jpg 31 97 | Clipart/Laptop/00016.jpg 32 98 | Clipart/Laptop/00024.jpg 32 99 | Clipart/Laptop/00048.jpg 32 100 | Clipart/Marker/00017.jpg 33 101 | Clipart/Marker/00064.jpg 33 102 | Clipart/Marker/00037.jpg 33 103 | Clipart/Monitor/00058.jpg 34 104 | Clipart/Monitor/00062.jpg 34 105 | Clipart/Monitor/00070.jpg 34 106 | Clipart/Mop/00032.jpg 35 107 | Clipart/Mop/00036.jpg 35 108 | Clipart/Mop/00006.jpg 35 109 | Clipart/Mouse/00027.jpg 36 110 | Clipart/Mouse/00042.jpg 36 111 | Clipart/Mouse/00020.jpg 36 112 | Clipart/Mug/00048.jpg 37 113 | Clipart/Mug/00040.jpg 37 114 | Clipart/Mug/00088.jpg 37 115 | Clipart/Notebook/00019.jpg 38 116 | Clipart/Notebook/00039.jpg 38 117 | Clipart/Notebook/00053.jpg 38 118 | Clipart/Oven/00007.jpg 39 119 | Clipart/Oven/00018.jpg 39 120 | Clipart/Oven/00029.jpg 39 121 | Clipart/Pan/00044.jpg 40 122 | Clipart/Pan/00024.jpg 40 123 | Clipart/Pan/00007.jpg 40 124 | Clipart/Paper_Clip/00022.jpg 41 125 | Clipart/Paper_Clip/00001.jpg 41 126 | Clipart/Paper_Clip/00027.jpg 41 127 | Clipart/Pen/00005.jpg 42 128 | Clipart/Pen/00033.jpg 42 129 | Clipart/Pen/00016.jpg 42 130 | Clipart/Pencil/00084.jpg 43 131 | Clipart/Pencil/00050.jpg 43 132 | Clipart/Pencil/00048.jpg 43 133 | Clipart/Postit_Notes/00004.jpg 44 134 | Clipart/Postit_Notes/00038.jpg 44 135 | Clipart/Postit_Notes/00001.jpg 44 136 | Clipart/Printer/00078.jpg 45 137 | Clipart/Printer/00024.jpg 45 138 | Clipart/Printer/00071.jpg 45 139 | Clipart/Push_Pin/00019.jpg 46 140 | Clipart/Push_Pin/00024.jpg 46 141 | Clipart/Push_Pin/00040.jpg 46 142 | Clipart/Radio/00033.jpg 47 143 | Clipart/Radio/00018.jpg 47 144 | Clipart/Radio/00038.jpg 47 145 | Clipart/Refrigerator/00011.jpg 48 146 | Clipart/Refrigerator/00013.jpg 48 147 | Clipart/Refrigerator/00025.jpg 48 148 | Clipart/Ruler/00062.jpg 49 149 | Clipart/Ruler/00004.jpg 49 150 | Clipart/Ruler/00049.jpg 49 151 | Clipart/Scissors/00095.jpg 50 152 | Clipart/Scissors/00077.jpg 50 153 | Clipart/Scissors/00091.jpg 50 154 | Clipart/Screwdriver/00069.jpg 51 155 | Clipart/Screwdriver/00044.jpg 51 156 | Clipart/Screwdriver/00057.jpg 51 157 | Clipart/Shelf/00033.jpg 52 158 | Clipart/Shelf/00017.jpg 52 159 | Clipart/Shelf/00030.jpg 52 160 | Clipart/Sink/00013.jpg 53 161 | Clipart/Sink/00027.jpg 53 162 | Clipart/Sink/00018.jpg 53 163 | Clipart/Sneakers/00017.jpg 54 164 | Clipart/Sneakers/00008.jpg 54 165 | Clipart/Sneakers/00013.jpg 54 166 | Clipart/Soda/00012.jpg 55 167 | Clipart/Soda/00030.jpg 55 168 | Clipart/Soda/00047.jpg 55 169 | Clipart/Speaker/00054.jpg 56 170 | Clipart/Speaker/00027.jpg 56 171 | Clipart/Speaker/00052.jpg 56 172 | Clipart/Spoon/00025.jpg 57 173 | Clipart/Spoon/00057.jpg 57 174 | Clipart/Spoon/00001.jpg 57 175 | Clipart/Table/00039.jpg 58 176 | Clipart/Table/00063.jpg 58 177 | Clipart/Table/00027.jpg 58 178 | Clipart/Telephone/00035.jpg 59 179 | Clipart/Telephone/00004.jpg 59 180 | Clipart/Telephone/00082.jpg 59 181 | Clipart/ToothBrush/00011.jpg 60 182 | Clipart/ToothBrush/00012.jpg 60 183 | Clipart/ToothBrush/00024.jpg 60 184 | Clipart/Toys/00003.jpg 61 185 | Clipart/Toys/00025.jpg 61 186 | Clipart/Toys/00013.jpg 61 187 | Clipart/Trash_Can/00004.jpg 62 188 | Clipart/Trash_Can/00007.jpg 62 189 | Clipart/Trash_Can/00002.jpg 62 190 | Clipart/TV/00005.jpg 63 191 | Clipart/TV/00004.jpg 63 192 | Clipart/TV/00074.jpg 63 193 | Clipart/Webcam/00019.jpg 64 194 | Clipart/Webcam/00028.jpg 64 195 | Clipart/Webcam/00012.jpg 64 196 | -------------------------------------------------------------------------------- /data/txt/office_home/labeled_target_images_Product_3.txt: -------------------------------------------------------------------------------- 1 | Product/Alarm_Clock/00078.jpg 0 2 | Product/Alarm_Clock/00062.jpg 0 3 | Product/Alarm_Clock/00053.jpg 0 4 | Product/Backpack/00001.jpg 1 5 | Product/Backpack/00025.jpg 1 6 | Product/Backpack/00060.jpg 1 7 | Product/Batteries/00043.jpg 2 8 | Product/Batteries/00025.jpg 2 9 | Product/Batteries/00029.jpg 2 10 | Product/Bed/00012.jpg 3 11 | Product/Bed/00034.jpg 3 12 | Product/Bed/00017.jpg 3 13 | Product/Bike/00002.jpg 4 14 | Product/Bike/00029.jpg 4 15 | Product/Bike/00020.jpg 4 16 | Product/Bottle/00052.jpg 5 17 | Product/Bottle/00036.jpg 5 18 | Product/Bottle/00034.jpg 5 19 | Product/Bucket/00042.jpg 6 20 | Product/Bucket/00044.jpg 6 21 | Product/Bucket/00004.jpg 6 22 | Product/Calculator/00055.jpg 7 23 | Product/Calculator/00065.jpg 7 24 | Product/Calculator/00069.jpg 7 25 | Product/Calendar/00020.jpg 8 26 | Product/Calendar/00027.jpg 8 27 | Product/Calendar/00034.jpg 8 28 | Product/Candles/00012.jpg 9 29 | Product/Candles/00047.jpg 9 30 | Product/Candles/00051.jpg 9 31 | Product/Chair/00001.jpg 10 32 | Product/Chair/00060.jpg 10 33 | Product/Chair/00018.jpg 10 34 | Product/Clipboards/00064.jpg 11 35 | Product/Clipboards/00007.jpg 11 36 | Product/Clipboards/00015.jpg 11 37 | Product/Computer/00092.jpg 12 38 | Product/Computer/00069.jpg 12 39 | Product/Computer/00006.jpg 12 40 | Product/Couch/00056.jpg 13 41 | Product/Couch/00042.jpg 13 42 | Product/Couch/00003.jpg 13 43 | Product/Curtains/00024.jpg 14 44 | Product/Curtains/00048.jpg 14 45 | Product/Curtains/00041.jpg 14 46 | Product/Desk_Lamp/00017.jpg 15 47 | Product/Desk_Lamp/00012.jpg 15 48 | Product/Desk_Lamp/00039.jpg 15 49 | Product/Drill/00064.jpg 16 50 | Product/Drill/00017.jpg 16 51 | Product/Drill/00030.jpg 16 52 | Product/Eraser/00009.jpg 17 53 | Product/Eraser/00024.jpg 17 54 | Product/Eraser/00019.jpg 17 55 | Product/Exit_Sign/00044.jpg 18 56 | Product/Exit_Sign/00002.jpg 18 57 | Product/Exit_Sign/00056.jpg 18 58 | Product/Fan/00033.jpg 19 59 | Product/Fan/00026.jpg 19 60 | Product/Fan/00048.jpg 19 61 | Product/File_Cabinet/00039.jpg 20 62 | Product/File_Cabinet/00004.jpg 20 63 | Product/File_Cabinet/00025.jpg 20 64 | Product/Flipflops/00055.jpg 21 65 | Product/Flipflops/00052.jpg 21 66 | Product/Flipflops/00059.jpg 21 67 | Product/Flowers/00079.jpg 22 68 | Product/Flowers/00029.jpg 22 69 | Product/Flowers/00010.jpg 22 70 | Product/Folder/00084.jpg 23 71 | Product/Folder/00033.jpg 23 72 | Product/Folder/00047.jpg 23 73 | Product/Fork/00030.jpg 24 74 | Product/Fork/00036.jpg 24 75 | Product/Fork/00041.jpg 24 76 | Product/Glasses/00012.jpg 25 77 | Product/Glasses/00061.jpg 25 78 | Product/Glasses/00043.jpg 25 79 | Product/Hammer/00020.jpg 26 80 | Product/Hammer/00035.jpg 26 81 | Product/Hammer/00053.jpg 26 82 | Product/Helmet/00086.jpg 27 83 | Product/Helmet/00056.jpg 27 84 | Product/Helmet/00050.jpg 27 85 | Product/Kettle/00040.jpg 28 86 | Product/Kettle/00042.jpg 28 87 | Product/Kettle/00052.jpg 28 88 | Product/Keyboard/00081.jpg 29 89 | Product/Keyboard/00068.jpg 29 90 | Product/Keyboard/00011.jpg 29 91 | Product/Knives/00027.jpg 30 92 | Product/Knives/00010.jpg 30 93 | Product/Knives/00016.jpg 30 94 | Product/Lamp_Shade/00031.jpg 31 95 | Product/Lamp_Shade/00033.jpg 31 96 | Product/Lamp_Shade/00006.jpg 31 97 | Product/Laptop/00045.jpg 32 98 | Product/Laptop/00074.jpg 32 99 | Product/Laptop/00098.jpg 32 100 | Product/Marker/00035.jpg 33 101 | Product/Marker/00050.jpg 33 102 | Product/Marker/00044.jpg 33 103 | Product/Monitor/00085.jpg 34 104 | Product/Monitor/00061.jpg 34 105 | Product/Monitor/00025.jpg 34 106 | Product/Mop/00060.jpg 35 107 | Product/Mop/00064.jpg 35 108 | Product/Mop/00007.jpg 35 109 | Product/Mouse/00061.jpg 36 110 | Product/Mouse/00018.jpg 36 111 | Product/Mouse/00008.jpg 36 112 | Product/Mug/00004.jpg 37 113 | Product/Mug/00018.jpg 37 114 | Product/Mug/00001.jpg 37 115 | Product/Notebook/00063.jpg 38 116 | Product/Notebook/00057.jpg 38 117 | Product/Notebook/00034.jpg 38 118 | Product/Oven/00052.jpg 39 119 | Product/Oven/00045.jpg 39 120 | Product/Oven/00011.jpg 39 121 | Product/Pan/00031.jpg 40 122 | Product/Pan/00066.jpg 40 123 | Product/Pan/00011.jpg 40 124 | Product/Paper_Clip/00008.jpg 41 125 | Product/Paper_Clip/00020.jpg 41 126 | Product/Paper_Clip/00043.jpg 41 127 | Product/Pen/00006.jpg 42 128 | Product/Pen/00052.jpg 42 129 | Product/Pen/00005.jpg 42 130 | Product/Pencil/00005.jpg 43 131 | Product/Pencil/00014.jpg 43 132 | Product/Pencil/00027.jpg 43 133 | Product/Postit_Notes/00010.jpg 44 134 | Product/Postit_Notes/00030.jpg 44 135 | Product/Postit_Notes/00027.jpg 44 136 | Product/Printer/00020.jpg 45 137 | Product/Printer/00016.jpg 45 138 | Product/Printer/00019.jpg 45 139 | Product/Push_Pin/00037.jpg 46 140 | Product/Push_Pin/00015.jpg 46 141 | Product/Push_Pin/00030.jpg 46 142 | Product/Radio/00024.jpg 47 143 | Product/Radio/00001.jpg 47 144 | Product/Radio/00007.jpg 47 145 | Product/Refrigerator/00016.jpg 48 146 | Product/Refrigerator/00058.jpg 48 147 | Product/Refrigerator/00053.jpg 48 148 | Product/Ruler/00054.jpg 49 149 | Product/Ruler/00047.jpg 49 150 | Product/Ruler/00029.jpg 49 151 | Product/Scissors/00043.jpg 50 152 | Product/Scissors/00037.jpg 50 153 | Product/Scissors/00017.jpg 50 154 | Product/Screwdriver/00039.jpg 51 155 | Product/Screwdriver/00040.jpg 51 156 | Product/Screwdriver/00003.jpg 51 157 | Product/Shelf/00003.jpg 52 158 | Product/Shelf/00018.jpg 52 159 | Product/Shelf/00035.jpg 52 160 | Product/Sink/00024.jpg 53 161 | Product/Sink/00035.jpg 53 162 | Product/Sink/00043.jpg 53 163 | Product/Sneakers/00071.jpg 54 164 | Product/Sneakers/00026.jpg 54 165 | Product/Sneakers/00094.jpg 54 166 | Product/Soda/00020.jpg 55 167 | Product/Soda/00004.jpg 55 168 | Product/Soda/00018.jpg 55 169 | Product/Speaker/00041.jpg 56 170 | Product/Speaker/00021.jpg 56 171 | Product/Speaker/00092.jpg 56 172 | Product/Spoon/00002.jpg 57 173 | Product/Spoon/00043.jpg 57 174 | Product/Spoon/00044.jpg 57 175 | Product/Table/00019.jpg 58 176 | Product/Table/00018.jpg 58 177 | Product/Table/00001.jpg 58 178 | Product/Telephone/00027.jpg 59 179 | Product/Telephone/00022.jpg 59 180 | Product/Telephone/00024.jpg 59 181 | Product/ToothBrush/00009.jpg 60 182 | Product/ToothBrush/00010.jpg 60 183 | Product/ToothBrush/00037.jpg 60 184 | Product/Toys/00034.jpg 61 185 | Product/Toys/00003.jpg 61 186 | Product/Toys/00026.jpg 61 187 | Product/Trash_Can/00024.jpg 62 188 | Product/Trash_Can/00012.jpg 62 189 | Product/Trash_Can/00054.jpg 62 190 | Product/TV/00027.jpg 63 191 | Product/TV/00059.jpg 63 192 | Product/TV/00069.jpg 63 193 | Product/Webcam/00038.jpg 64 194 | Product/Webcam/00069.jpg 64 195 | Product/Webcam/00040.jpg 64 196 | -------------------------------------------------------------------------------- /data/txt/office_home/validation_target_images_Clipart_3.txt: -------------------------------------------------------------------------------- 1 | Clipart/Alarm_Clock/00022.jpg 0 2 | Clipart/Alarm_Clock/00021.jpg 0 3 | Clipart/Alarm_Clock/00005.jpg 0 4 | Clipart/Backpack/00029.jpg 1 5 | Clipart/Backpack/00023.jpg 1 6 | Clipart/Backpack/00036.jpg 1 7 | Clipart/Batteries/00063.jpg 2 8 | Clipart/Batteries/00023.jpg 2 9 | Clipart/Batteries/00027.jpg 2 10 | Clipart/Bed/00059.jpg 3 11 | Clipart/Bed/00026.jpg 3 12 | Clipart/Bed/00088.jpg 3 13 | Clipart/Bike/00072.jpg 4 14 | Clipart/Bike/00040.jpg 4 15 | Clipart/Bike/00001.jpg 4 16 | Clipart/Bottle/00037.jpg 5 17 | Clipart/Bottle/00005.jpg 5 18 | Clipart/Bottle/00090.jpg 5 19 | Clipart/Bucket/00032.jpg 6 20 | Clipart/Bucket/00035.jpg 6 21 | Clipart/Bucket/00007.jpg 6 22 | Clipart/Calculator/00003.jpg 7 23 | Clipart/Calculator/00002.jpg 7 24 | Clipart/Calculator/00024.jpg 7 25 | Clipart/Calendar/00031.jpg 8 26 | Clipart/Calendar/00024.jpg 8 27 | Clipart/Calendar/00073.jpg 8 28 | Clipart/Candles/00092.jpg 9 29 | Clipart/Candles/00022.jpg 9 30 | Clipart/Candles/00071.jpg 9 31 | Clipart/Chair/00015.jpg 10 32 | Clipart/Chair/00050.jpg 10 33 | Clipart/Chair/00097.jpg 10 34 | Clipart/Clipboards/00015.jpg 11 35 | Clipart/Clipboards/00007.jpg 11 36 | Clipart/Clipboards/00040.jpg 11 37 | Clipart/Computer/00058.jpg 12 38 | Clipart/Computer/00055.jpg 12 39 | Clipart/Computer/00005.jpg 12 40 | Clipart/Couch/00033.jpg 13 41 | Clipart/Couch/00004.jpg 13 42 | Clipart/Couch/00027.jpg 13 43 | Clipart/Curtains/00029.jpg 14 44 | Clipart/Curtains/00003.jpg 14 45 | Clipart/Curtains/00033.jpg 14 46 | Clipart/Desk_Lamp/00040.jpg 15 47 | Clipart/Desk_Lamp/00013.jpg 15 48 | Clipart/Desk_Lamp/00036.jpg 15 49 | Clipart/Drill/00016.jpg 16 50 | Clipart/Drill/00022.jpg 16 51 | Clipart/Drill/00005.jpg 16 52 | Clipart/Eraser/00027.jpg 17 53 | Clipart/Eraser/00034.jpg 17 54 | Clipart/Eraser/00035.jpg 17 55 | Clipart/Exit_Sign/00014.jpg 18 56 | Clipart/Exit_Sign/00006.jpg 18 57 | Clipart/Exit_Sign/00003.jpg 18 58 | Clipart/Fan/00002.jpg 19 59 | Clipart/Fan/00025.jpg 19 60 | Clipart/Fan/00007.jpg 19 61 | Clipart/File_Cabinet/00002.jpg 20 62 | Clipart/File_Cabinet/00010.jpg 20 63 | Clipart/File_Cabinet/00003.jpg 20 64 | Clipart/Flipflops/00033.jpg 21 65 | Clipart/Flipflops/00016.jpg 21 66 | Clipart/Flipflops/00040.jpg 21 67 | Clipart/Flowers/00005.jpg 22 68 | Clipart/Flowers/00028.jpg 22 69 | Clipart/Flowers/00068.jpg 22 70 | Clipart/Folder/00085.jpg 23 71 | Clipart/Folder/00009.jpg 23 72 | Clipart/Folder/00091.jpg 23 73 | Clipart/Fork/00056.jpg 24 74 | Clipart/Fork/00036.jpg 24 75 | Clipart/Fork/00003.jpg 24 76 | Clipart/Glasses/00011.jpg 25 77 | Clipart/Glasses/00034.jpg 25 78 | Clipart/Glasses/00012.jpg 25 79 | Clipart/Hammer/00077.jpg 26 80 | Clipart/Hammer/00037.jpg 26 81 | Clipart/Hammer/00069.jpg 26 82 | Clipart/Helmet/00017.jpg 27 83 | Clipart/Helmet/00018.jpg 27 84 | Clipart/Helmet/00025.jpg 27 85 | Clipart/Kettle/00006.jpg 28 86 | Clipart/Kettle/00038.jpg 28 87 | Clipart/Kettle/00037.jpg 28 88 | Clipart/Keyboard/00035.jpg 29 89 | Clipart/Keyboard/00022.jpg 29 90 | Clipart/Keyboard/00060.jpg 29 91 | Clipart/Knives/00047.jpg 30 92 | Clipart/Knives/00052.jpg 30 93 | Clipart/Knives/00010.jpg 30 94 | Clipart/Lamp_Shade/00021.jpg 31 95 | Clipart/Lamp_Shade/00006.jpg 31 96 | Clipart/Lamp_Shade/00007.jpg 31 97 | Clipart/Laptop/00041.jpg 32 98 | Clipart/Laptop/00005.jpg 32 99 | Clipart/Laptop/00023.jpg 32 100 | Clipart/Marker/00041.jpg 33 101 | Clipart/Marker/00058.jpg 33 102 | Clipart/Marker/00047.jpg 33 103 | Clipart/Monitor/00021.jpg 34 104 | Clipart/Monitor/00087.jpg 34 105 | Clipart/Monitor/00057.jpg 34 106 | Clipart/Mop/00005.jpg 35 107 | Clipart/Mop/00037.jpg 35 108 | Clipart/Mop/00012.jpg 35 109 | Clipart/Mouse/00005.jpg 36 110 | Clipart/Mouse/00034.jpg 36 111 | Clipart/Mouse/00046.jpg 36 112 | Clipart/Mug/00025.jpg 37 113 | Clipart/Mug/00044.jpg 37 114 | Clipart/Mug/00076.jpg 37 115 | Clipart/Notebook/00009.jpg 38 116 | Clipart/Notebook/00041.jpg 38 117 | Clipart/Notebook/00011.jpg 38 118 | Clipart/Oven/00005.jpg 39 119 | Clipart/Oven/00023.jpg 39 120 | Clipart/Oven/00008.jpg 39 121 | Clipart/Pan/00039.jpg 40 122 | Clipart/Pan/00043.jpg 40 123 | Clipart/Pan/00028.jpg 40 124 | Clipart/Paper_Clip/00018.jpg 41 125 | Clipart/Paper_Clip/00037.jpg 41 126 | Clipart/Paper_Clip/00035.jpg 41 127 | Clipart/Pen/00046.jpg 42 128 | Clipart/Pen/00024.jpg 42 129 | Clipart/Pen/00098.jpg 42 130 | Clipart/Pencil/00039.jpg 43 131 | Clipart/Pencil/00034.jpg 43 132 | Clipart/Pencil/00028.jpg 43 133 | Clipart/Postit_Notes/00027.jpg 44 134 | Clipart/Postit_Notes/00002.jpg 44 135 | Clipart/Postit_Notes/00009.jpg 44 136 | Clipart/Printer/00043.jpg 45 137 | Clipart/Printer/00060.jpg 45 138 | Clipart/Printer/00012.jpg 45 139 | Clipart/Push_Pin/00005.jpg 46 140 | Clipart/Push_Pin/00039.jpg 46 141 | Clipart/Push_Pin/00036.jpg 46 142 | Clipart/Radio/00031.jpg 47 143 | Clipart/Radio/00012.jpg 47 144 | Clipart/Radio/00035.jpg 47 145 | Clipart/Refrigerator/00016.jpg 48 146 | Clipart/Refrigerator/00037.jpg 48 147 | Clipart/Refrigerator/00038.jpg 48 148 | Clipart/Ruler/00028.jpg 49 149 | Clipart/Ruler/00012.jpg 49 150 | Clipart/Ruler/00056.jpg 49 151 | Clipart/Scissors/00070.jpg 50 152 | Clipart/Scissors/00016.jpg 50 153 | Clipart/Scissors/00033.jpg 50 154 | Clipart/Screwdriver/00050.jpg 51 155 | Clipart/Screwdriver/00022.jpg 51 156 | Clipart/Screwdriver/00009.jpg 51 157 | Clipart/Shelf/00008.jpg 52 158 | Clipart/Shelf/00011.jpg 52 159 | Clipart/Shelf/00022.jpg 52 160 | Clipart/Sink/00025.jpg 53 161 | Clipart/Sink/00008.jpg 53 162 | Clipart/Sink/00014.jpg 53 163 | Clipart/Sneakers/00006.jpg 54 164 | Clipart/Sneakers/00029.jpg 54 165 | Clipart/Sneakers/00003.jpg 54 166 | Clipart/Soda/00038.jpg 55 167 | Clipart/Soda/00005.jpg 55 168 | Clipart/Soda/00035.jpg 55 169 | Clipart/Speaker/00055.jpg 56 170 | Clipart/Speaker/00071.jpg 56 171 | Clipart/Speaker/00062.jpg 56 172 | Clipart/Spoon/00017.jpg 57 173 | Clipart/Spoon/00048.jpg 57 174 | Clipart/Spoon/00030.jpg 57 175 | Clipart/Table/00034.jpg 58 176 | Clipart/Table/00015.jpg 58 177 | Clipart/Table/00059.jpg 58 178 | Clipart/Telephone/00065.jpg 59 179 | Clipart/Telephone/00066.jpg 59 180 | Clipart/Telephone/00067.jpg 59 181 | Clipart/ToothBrush/00003.jpg 60 182 | Clipart/ToothBrush/00028.jpg 60 183 | Clipart/ToothBrush/00031.jpg 60 184 | Clipart/Toys/00020.jpg 61 185 | Clipart/Toys/00043.jpg 61 186 | Clipart/Toys/00094.jpg 61 187 | Clipart/Trash_Can/00047.jpg 62 188 | Clipart/Trash_Can/00044.jpg 62 189 | Clipart/Trash_Can/00039.jpg 62 190 | Clipart/TV/00095.jpg 63 191 | Clipart/TV/00066.jpg 63 192 | Clipart/TV/00028.jpg 63 193 | Clipart/Webcam/00027.jpg 64 194 | Clipart/Webcam/00004.jpg 64 195 | Clipart/Webcam/00008.jpg 64 196 | -------------------------------------------------------------------------------- /data/txt/office_home/validation_target_images_Product_3.txt: -------------------------------------------------------------------------------- 1 | Product/Alarm_Clock/00028.jpg 0 2 | Product/Alarm_Clock/00033.jpg 0 3 | Product/Alarm_Clock/00010.jpg 0 4 | Product/Backpack/00027.jpg 1 5 | Product/Backpack/00098.jpg 1 6 | Product/Backpack/00057.jpg 1 7 | Product/Batteries/00050.jpg 2 8 | Product/Batteries/00053.jpg 2 9 | Product/Batteries/00059.jpg 2 10 | Product/Bed/00025.jpg 3 11 | Product/Bed/00039.jpg 3 12 | Product/Bed/00010.jpg 3 13 | Product/Bike/00001.jpg 4 14 | Product/Bike/00044.jpg 4 15 | Product/Bike/00037.jpg 4 16 | Product/Bottle/00061.jpg 5 17 | Product/Bottle/00057.jpg 5 18 | Product/Bottle/00017.jpg 5 19 | Product/Bucket/00039.jpg 6 20 | Product/Bucket/00024.jpg 6 21 | Product/Bucket/00010.jpg 6 22 | Product/Calculator/00015.jpg 7 23 | Product/Calculator/00018.jpg 7 24 | Product/Calculator/00012.jpg 7 25 | Product/Calendar/00019.jpg 8 26 | Product/Calendar/00058.jpg 8 27 | Product/Calendar/00062.jpg 8 28 | Product/Candles/00055.jpg 9 29 | Product/Candles/00018.jpg 9 30 | Product/Candles/00040.jpg 9 31 | Product/Chair/00039.jpg 10 32 | Product/Chair/00099.jpg 10 33 | Product/Chair/00078.jpg 10 34 | Product/Clipboards/00053.jpg 11 35 | Product/Clipboards/00029.jpg 11 36 | Product/Clipboards/00013.jpg 11 37 | Product/Computer/00071.jpg 12 38 | Product/Computer/00024.jpg 12 39 | Product/Computer/00002.jpg 12 40 | Product/Couch/00065.jpg 13 41 | Product/Couch/00063.jpg 13 42 | Product/Couch/00085.jpg 13 43 | Product/Curtains/00037.jpg 14 44 | Product/Curtains/00053.jpg 14 45 | Product/Curtains/00042.jpg 14 46 | Product/Desk_Lamp/00009.jpg 15 47 | Product/Desk_Lamp/00043.jpg 15 48 | Product/Desk_Lamp/00023.jpg 15 49 | Product/Drill/00022.jpg 16 50 | Product/Drill/00042.jpg 16 51 | Product/Drill/00015.jpg 16 52 | Product/Eraser/00002.jpg 17 53 | Product/Eraser/00010.jpg 17 54 | Product/Eraser/00020.jpg 17 55 | Product/Exit_Sign/00015.jpg 18 56 | Product/Exit_Sign/00014.jpg 18 57 | Product/Exit_Sign/00050.jpg 18 58 | Product/Fan/00030.jpg 19 59 | Product/Fan/00052.jpg 19 60 | Product/Fan/00040.jpg 19 61 | Product/File_Cabinet/00059.jpg 20 62 | Product/File_Cabinet/00001.jpg 20 63 | Product/File_Cabinet/00011.jpg 20 64 | Product/Flipflops/00039.jpg 21 65 | Product/Flipflops/00016.jpg 21 66 | Product/Flipflops/00079.jpg 21 67 | Product/Flowers/00070.jpg 22 68 | Product/Flowers/00056.jpg 22 69 | Product/Flowers/00078.jpg 22 70 | Product/Folder/00012.jpg 23 71 | Product/Folder/00060.jpg 23 72 | Product/Folder/00071.jpg 23 73 | Product/Fork/00009.jpg 24 74 | Product/Fork/00005.jpg 24 75 | Product/Fork/00004.jpg 24 76 | Product/Glasses/00066.jpg 25 77 | Product/Glasses/00041.jpg 25 78 | Product/Glasses/00052.jpg 25 79 | Product/Hammer/00038.jpg 26 80 | Product/Hammer/00042.jpg 26 81 | Product/Hammer/00011.jpg 26 82 | Product/Helmet/00048.jpg 27 83 | Product/Helmet/00072.jpg 27 84 | Product/Helmet/00057.jpg 27 85 | Product/Kettle/00027.jpg 28 86 | Product/Kettle/00013.jpg 28 87 | Product/Kettle/00070.jpg 28 88 | Product/Keyboard/00085.jpg 29 89 | Product/Keyboard/00086.jpg 29 90 | Product/Keyboard/00079.jpg 29 91 | Product/Knives/00003.jpg 30 92 | Product/Knives/00014.jpg 30 93 | Product/Knives/00015.jpg 30 94 | Product/Lamp_Shade/00011.jpg 31 95 | Product/Lamp_Shade/00049.jpg 31 96 | Product/Lamp_Shade/00050.jpg 31 97 | Product/Laptop/00056.jpg 32 98 | Product/Laptop/00099.jpg 32 99 | Product/Laptop/00063.jpg 32 100 | Product/Marker/00004.jpg 33 101 | Product/Marker/00015.jpg 33 102 | Product/Marker/00054.jpg 33 103 | Product/Monitor/00010.jpg 34 104 | Product/Monitor/00016.jpg 34 105 | Product/Monitor/00008.jpg 34 106 | Product/Mop/00021.jpg 35 107 | Product/Mop/00031.jpg 35 108 | Product/Mop/00014.jpg 35 109 | Product/Mouse/00091.jpg 36 110 | Product/Mouse/00032.jpg 36 111 | Product/Mouse/00031.jpg 36 112 | Product/Mug/00030.jpg 37 113 | Product/Mug/00032.jpg 37 114 | Product/Mug/00014.jpg 37 115 | Product/Notebook/00006.jpg 38 116 | Product/Notebook/00043.jpg 38 117 | Product/Notebook/00077.jpg 38 118 | Product/Oven/00058.jpg 39 119 | Product/Oven/00057.jpg 39 120 | Product/Oven/00007.jpg 39 121 | Product/Pan/00002.jpg 40 122 | Product/Pan/00050.jpg 40 123 | Product/Pan/00058.jpg 40 124 | Product/Paper_Clip/00001.jpg 41 125 | Product/Paper_Clip/00005.jpg 41 126 | Product/Paper_Clip/00041.jpg 41 127 | Product/Pen/00035.jpg 42 128 | Product/Pen/00042.jpg 42 129 | Product/Pen/00039.jpg 42 130 | Product/Pencil/00024.jpg 43 131 | Product/Pencil/00003.jpg 43 132 | Product/Pencil/00007.jpg 43 133 | Product/Postit_Notes/00033.jpg 44 134 | Product/Postit_Notes/00021.jpg 44 135 | Product/Postit_Notes/00005.jpg 44 136 | Product/Printer/00011.jpg 45 137 | Product/Printer/00021.jpg 45 138 | Product/Printer/00007.jpg 45 139 | Product/Push_Pin/00011.jpg 46 140 | Product/Push_Pin/00034.jpg 46 141 | Product/Push_Pin/00003.jpg 46 142 | Product/Radio/00014.jpg 47 143 | Product/Radio/00013.jpg 47 144 | Product/Radio/00015.jpg 47 145 | Product/Refrigerator/00055.jpg 48 146 | Product/Refrigerator/00042.jpg 48 147 | Product/Refrigerator/00024.jpg 48 148 | Product/Ruler/00026.jpg 49 149 | Product/Ruler/00025.jpg 49 150 | Product/Ruler/00022.jpg 49 151 | Product/Scissors/00087.jpg 50 152 | Product/Scissors/00036.jpg 50 153 | Product/Scissors/00030.jpg 50 154 | Product/Screwdriver/00019.jpg 51 155 | Product/Screwdriver/00026.jpg 51 156 | Product/Screwdriver/00021.jpg 51 157 | Product/Shelf/00022.jpg 52 158 | Product/Shelf/00007.jpg 52 159 | Product/Shelf/00032.jpg 52 160 | Product/Sink/00001.jpg 53 161 | Product/Sink/00004.jpg 53 162 | Product/Sink/00010.jpg 53 163 | Product/Sneakers/00018.jpg 54 164 | Product/Sneakers/00037.jpg 54 165 | Product/Sneakers/00036.jpg 54 166 | Product/Soda/00035.jpg 55 167 | Product/Soda/00037.jpg 55 168 | Product/Soda/00006.jpg 55 169 | Product/Speaker/00025.jpg 56 170 | Product/Speaker/00042.jpg 56 171 | Product/Speaker/00098.jpg 56 172 | Product/Spoon/00042.jpg 57 173 | Product/Spoon/00047.jpg 57 174 | Product/Spoon/00039.jpg 57 175 | Product/Table/00052.jpg 58 176 | Product/Table/00054.jpg 58 177 | Product/Table/00028.jpg 58 178 | Product/Telephone/00033.jpg 59 179 | Product/Telephone/00036.jpg 59 180 | Product/Telephone/00032.jpg 59 181 | Product/ToothBrush/00019.jpg 60 182 | Product/ToothBrush/00025.jpg 60 183 | Product/ToothBrush/00029.jpg 60 184 | Product/Toys/00040.jpg 61 185 | Product/Toys/00006.jpg 61 186 | Product/Toys/00042.jpg 61 187 | Product/Trash_Can/00037.jpg 62 188 | Product/Trash_Can/00049.jpg 62 189 | Product/Trash_Can/00022.jpg 62 190 | Product/TV/00038.jpg 63 191 | Product/TV/00011.jpg 63 192 | Product/TV/00071.jpg 63 193 | Product/Webcam/00078.jpg 64 194 | Product/Webcam/00066.jpg 64 195 | Product/Webcam/00033.jpg 64 196 | -------------------------------------------------------------------------------- /utils/randaugment.py: -------------------------------------------------------------------------------- 1 | # code in this file is adpated from 2 | # https://github.com/ildoonet/pytorch-randaugment/blob/master/RandAugment/augmentations.py 3 | # https://github.com/google-research/fixmatch/blob/master/third_party/auto_augment/augmentations.py 4 | # https://github.com/google-research/fixmatch/blob/master/libml/ctaugment.py 5 | import logging 6 | import random 7 | 8 | import numpy as np 9 | import PIL 10 | import PIL.ImageOps 11 | import PIL.ImageEnhance 12 | import PIL.ImageDraw 13 | from PIL import Image 14 | 15 | logger = logging.getLogger(__name__) 16 | 17 | PARAMETER_MAX = 10 18 | 19 | 20 | def AutoContrast(img, **kwarg): 21 | return PIL.ImageOps.autocontrast(img) 22 | 23 | 24 | def Brightness(img, v, max_v, bias=0): 25 | v = _float_parameter(v, max_v) + bias 26 | return PIL.ImageEnhance.Brightness(img).enhance(v) 27 | 28 | 29 | def Color(img, v, max_v, bias=0): 30 | v = _float_parameter(v, max_v) + bias 31 | return PIL.ImageEnhance.Color(img).enhance(v) 32 | 33 | 34 | def Contrast(img, v, max_v, bias=0): 35 | v = _float_parameter(v, max_v) + bias 36 | return PIL.ImageEnhance.Contrast(img).enhance(v) 37 | 38 | 39 | def Cutout(img, v, max_v, bias=0): 40 | if v == 0: 41 | return img 42 | v = _float_parameter(v, max_v) + bias 43 | v = int(v * min(img.size)) 44 | return CutoutAbs(img, v) 45 | 46 | 47 | def CutoutAbs(img, v, **kwarg): 48 | w, h = img.size 49 | x0 = np.random.uniform(0, w) 50 | y0 = np.random.uniform(0, h) 51 | x0 = int(max(0, x0 - v / 2.)) 52 | y0 = int(max(0, y0 - v / 2.)) 53 | x1 = int(min(w, x0 + v)) 54 | y1 = int(min(h, y0 + v)) 55 | xy = (x0, y0, x1, y1) 56 | # gray 57 | color = (127, 127, 127) 58 | img = img.copy() 59 | PIL.ImageDraw.Draw(img).rectangle(xy, color) 60 | return img 61 | 62 | 63 | def Equalize(img, **kwarg): 64 | return PIL.ImageOps.equalize(img) 65 | 66 | 67 | def Identity(img, **kwarg): 68 | return img 69 | 70 | 71 | def Invert(img, **kwarg): 72 | return PIL.ImageOps.invert(img) 73 | 74 | 75 | def Posterize(img, v, max_v, bias=0): 76 | v = _int_parameter(v, max_v) + bias 77 | return PIL.ImageOps.posterize(img, v) 78 | 79 | 80 | def Rotate(img, v, max_v, bias=0): 81 | v = _int_parameter(v, max_v) + bias 82 | if random.random() < 0.5: 83 | v = -v 84 | return img.rotate(v) 85 | 86 | 87 | def Sharpness(img, v, max_v, bias=0): 88 | v = _float_parameter(v, max_v) + bias 89 | return PIL.ImageEnhance.Sharpness(img).enhance(v) 90 | 91 | 92 | def ShearX(img, v, max_v, bias=0): 93 | v = _float_parameter(v, max_v) + bias 94 | if random.random() < 0.5: 95 | v = -v 96 | return img.transform(img.size, PIL.Image.AFFINE, (1, v, 0, 0, 1, 0)) 97 | 98 | 99 | def ShearY(img, v, max_v, bias=0): 100 | v = _float_parameter(v, max_v) + bias 101 | if random.random() < 0.5: 102 | v = -v 103 | return img.transform(img.size, PIL.Image.AFFINE, (1, 0, 0, v, 1, 0)) 104 | 105 | 106 | def Solarize(img, v, max_v, bias=0): 107 | v = _int_parameter(v, max_v) + bias 108 | return PIL.ImageOps.solarize(img, 256 - v) 109 | 110 | 111 | def SolarizeAdd(img, v, max_v, bias=0, threshold=128): 112 | v = _int_parameter(v, max_v) + bias 113 | if random.random() < 0.5: 114 | v = -v 115 | img_np = np.array(img).astype(np.int) 116 | img_np = img_np + v 117 | img_np = np.clip(img_np, 0, 255) 118 | img_np = img_np.astype(np.uint8) 119 | img = Image.fromarray(img_np) 120 | return PIL.ImageOps.solarize(img, threshold) 121 | 122 | 123 | def TranslateX(img, v, max_v, bias=0): 124 | v = _float_parameter(v, max_v) + bias 125 | if random.random() < 0.5: 126 | v = -v 127 | v = int(v * img.size[0]) 128 | return img.transform(img.size, PIL.Image.AFFINE, (1, 0, v, 0, 1, 0)) 129 | 130 | 131 | def TranslateY(img, v, max_v, bias=0): 132 | v = _float_parameter(v, max_v) + bias 133 | if random.random() < 0.5: 134 | v = -v 135 | v = int(v * img.size[1]) 136 | return img.transform(img.size, PIL.Image.AFFINE, (1, 0, 0, 0, 1, v)) 137 | 138 | 139 | def _float_parameter(v, max_v): 140 | return float(v) * max_v / PARAMETER_MAX 141 | 142 | 143 | def _int_parameter(v, max_v): 144 | return int(v * max_v / PARAMETER_MAX) 145 | 146 | 147 | def fixmatch_augment_pool(): 148 | # FixMatch paper 149 | augs = [(AutoContrast, None, None), 150 | (Brightness, 0.9, 0.05), 151 | (Color, 0.9, 0.05), 152 | (Contrast, 0.9, 0.05), 153 | (Equalize, None, None), 154 | (Identity, None, None), 155 | (Posterize, 4, 4), 156 | (Rotate, 30, 0), 157 | (Sharpness, 0.9, 0.05), 158 | (ShearX, 0.3, 0), 159 | (ShearY, 0.3, 0), 160 | (Solarize, 256, 0), 161 | (TranslateX, 0.3, 0), 162 | (TranslateY, 0.3, 0)] 163 | return augs 164 | 165 | 166 | def my_augment_pool(): 167 | # Test 168 | augs = [(AutoContrast, None, None), 169 | (Brightness, 1.8, 0.1), 170 | (Color, 1.8, 0.1), 171 | (Contrast, 1.8, 0.1), 172 | (Cutout, 0.2, 0), 173 | (Equalize, None, None), 174 | (Invert, None, None), 175 | (Posterize, 4, 4), 176 | (Rotate, 30, 0), 177 | (Sharpness, 1.8, 0.1), 178 | (ShearX, 0.3, 0), 179 | (ShearY, 0.3, 0), 180 | (Solarize, 256, 0), 181 | (SolarizeAdd, 110, 0), 182 | (TranslateX, 0.45, 0), 183 | (TranslateY, 0.45, 0)] 184 | return augs 185 | 186 | 187 | class RandAugmentPC(object): 188 | def __init__(self, n, m): 189 | assert n >= 1 190 | assert 1 <= m <= 10 191 | self.n = n 192 | self.m = m 193 | self.augment_pool = my_augment_pool() 194 | 195 | def __call__(self, img): 196 | ops = random.choices(self.augment_pool, k=self.n) 197 | for op, max_v, bias in ops: 198 | prob = np.random.uniform(0.2, 0.8) 199 | if random.random() + prob >= 1: 200 | img = op(img, v=self.m, max_v=max_v, bias=bias) 201 | img = CutoutAbs(img, 16) 202 | return img 203 | 204 | 205 | class RandAugmentMC(object): 206 | def __init__(self, n, m): 207 | assert n >= 1 208 | assert 1 <= m <= 10 209 | self.n = n 210 | self.m = m 211 | self.augment_pool = fixmatch_augment_pool() 212 | 213 | def __call__(self, img): 214 | ops = random.choices(self.augment_pool, k=self.n) 215 | for op, max_v, bias in ops: 216 | v = np.random.randint(1, self.m) 217 | if random.random() < 0.5: 218 | img = op(img, v=v, max_v=max_v, bias=bias) 219 | img = CutoutAbs(img, 16) 220 | return img 221 | -------------------------------------------------------------------------------- /model/basenet.py: -------------------------------------------------------------------------------- 1 | from torchvision import models 2 | import torch.nn.functional as F 3 | import torch 4 | import torch.nn as nn 5 | from torch.autograd import Function 6 | # import ipdb 7 | 8 | 9 | class GradReverse(Function): 10 | def __init__(self, lambd): 11 | self.lambd = lambd 12 | 13 | def forward(self, x): 14 | return x.view_as(x) 15 | 16 | def backward(self, grad_output): 17 | return (grad_output * -self.lambd) 18 | 19 | 20 | def grad_reverse(x, lambd=1.0): 21 | return GradReverse(lambd)(x) 22 | 23 | 24 | def l2_norm(input): 25 | input_size = input.size() 26 | buffer = torch.pow(input, 2) 27 | 28 | normp = torch.sum(buffer, 1).add_(1e-10) 29 | norm = torch.sqrt(normp) 30 | 31 | _output = torch.div(input, norm.view(-1, 1).expand_as(input)) 32 | 33 | output = _output.view(input_size) 34 | 35 | return output 36 | 37 | 38 | class AlexNetBase(nn.Module): 39 | def __init__(self, pret=True): 40 | super(AlexNetBase, self).__init__() 41 | model_alexnet = models.alexnet(pretrained=pret) 42 | self.features = nn.Sequential(*list(model_alexnet. 43 | features._modules.values())[:]) 44 | self.classifier = nn.Sequential() 45 | for i in range(6): 46 | self.classifier.add_module("classifier" + str(i), 47 | model_alexnet.classifier[i]) 48 | self.__in_features = model_alexnet.classifier[6].in_features 49 | 50 | def forward(self, x): 51 | x = self.features(x) 52 | #ipdb.set_trace() 53 | x = x.view(x.size(0), 256 * 6 * 6) 54 | x = self.classifier(x) 55 | return x 56 | 57 | def output_num(self): 58 | return self.__in_features 59 | 60 | 61 | class VGGBase(nn.Module): 62 | def __init__(self, pret=True, no_pool=False): 63 | super(VGGBase, self).__init__() 64 | vgg16 = models.vgg16(pretrained=pret) 65 | self.classifier = nn.Sequential(*list(vgg16.classifier. 66 | _modules.values())[:-1]) 67 | self.features = nn.Sequential(*list(vgg16.features. 68 | _modules.values())[:]) 69 | self.s = nn.Parameter(torch.FloatTensor([10])) 70 | 71 | def forward(self, x): 72 | x = self.features(x) 73 | x = x.view(x.size(0), 7 * 7 * 512) 74 | x = self.classifier(x) 75 | return x 76 | 77 | 78 | class Predictor(nn.Module): 79 | def __init__(self, num_class=64, inc=4096, temp=0.05): 80 | super(Predictor, self).__init__() 81 | 82 | self.fc = nn.Linear(inc, num_class, bias=False) 83 | # self.fc = nn.Linear(inc, num_class) 84 | 85 | self.num_class = num_class 86 | self.temp = temp 87 | 88 | def forward(self, x, reverse=False, eta=0.1): 89 | if reverse: 90 | x = grad_reverse(x, eta) 91 | x = F.normalize(x) 92 | x_out = self.fc(x) / self.temp 93 | # x_out = self.fc(x) 94 | return x_out 95 | 96 | 97 | def normalize(x, axis=-1): 98 | """Normalizing to unit length along the specified dimension. 99 | Args: 100 | x: pytorch Variable 101 | Returns: 102 | x: pytorch Variable, same shape as input 103 | """ 104 | x = 1. * x / (torch.norm(x, 2, axis, keepdim=True).expand_as(x) + 1e-12) 105 | return x 106 | 107 | 108 | 109 | class Predictor_Proto(object): 110 | def __init__(self, num_class, inc, temp=0.05): 111 | super(Predictor_Proto, self).__init__() 112 | 113 | self.prototypes = torch.FloatTensor(num_class, inc).cuda() 114 | self.prototypes.normal_(0, 0.02) 115 | # self.num_classes = num_class 116 | self.temp = temp 117 | 118 | def __call__(self, feat, reverse=False, eta=0.1, update_proto=False, target_feat=None, target_label=None): 119 | 120 | # reverse 121 | if reverse: 122 | feat = grad_reverse(feat, eta) 123 | 124 | feat = normalize(feat, axis=-1) 125 | 126 | # if normalize_feature: 127 | 128 | feat = feat.data 129 | proto_logit = torch.mm(feat, self.prototypes.transpose(0,1)) / self.temp 130 | 131 | # kl_div_loss = nn.functional.kl_div(F.log_softmax(cls_logit, dim=1), F.softmax(proto_logit, dim=1))*feat.size(0) 132 | # kl_div_loss = nn.functional.kl_div(F.log_softmax(cls_logit, dim=1), F.softmax(proto_logit, dim=1)) 133 | # breakpoint() 134 | 135 | if update_proto: 136 | 137 | target_feat = target_feat.data 138 | 139 | target_feat = normalize(target_feat, axis=-1) 140 | uni_target_label = torch.unique(target_label, sorted=False) 141 | target_feat_list = [target_feat[i*3:i*3+3].mean(dim=0, keepdim=True) for i in range(len(uni_target_label))] 142 | target_feat = torch.cat(target_feat_list, dim=0) 143 | self.prototypes[uni_target_label, :] = target_feat 144 | 145 | return proto_logit 146 | 147 | 148 | # one_hot_support_label = torch.zeros(target_label.size(0), self.num_classes).cuda() 149 | # one_hot_support_label.scatter_(1, target_label.unsqueeze(1), 1) 150 | # breakpoint() 151 | # support_feature = self.FeatExemplarAvgBlock(target_feat, one_hot_support_label) 152 | 153 | # breakpoint() 154 | 155 | # breakpoint() 156 | 157 | 158 | # breakpoint() 159 | 160 | # self.prototypes[uni_target_label, :] = 161 | # self.prototypes[uni_target_label, :] = 0.01*self.prototypes[uni_target_label, :].clone() + 0.99*target_feat.data 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | class Predictor_deep(nn.Module): 170 | def __init__(self, num_class=64, inc=4096, temp=0.05): 171 | super(Predictor_deep, self).__init__() 172 | self.fc1 = nn.Linear(inc, 512) 173 | self.fc2 = nn.Linear(512, num_class, bias=False) 174 | self.num_class = num_class 175 | self.temp = temp 176 | 177 | def forward(self, x, reverse=False, eta=0.1): 178 | x = self.fc1(x) 179 | if reverse: 180 | x = grad_reverse(x, eta) 181 | x = F.normalize(x) 182 | x_out = self.fc2(x) / self.temp 183 | return x_out 184 | 185 | 186 | class fc_head(nn.Module): 187 | def __init__(self, num_class=64, inc=4096, temp=0.05): 188 | super(fc_head, self).__init__() 189 | self.fc = nn.Linear(inc, num_class) 190 | self.num_class = num_class 191 | self.temp = temp 192 | 193 | def forward(self, x): 194 | #x = F.normalize(x) 195 | x_out = self.fc(x) 196 | return x_out 197 | 198 | class Discriminator(nn.Module): 199 | def __init__(self, inc=4096): 200 | super(Discriminator, self).__init__() 201 | self.fc1_1 = nn.Linear(inc, 512) 202 | self.fc2_1 = nn.Linear(512, 512) 203 | self.fc3_1 = nn.Linear(512, 2) 204 | 205 | def forward(self, x, reverse=True, eta=1.0): 206 | if reverse: 207 | x = grad_reverse(x, eta) 208 | x = F.relu(self.fc1_1(x)) 209 | x = F.relu(self.fc2_1(x)) 210 | x_out = F.sigmoid(self.fc3_1(x)) 211 | return x_out 212 | 213 | 214 | class Distance_metric(nn.Module): 215 | def __init__(self, num_class=2, inc=4096, temp=0.05): 216 | super(Distance_metric, self).__init__() 217 | self.fc = nn.Linear(inc, num_class, bias=False) 218 | self.num_class = num_class 219 | self.temp = temp 220 | 221 | def forward(self, x, reverse=False, eta=0.1): 222 | x_out = self.fc(x) 223 | return x_out -------------------------------------------------------------------------------- /model/resnet.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | from __future__ import division 3 | from __future__ import print_function 4 | 5 | from torch.autograd import Function 6 | import torch 7 | import torch.nn as nn 8 | import math 9 | import torch.utils.model_zoo as model_zoo 10 | 11 | __all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101', 12 | 'resnet152'] 13 | 14 | model_urls = { 15 | 'resnet18': 'https://s3.amazonaws.com/pytorch/models/resnet18-5c106cde.pth', 16 | 'resnet34': 'https://s3.amazonaws.com/pytorch/models/resnet34-333f7ec4.pth', 17 | 'resnet50': 'https://s3.amazonaws.com/pytorch/models/resnet50-19c8e357.pth', 18 | 'resnet101': 19 | 'https://s3.amazonaws.com/pytorch/models/resnet101-5d3b4d8f.pth', 20 | 'resnet152': 21 | 'https://s3.amazonaws.com/pytorch/models/resnet152-b121ed2d.pth', 22 | } 23 | 24 | 25 | def init_weights(m): 26 | classname = m.__class__.__name__ 27 | if classname.find('Conv2d') != -1 or \ 28 | classname.find('ConvTranspose2d') != -1: 29 | nn.init.kaiming_uniform_(m.weight) 30 | nn.init.zeros_(m.bias) 31 | elif classname.find('BatchNorm') != -1: 32 | nn.init.normal_(m.weight, 1.0, 0.02) 33 | nn.init.zeros_(m.bias) 34 | elif classname.find('Linear') != -1: 35 | nn.init.xavier_normal_(m.weight) 36 | 37 | 38 | def conv3x3(in_planes, out_planes, stride=1): 39 | "3x3 convolution with padding" 40 | return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, 41 | padding=1, bias=False) 42 | 43 | 44 | class GradReverse(Function): 45 | def __init__(self, lambd): 46 | self.lambd = lambd 47 | 48 | def forward(self, x): 49 | return x.view_as(x) 50 | 51 | def backward(self, grad_output): 52 | return (grad_output * -self.lambd) 53 | 54 | 55 | def grad_reverse(x, lambd=1.0): 56 | return GradReverse(lambd)(x) 57 | 58 | 59 | class BasicBlock(nn.Module): 60 | expansion = 1 61 | 62 | def __init__(self, inplanes, planes, stride=1, downsample=None, nobn=False): 63 | super(BasicBlock, self).__init__() 64 | self.conv1 = conv3x3(inplanes, planes, stride) 65 | self.bn1 = nn.BatchNorm2d(planes) 66 | self.relu = nn.ReLU(inplace=True) 67 | self.conv2 = conv3x3(planes, planes) 68 | self.bn2 = nn.BatchNorm2d(planes) 69 | self.downsample = downsample 70 | self.stride = stride 71 | self.nobn = nobn 72 | 73 | def forward(self, x, source=True): 74 | 75 | residual = x 76 | out = self.conv1(x) 77 | out = self.bn1(out) 78 | out = self.relu(out) 79 | 80 | out = self.conv2(out) 81 | out = self.bn2(out) 82 | 83 | if self.downsample is not None: 84 | residual = self.downsample(x) 85 | out += residual 86 | out = self.relu(out) 87 | 88 | return out 89 | 90 | 91 | class ScaleLayer(nn.Module): 92 | def __init__(self, init_value=1e-3): 93 | super(ScaleLayer, self).__init__() 94 | self.scale = nn.Parameter(torch.FloatTensor([init_value])) 95 | 96 | def forward(self, input): 97 | print(self.scale) 98 | return input * self.scale 99 | 100 | 101 | class Bottleneck(nn.Module): 102 | expansion = 4 103 | 104 | def __init__(self, inplanes, planes, stride=1, downsample=None, nobn=False): 105 | super(Bottleneck, self).__init__() 106 | self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, 107 | stride=stride, bias=False) 108 | self.bn1 = nn.BatchNorm2d(planes) 109 | 110 | self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, 111 | stride=1, padding=1, bias=False) 112 | self.bn2 = nn.BatchNorm2d(planes) 113 | 114 | self.conv3 = nn.Conv2d(planes, planes * 4, kernel_size=1, bias=False) 115 | self.bn3 = nn.BatchNorm2d(planes * 4) 116 | 117 | self.relu = nn.ReLU(inplace=True) 118 | self.downsample = downsample 119 | 120 | self.stride = stride 121 | self.nobn = nobn 122 | 123 | def forward(self, x): 124 | residual = x 125 | out = self.conv1(x) 126 | out = self.bn1(out) 127 | out = self.relu(out) 128 | out = self.conv2(out) 129 | out = self.bn2(out) 130 | out = self.relu(out) 131 | out = self.conv3(out) 132 | out = self.bn3(out) 133 | if self.downsample is not None: 134 | residual = self.downsample(x) 135 | out += residual 136 | out = self.relu(out) 137 | 138 | return out 139 | 140 | 141 | class ResNet(nn.Module): 142 | def __init__(self, block, layers, num_classes=1000): 143 | self.inplanes = 64 144 | super(ResNet, self).__init__() 145 | self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3, 146 | bias=False) 147 | self.bn1 = nn.BatchNorm2d(64) 148 | self.in1 = nn.InstanceNorm2d(64) 149 | self.in2 = nn.InstanceNorm2d(128) 150 | self.relu = nn.ReLU(inplace=True) 151 | self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, 152 | padding=0, ceil_mode=True) 153 | self.layer1 = self._make_layer(block, 64, layers[0]) 154 | self.layer2 = self._make_layer(block, 128, layers[1], stride=2) 155 | self.layer3 = self._make_layer(block, 256, layers[2], stride=2) 156 | self.layer4 = self._make_layer(block, 512, layers[3], stride=2) 157 | self.avgpool = nn.AvgPool2d(7) 158 | self.fc = nn.Linear(512 * block.expansion, num_classes) 159 | 160 | for m in self.modules(): 161 | if isinstance(m, nn.Conv2d): 162 | n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels 163 | m.weight.data.normal_(0, math.sqrt(2. / n)) 164 | elif isinstance(m, nn.BatchNorm2d): 165 | m.weight.data.fill_(1) 166 | m.bias.data.zero_() 167 | 168 | def _make_layer(self, block, planes, blocks, stride=1, nobn=False): 169 | downsample = None 170 | if stride != 1 or self.inplanes != planes * block.expansion: 171 | downsample = nn.Sequential( 172 | nn.Conv2d(self.inplanes, planes * block.expansion, 173 | kernel_size=1, stride=stride, bias=False), 174 | nn.BatchNorm2d(planes * block.expansion), 175 | ) 176 | 177 | layers = [] 178 | layers.append(block(self.inplanes, planes, stride, downsample)) 179 | self.inplanes = planes * block.expansion 180 | 181 | for i in range(1, blocks): 182 | layers.append(block(self.inplanes, planes, nobn=nobn)) 183 | return nn.Sequential(*layers) 184 | 185 | def forward(self, x): 186 | x = self.conv1(x) 187 | x = self.bn1(x) 188 | x = self.relu(x) 189 | x = self.maxpool(x) 190 | x = self.layer1(x) 191 | x = self.layer2(x) 192 | x = self.layer3(x) 193 | x = self.layer4(x) 194 | x = self.avgpool(x) 195 | x = x.view(x.size(0), -1) 196 | return x 197 | 198 | 199 | 200 | 201 | def resnet18(pretrained=True): 202 | """Constructs a ResNet-18 model. 203 | Args: 204 | pretrained (bool): If True, returns a model pre-trained on ImageNet 205 | """ 206 | model = ResNet(BasicBlock, [2, 2, 2, 2]) 207 | if pretrained: 208 | pretrained_dict = model_zoo.load_url(model_urls['resnet18']) 209 | model_dict = model.state_dict() 210 | # 1. filter out unnecessary keys 211 | pretrained_dict = {k: v for k, v in pretrained_dict.items() 212 | if k in model_dict} 213 | # 2. overwrite entries in the existing state dict 214 | model_dict.update(pretrained_dict) 215 | # 3. load the new state dict 216 | model.load_state_dict(model_dict) 217 | return model 218 | 219 | 220 | def resnet34(pretrained=True): 221 | """Constructs a ResNet-34 model. 222 | Args: 223 | pretrained (bool): If True, returns a model pre-trained on ImageNet 224 | """ 225 | model = ResNet(BasicBlock, [3, 4, 6, 3]) 226 | if pretrained: 227 | model.load_state_dict(model_zoo.load_url(model_urls['resnet34'])) 228 | return model 229 | 230 | 231 | def resnet50(pretrained=True): 232 | """Constructs a ResNet-50 model. 233 | Args: 234 | pretrained (bool): If True, returns a model pre-trained on ImageNet 235 | """ 236 | model = ResNet(Bottleneck, [3, 4, 6, 3]) 237 | if pretrained: 238 | pretrained_dict = model_zoo.load_url(model_urls['resnet50']) 239 | model_dict = model.state_dict() 240 | pretrained_dict = {k: v for k, v in pretrained_dict.items() 241 | if k in model_dict} 242 | model_dict.update(pretrained_dict) 243 | model.load_state_dict(model_dict) 244 | return model 245 | 246 | 247 | def resnet101(pretrained=False): 248 | """Constructs a ResNet-101 model. 249 | Args: 250 | pretrained (bool): If True, returns a model pre-trained on ImageNet 251 | """ 252 | model = ResNet(Bottleneck, [3, 4, 23, 3]) 253 | if pretrained: 254 | model.load_state_dict(model_zoo.load_url(model_urls['resnet101'])) 255 | return model 256 | 257 | 258 | 259 | # class resnet152(): 260 | 261 | # def __init__(self, block, layers, num_classes=1000): 262 | 263 | 264 | # def forward(self, x): 265 | # return x 266 | 267 | 268 | 269 | 270 | def resnet152(pretrained=False): 271 | """Constructs a ResNet-152 model. 272 | Args: 273 | pretrained (bool): If True, returns a model pre-trained on ImageNet 274 | """ 275 | model = ResNet(Bottleneck, [3, 8, 36, 3]) 276 | if pretrained: 277 | model.load_state_dict(model_zoo.load_url(model_urls['resnet152'])) 278 | return model 279 | -------------------------------------------------------------------------------- /loaders/dsne_loader.py: -------------------------------------------------------------------------------- 1 | from multiprocessing import cpu_count 2 | 3 | 4 | class DomainArrayDataset(Dataset): 5 | """ 6 | Domain Array Dataset, designed for digits datasets 7 | """ 8 | def __init__(self, arrs=None, arrt=None, tforms=None, tformt=None, ratio=0): 9 | """ 10 | Initialization of dataset 11 | :param arrs: source array 12 | :param arrt: target array 13 | :param tforms: transformers for source array 14 | :param tformt: transformers for target array 15 | :param ratio: negative/positive ratio 16 | """ 17 | assert arrs is not None or arrt is not None, "One of src array or tgt array should not be None" 18 | 19 | self.arrs = arrs 20 | self.use_src = False if arrs is None else True 21 | 22 | self.arrt = arrt 23 | self.use_tgt = False if arrt is None else True 24 | 25 | self.tforms = tforms 26 | self.tformt = tformt 27 | 28 | self.ratio = ratio 29 | 30 | # breakpoint() 31 | 32 | if self.use_src and self.use_tgt: 33 | self.pairs = self._create_pairs() 34 | elif self.use_src and not self.use_tgt: 35 | self.pairs = list(range(len(self.arrs[0]))) 36 | elif not self.use_src and self.use_tgt: 37 | self.pairs = list(range(len(self.arrs[0]))) 38 | else: 39 | sys.exit("Need to input one source") 40 | 41 | def _create_pairs(self): 42 | """ 43 | Create pairs for array 44 | :return: 45 | """ 46 | pos_pairs, neg_pairs = [], [] 47 | for ids, ys in enumerate(self.arrs[1]): 48 | for idt, yt in enumerate(self.arrt[1]): 49 | if ys == yt: 50 | pos_pairs.append([ids, ys, idt, yt, 1]) 51 | else: 52 | neg_pairs.append([ids, ys, idt, yt, 0]) 53 | 54 | if self.ratio > 0: 55 | random.shuffle(neg_pairs) 56 | pairs = pos_pairs + neg_pairs[: self.ratio * len(pos_pairs)] 57 | else: 58 | pairs = pos_pairs + neg_pairs 59 | 60 | random.shuffle(pairs) 61 | 62 | 63 | return pairs 64 | 65 | def __getitem__(self, idx): 66 | 67 | if self.use_src and not self.use_tgt: 68 | im, l = self.arrs[0][idx], self.arrs[1][idx] 69 | im = nd.array(im, dtype='float32') 70 | 71 | if self.tforms is not None: 72 | im = self.tforms(im) 73 | 74 | return im, l 75 | elif self.use_tgt and not self.use_src: 76 | im, l = self.arrt[0][idx], self.arrt[1][idx] 77 | im = nd.array(im, dtype='float32') 78 | if self.tformt is not None: 79 | im = self.tformt(im) 80 | 81 | return im, l 82 | else: 83 | [ids, ys, idt, yt, lc] = self.pairs[idx] 84 | ims, ls = self.arrs[0][ids], self.arrs[1][ids] 85 | imt, lt = self.arrt[0][idt], self.arrt[1][idt] 86 | 87 | ims = nd.array(ims, dtype='float32') 88 | imt = nd.array(imt, dtype='float32') 89 | 90 | assert ys == ls 91 | assert yt == lt 92 | 93 | if self.tforms is not None: 94 | ims = self.tforms(ims) 95 | 96 | 97 | if self.tformt is not None: 98 | imt = self.tformt(imt) 99 | 100 | 101 | return ims, ls, imt, lt, lc 102 | 103 | def __len__(self): 104 | return len(self.pairs) 105 | 106 | 107 | 108 | 109 | 110 | class DomainArrayDataset_Triplet(Dataset): 111 | def __init__(self, arrs=None, arrt=None, tforms=None, tformt=None, ratio=0): 112 | 113 | assert arrs is not None or arrt is not None, "One of src array or tgt array should not be None" 114 | 115 | self.arrs = arrs 116 | self.use_src = False if arrs is None else True 117 | 118 | self.arrt = arrt 119 | self.use_tgt = False if arrt is None else True 120 | 121 | self.tforms = tforms 122 | self.tformt = tformt 123 | 124 | self.ratio = ratio 125 | 126 | # breakpoint() 127 | self.all_class = np.unique(label_t) 128 | 129 | if self.use_src and self.use_tgt: 130 | self.cls2sample_s, self.cls2sample_t = self.create_dict_cls2sample() 131 | elif self.use_src and not self.use_tgt: 132 | self.pairs = list(range(len(self.arrs[0]))) 133 | elif not self.use_src and self.use_tgt: 134 | self.pairs = list(range(len(self.arrs[0]))) 135 | else: 136 | sys.exit("Need to input one source") 137 | 138 | def create_dict_cls2sample(self): 139 | cls2sample_s, cls2sample_t = {}, {} 140 | label_s = self.arrs[1] 141 | label_t = self.arrt[1] 142 | 143 | 144 | for c in all_class: 145 | idx = np.where(label_s==c)[0] 146 | cls2sample_s[c] = idx 147 | 148 | idx = np.where(label_t==c)[0] 149 | cls2sample_t[c] = idx 150 | 151 | return cls2sample_s, cls2sample_t 152 | 153 | 154 | def __getitem__(self, idx): 155 | 156 | if self.use_src and not self.use_tgt: 157 | im, l = self.arrs[0][idx], self.arrs[1][idx] 158 | im = nd.array(im, dtype='float32') 159 | 160 | if self.tforms is not None: 161 | im = self.tforms(im) 162 | 163 | return im, l 164 | elif self.use_tgt and not self.use_src: 165 | im, l = self.arrt[0][idx], self.arrt[1][idx] 166 | im = nd.array(im, dtype='float32') 167 | if self.tformt is not None: 168 | im = self.tformt(im) 169 | 170 | return im, l 171 | else: 172 | self.cls2sample_s 173 | self.cls2sample_t 174 | 175 | [ids, ys, idt, yt, lc] = self.pairs[idx] 176 | ims, ls = self.arrs[0][ids], self.arrs[1][ids] 177 | imt, lt = self.arrt[0][idt], self.arrt[1][idt] 178 | 179 | ims = nd.array(ims, dtype='float32') 180 | imt = nd.array(imt, dtype='float32') 181 | 182 | assert ys == ls 183 | assert yt == lt 184 | 185 | if self.tforms is not None: 186 | ims = self.tforms(ims) 187 | 188 | if self.tformt is not None: 189 | imt = self.tformt(imt) 190 | 191 | return ims, ls, imt, lt, lc 192 | 193 | def __len__(self): 194 | return len(self.pairs) 195 | 196 | 197 | 198 | 199 | 200 | 201 | class DSNE_loader(object): 202 | def __init__(self, dataset, src, trg, bs): 203 | 204 | self.dataset = dataset 205 | self.transform = transform 206 | self.create_loader(transform) 207 | self.bs = bs 208 | 209 | def create_loader(self): 210 | cpus = cpu_count() 211 | 212 | if self.dataset = 'digits': 213 | trs_set, trt_set, tes_set, tet_set = self.create_digits_datasets(train_tforms, eval_tforms) 214 | elif self.dataset = 'office': 215 | trs_set, trt_set, tes_set, tet_set = self.create_office_datasets(train_tforms, eval_tforms) 216 | elif self.dataset = 'visda': 217 | trs_set, trt_set, tes_set, tet_set = self.create_visda_datasets(train_tforms, eval_tforms) 218 | else: 219 | raise NotImplementedError 220 | 221 | self.train_src_loader = DataLoader(trs_set, self.args.bs, shuffle=True, num_workers=cpus) 222 | self.test_src_loader = DataLoader(tes_set, self.args.bs, shuffle=False, num_workers=cpus) 223 | self.test_tgt_loader = DataLoader(tet_set, self.args.bs, shuffle=False, num_workers=cpus) 224 | 225 | 226 | 227 | def load_digits_cfg(self): 228 | cfg = load_json(self.args.cfg) 229 | cfg = split_digits_train_test(cfg, self.args.src.upper(), self.args.tgt.upper(), 1, self.args.seed) 230 | 231 | trs = cfg[self.args.src.upper()]['TR'] 232 | trt = cfg[self.args.tgt.upper()]['TR'] 233 | tes = cfg[self.args.src.upper()]['TE'] 234 | tet = cfg[self.args.tgt.upper()]['TE'] 235 | 236 | return trs, trt, tes, tet 237 | 238 | def load_office_cfg(self): 239 | cfg = load_json(self.args.cfg) 240 | cfg = split_office_train_test(cfg, 1, self.args.seed) 241 | 242 | trs = cfg[self.args.src.upper()]['SRC-TR'] 243 | trt = cfg[self.args.tgt.upper()]['TGT-TR'] 244 | tes = cfg[self.args.src.upper()]['TGT-TE'] 245 | tet = cfg[self.args.tgt.upper()]['TGT-TE'] 246 | 247 | return trs, trt, tes, tet 248 | 249 | def load_visda_cfg(self): 250 | cfg = load_json(self.args.cfg) 251 | 252 | trs = cfg['SRC']['TRAIN'] 253 | trt = cfg['TGT']['TRAIN'] 254 | tes = cfg['SRC']['TRAIN'] 255 | tet = cfg['TGT']['TEST'] 256 | self.label_dict = cfg['Label'] 257 | 258 | return trs, trt, tes, tet 259 | 260 | def create_digits_datasets(self, train_tforms, eval_tforms): 261 | """ 262 | Create digits datasets 263 | :param train_tforms: training transformers 264 | :param eval_tforms: evaluation transformers 265 | :return: 266 | trs_set: training source set 267 | trt_set: training target set 268 | tes_set: testing source set 269 | tet_set: testing target set 270 | """ 271 | trs, trt, tes, tet = self.load_digits_cfg() 272 | 273 | # breakpoint() 274 | if self.args.aug_tgt_only: 275 | trs_set = DomainArrayDataset(trs, tforms=train_tforms) 276 | else: 277 | trs_set = DomainArrayDataset(trs, tforms=eval_tforms) 278 | trt_set = DomainArrayDataset(trt, tforms=train_tforms) 279 | tes_set = DomainArrayDataset(tes, tforms=eval_tforms) 280 | tet_set = DomainArrayDataset(tet, tforms=eval_tforms) 281 | 282 | return trs_set, trt_set, tes_set, tet_set 283 | 284 | 285 | 286 | 287 | 288 | def create_office_datasets(self, train_tforms, eval_tforms): 289 | """ 290 | Create Office datasets 291 | :param train_tforms: training transformers 292 | :param eval_tforms: evaluation transformers 293 | :return: 294 | trs_set: training source set 295 | trt_set: training target set 296 | tes_set: testing source set 297 | tet_set: testing target set 298 | """ 299 | trs, trt, tes, tet = self.load_office_cfg() 300 | 301 | if self.args.aug_tgt_only: 302 | trs_set = DomainArrayDataset(trs, tforms=train_tforms) 303 | else: 304 | trs_set = DomainArrayDataset(trs, tforms=eval_tforms) 305 | trt_set = DomainFolderDataset(trt, tforms=train_tforms) 306 | tes_set = DomainFolderDataset(tes, tforms=eval_tforms) 307 | tet_set = DomainFolderDataset(tet, tforms=eval_tforms) 308 | 309 | return trs_set, trt_set, tes_set, tet_set 310 | 311 | def create_visda_datasets(self, train_tforms, eval_tforms): 312 | """ 313 | Create VisDA17 datasets 314 | :param train_tforms: training transformers 315 | :param eval_tforms: evaluation transformers 316 | :return: 317 | trs_set: training source set 318 | trt_set: training target set 319 | tes_set: testing source set 320 | tet_set: testing target set 321 | """ 322 | # Read config 323 | trs, trt, tes, tet = self.load_visda_cfg() 324 | 325 | if self.args.aug_tgt_only: 326 | trs_set = DomainArrayDataset(trs, tforms=train_tforms) 327 | else: 328 | trs_set = DomainArrayDataset(trs, tforms=eval_tforms) 329 | trt_set = DomainRecDataset(trt, tforms=train_tforms) 330 | tes_set = DomainRecDataset(tes, tforms=eval_tforms) 331 | tet_set = DomainRecDataset(tet, tforms=eval_tforms) 332 | 333 | return trs_set, trt_set, tes_set, tet_set -------------------------------------------------------------------------------- /data/txt/multi/labeled_target_images_real_3.txt: -------------------------------------------------------------------------------- 1 | real/aircraft_carrier/real_001_000114.jpg 0 2 | real/aircraft_carrier/real_001_000264.jpg 0 3 | real/aircraft_carrier/real_001_000194.jpg 0 4 | real/alarm_clock/real_003_000441.jpg 1 5 | real/alarm_clock/real_003_000157.jpg 1 6 | real/alarm_clock/real_003_000504.jpg 1 7 | real/ant/real_007_000001.jpg 2 8 | real/ant/real_007_000275.jpg 2 9 | real/ant/real_007_000054.jpg 2 10 | real/anvil/real_008_000165.jpg 3 11 | real/anvil/real_008_000176.jpg 3 12 | real/anvil/real_008_000225.jpg 3 13 | real/asparagus/real_011_000355.jpg 4 14 | real/asparagus/real_011_000390.jpg 4 15 | real/asparagus/real_011_000145.jpg 4 16 | real/axe/real_012_000114.jpg 5 17 | real/axe/real_012_000054.jpg 5 18 | real/axe/real_012_000123.jpg 5 19 | real/banana/real_014_000087.jpg 6 20 | real/banana/real_014_000204.jpg 6 21 | real/banana/real_014_000202.jpg 6 22 | real/basket/real_019_000249.jpg 7 23 | real/basket/real_019_000356.jpg 7 24 | real/basket/real_019_000079.jpg 7 25 | real/bathtub/real_022_000305.jpg 8 26 | real/bathtub/real_022_000130.jpg 8 27 | real/bathtub/real_022_000392.jpg 8 28 | real/bear/real_024_000075.jpg 9 29 | real/bear/real_024_000297.jpg 9 30 | real/bear/real_024_000444.jpg 9 31 | real/bee/real_027_000374.jpg 10 32 | real/bee/real_027_000226.jpg 10 33 | real/bee/real_027_000152.jpg 10 34 | real/bird/real_032_000164.jpg 11 35 | real/bird/real_032_000773.jpg 11 36 | real/bird/real_032_000110.jpg 11 37 | real/blackberry/real_034_000342.jpg 12 38 | real/blackberry/real_034_000161.jpg 12 39 | real/blackberry/real_034_000081.jpg 12 40 | real/blueberry/real_035_000364.jpg 13 41 | real/blueberry/real_035_000701.jpg 13 42 | real/blueberry/real_035_000622.jpg 13 43 | real/bottlecap/real_038_000444.jpg 14 44 | real/bottlecap/real_038_000071.jpg 14 45 | real/bottlecap/real_038_000093.jpg 14 46 | real/broccoli/real_044_000183.jpg 15 47 | real/broccoli/real_044_000151.jpg 15 48 | real/broccoli/real_044_000364.jpg 15 49 | real/bus/real_048_000521.jpg 16 50 | real/bus/real_048_000452.jpg 16 51 | real/bus/real_048_000422.jpg 16 52 | real/butterfly/real_050_000525.jpg 17 53 | real/butterfly/real_050_000521.jpg 17 54 | real/butterfly/real_050_000402.jpg 17 55 | real/cactus/real_051_000405.jpg 18 56 | real/cactus/real_051_000111.jpg 18 57 | real/cactus/real_051_000380.jpg 18 58 | real/cake/real_052_000757.jpg 19 59 | real/cake/real_052_000021.jpg 19 60 | real/cake/real_052_000076.jpg 19 61 | real/calculator/real_053_000010.jpg 20 62 | real/calculator/real_053_000101.jpg 20 63 | real/calculator/real_053_000343.jpg 20 64 | real/camel/real_055_000042.jpg 21 65 | real/camel/real_055_000456.jpg 21 66 | real/camel/real_055_000130.jpg 21 67 | real/camera/real_056_000285.jpg 22 68 | real/camera/real_056_000011.jpg 22 69 | real/camera/real_056_000152.jpg 22 70 | real/candle/real_059_000481.jpg 23 71 | real/candle/real_059_000596.jpg 23 72 | real/candle/real_059_000448.jpg 23 73 | real/cannon/real_060_000076.jpg 24 74 | real/cannon/real_060_000273.jpg 24 75 | real/cannon/real_060_000200.jpg 24 76 | real/canoe/real_061_000654.jpg 25 77 | real/canoe/real_061_000166.jpg 25 78 | real/canoe/real_061_000158.jpg 25 79 | real/carrot/real_063_000310.jpg 26 80 | real/carrot/real_063_000077.jpg 26 81 | real/carrot/real_063_000542.jpg 26 82 | real/castle/real_064_000216.jpg 27 83 | real/castle/real_064_000388.jpg 27 84 | real/castle/real_064_000377.jpg 27 85 | real/cat/real_065_000583.jpg 28 86 | real/cat/real_065_000676.jpg 28 87 | real/cat/real_065_000018.jpg 28 88 | real/ceiling_fan/real_066_000024.jpg 29 89 | real/ceiling_fan/real_066_000203.jpg 29 90 | real/ceiling_fan/real_066_000209.jpg 29 91 | real/cello/real_067_000043.jpg 30 92 | real/cello/real_067_000304.jpg 30 93 | real/cello/real_067_000145.jpg 30 94 | real/cell_phone/real_068_000431.jpg 31 95 | real/cell_phone/real_068_000485.jpg 31 96 | real/cell_phone/real_068_000176.jpg 31 97 | real/chair/real_069_000232.jpg 32 98 | real/chair/real_069_000250.jpg 32 99 | real/chair/real_069_000184.jpg 32 100 | real/chandelier/real_070_000356.jpg 33 101 | real/chandelier/real_070_000280.jpg 33 102 | real/chandelier/real_070_000281.jpg 33 103 | real/coffee_cup/real_076_000130.jpg 34 104 | real/coffee_cup/real_076_000571.jpg 34 105 | real/coffee_cup/real_076_000357.jpg 34 106 | real/compass/real_077_000100.jpg 35 107 | real/compass/real_077_000225.jpg 35 108 | real/compass/real_077_000090.jpg 35 109 | real/computer/real_078_000349.jpg 36 110 | real/computer/real_078_000254.jpg 36 111 | real/computer/real_078_000280.jpg 36 112 | real/cow/real_082_000201.jpg 37 113 | real/cow/real_082_000293.jpg 37 114 | real/cow/real_082_000514.jpg 37 115 | real/crab/real_083_000068.jpg 38 116 | real/crab/real_083_000387.jpg 38 117 | real/crab/real_083_000683.jpg 38 118 | real/crocodile/real_085_000707.jpg 39 119 | real/crocodile/real_085_000381.jpg 39 120 | real/crocodile/real_085_000308.jpg 39 121 | real/cruise_ship/real_087_000015.jpg 40 122 | real/cruise_ship/real_087_000116.jpg 40 123 | real/cruise_ship/real_087_000013.jpg 40 124 | real/dog/real_092_000120.jpg 41 125 | real/dog/real_092_000030.jpg 41 126 | real/dog/real_092_000080.jpg 41 127 | real/dolphin/real_093_000338.jpg 42 128 | real/dolphin/real_093_000115.jpg 42 129 | real/dolphin/real_093_000314.jpg 42 130 | real/dragon/real_096_000154.jpg 43 131 | real/dragon/real_096_000078.jpg 43 132 | real/dragon/real_096_000341.jpg 43 133 | real/drums/real_099_000324.jpg 44 134 | real/drums/real_099_000628.jpg 44 135 | real/drums/real_099_000765.jpg 44 136 | real/duck/real_100_000217.jpg 45 137 | real/duck/real_100_000090.jpg 45 138 | real/duck/real_100_000329.jpg 45 139 | real/dumbbell/real_101_000537.jpg 46 140 | real/dumbbell/real_101_000462.jpg 46 141 | real/dumbbell/real_101_000136.jpg 46 142 | real/elephant/real_104_000239.jpg 47 143 | real/elephant/real_104_000039.jpg 47 144 | real/elephant/real_104_000595.jpg 47 145 | real/eyeglasses/real_108_000016.jpg 48 146 | real/eyeglasses/real_108_000352.jpg 48 147 | real/eyeglasses/real_108_000295.jpg 48 148 | real/feather/real_111_000137.jpg 49 149 | real/feather/real_111_000463.jpg 49 150 | real/feather/real_111_000131.jpg 49 151 | real/fence/real_112_000386.jpg 50 152 | real/fence/real_112_000581.jpg 50 153 | real/fence/real_112_000226.jpg 50 154 | real/fish/real_117_000169.jpg 51 155 | real/fish/real_117_000461.jpg 51 156 | real/fish/real_117_000341.jpg 51 157 | real/flamingo/real_118_000510.jpg 52 158 | real/flamingo/real_118_000439.jpg 52 159 | real/flamingo/real_118_000237.jpg 52 160 | real/flower/real_122_000164.jpg 53 161 | real/flower/real_122_000337.jpg 53 162 | real/flower/real_122_000029.jpg 53 163 | real/foot/real_124_000502.jpg 54 164 | real/foot/real_124_000024.jpg 54 165 | real/foot/real_124_000374.jpg 54 166 | real/fork/real_125_000184.jpg 55 167 | real/fork/real_125_000079.jpg 55 168 | real/fork/real_125_000347.jpg 55 169 | real/frog/real_126_000280.jpg 56 170 | real/frog/real_126_000611.jpg 56 171 | real/frog/real_126_000706.jpg 56 172 | real/giraffe/real_130_000049.jpg 57 173 | real/giraffe/real_130_000144.jpg 57 174 | real/giraffe/real_130_000298.jpg 57 175 | real/goatee/real_131_000335.jpg 58 176 | real/goatee/real_131_000176.jpg 58 177 | real/goatee/real_131_000094.jpg 58 178 | real/grapes/real_133_000732.jpg 59 179 | real/grapes/real_133_000560.jpg 59 180 | real/grapes/real_133_000099.jpg 59 181 | real/guitar/real_135_000210.jpg 60 182 | real/guitar/real_135_000595.jpg 60 183 | real/guitar/real_135_000624.jpg 60 184 | real/hammer/real_137_000141.jpg 61 185 | real/hammer/real_137_000136.jpg 61 186 | real/hammer/real_137_000297.jpg 61 187 | real/helicopter/real_143_000062.jpg 62 188 | real/helicopter/real_143_000312.jpg 62 189 | real/helicopter/real_143_000319.jpg 62 190 | real/helmet/real_144_000310.jpg 63 191 | real/helmet/real_144_000617.jpg 63 192 | real/helmet/real_144_000244.jpg 63 193 | real/horse/real_148_000213.jpg 64 194 | real/horse/real_148_000375.jpg 64 195 | real/horse/real_148_000419.jpg 64 196 | real/kangaroo/real_160_000420.jpg 65 197 | real/kangaroo/real_160_000320.jpg 65 198 | real/kangaroo/real_160_000265.jpg 65 199 | real/lantern/real_166_000417.jpg 66 200 | real/lantern/real_166_000029.jpg 66 201 | real/lantern/real_166_000340.jpg 66 202 | real/laptop/real_167_000308.jpg 67 203 | real/laptop/real_167_000118.jpg 67 204 | real/laptop/real_167_000239.jpg 67 205 | real/leaf/real_168_000406.jpg 68 206 | real/leaf/real_168_000141.jpg 68 207 | real/leaf/real_168_000248.jpg 68 208 | real/lion/real_175_000147.jpg 69 209 | real/lion/real_175_000281.jpg 69 210 | real/lion/real_175_000009.jpg 69 211 | real/lipstick/real_176_000291.jpg 70 212 | real/lipstick/real_176_000044.jpg 70 213 | real/lipstick/real_176_000428.jpg 70 214 | real/lobster/real_177_000327.jpg 71 215 | real/lobster/real_177_000490.jpg 71 216 | real/lobster/real_177_000617.jpg 71 217 | real/microphone/real_185_000110.jpg 72 218 | real/microphone/real_185_000158.jpg 72 219 | real/microphone/real_185_000270.jpg 72 220 | real/monkey/real_187_000432.jpg 73 221 | real/monkey/real_187_000501.jpg 73 222 | real/monkey/real_187_000110.jpg 73 223 | real/mosquito/real_189_000255.jpg 74 224 | real/mosquito/real_189_000216.jpg 74 225 | real/mosquito/real_189_000072.jpg 74 226 | real/mouse/real_192_000062.jpg 75 227 | real/mouse/real_192_000065.jpg 75 228 | real/mouse/real_192_000040.jpg 75 229 | real/mug/real_195_000379.jpg 76 230 | real/mug/real_195_000556.jpg 76 231 | real/mug/real_195_000254.jpg 76 232 | real/mushroom/real_196_000041.jpg 77 233 | real/mushroom/real_196_000497.jpg 77 234 | real/mushroom/real_196_000178.jpg 77 235 | real/onion/real_203_000545.jpg 78 236 | real/onion/real_203_000023.jpg 78 237 | real/onion/real_203_000505.jpg 78 238 | real/panda/real_209_000307.jpg 79 239 | real/panda/real_209_000223.jpg 79 240 | real/panda/real_209_000030.jpg 79 241 | real/peanut/real_215_000136.jpg 80 242 | real/peanut/real_215_000286.jpg 80 243 | real/peanut/real_215_000039.jpg 80 244 | real/pear/real_216_000001.jpg 81 245 | real/pear/real_216_000031.jpg 81 246 | real/pear/real_216_000098.jpg 81 247 | real/peas/real_217_000407.jpg 82 248 | real/peas/real_217_000441.jpg 82 249 | real/peas/real_217_000136.jpg 82 250 | real/pencil/real_218_000018.jpg 83 251 | real/pencil/real_218_000373.jpg 83 252 | real/pencil/real_218_000217.jpg 83 253 | real/penguin/real_219_000677.jpg 84 254 | real/penguin/real_219_000606.jpg 84 255 | real/penguin/real_219_000490.jpg 84 256 | real/pig/real_223_000555.jpg 85 257 | real/pig/real_223_000560.jpg 85 258 | real/pig/real_223_000210.jpg 85 259 | real/pillow/real_224_000519.jpg 86 260 | real/pillow/real_224_000375.jpg 86 261 | real/pillow/real_224_000046.jpg 86 262 | real/pineapple/real_225_000267.jpg 87 263 | real/pineapple/real_225_000003.jpg 87 264 | real/pineapple/real_225_000109.jpg 87 265 | real/potato/real_233_000577.jpg 88 266 | real/potato/real_233_000439.jpg 88 267 | real/potato/real_233_000180.jpg 88 268 | real/power_outlet/real_234_000391.jpg 89 269 | real/power_outlet/real_234_000092.jpg 89 270 | real/power_outlet/real_234_000310.jpg 89 271 | real/purse/real_235_000517.jpg 90 272 | real/purse/real_235_000485.jpg 90 273 | real/purse/real_235_000389.jpg 90 274 | real/rabbit/real_236_000667.jpg 91 275 | real/rabbit/real_236_000481.jpg 91 276 | real/rabbit/real_236_000129.jpg 91 277 | real/raccoon/real_237_000386.jpg 92 278 | real/raccoon/real_237_000574.jpg 92 279 | real/raccoon/real_237_000083.jpg 92 280 | real/rhinoceros/real_243_000358.jpg 93 281 | real/rhinoceros/real_243_000491.jpg 93 282 | real/rhinoceros/real_243_000608.jpg 93 283 | real/rifle/real_244_000463.jpg 94 284 | real/rifle/real_244_000029.jpg 94 285 | real/rifle/real_244_000435.jpg 94 286 | real/saxophone/real_251_000373.jpg 95 287 | real/saxophone/real_251_000093.jpg 95 288 | real/saxophone/real_251_000317.jpg 95 289 | real/screwdriver/real_255_000239.jpg 96 290 | real/screwdriver/real_255_000146.jpg 96 291 | real/screwdriver/real_255_000130.jpg 96 292 | real/sea_turtle/real_256_000544.jpg 97 293 | real/sea_turtle/real_256_000467.jpg 97 294 | real/sea_turtle/real_256_000256.jpg 97 295 | real/see_saw/real_257_000080.jpg 98 296 | real/see_saw/real_257_000188.jpg 98 297 | real/see_saw/real_257_000105.jpg 98 298 | real/sheep/real_259_000699.jpg 99 299 | real/sheep/real_259_000068.jpg 99 300 | real/sheep/real_259_000293.jpg 99 301 | real/shoe/real_260_000290.jpg 100 302 | real/shoe/real_260_000183.jpg 100 303 | real/shoe/real_260_000282.jpg 100 304 | real/skateboard/real_264_000374.jpg 101 305 | real/skateboard/real_264_000537.jpg 101 306 | real/skateboard/real_264_000452.jpg 101 307 | real/snake/real_270_000130.jpg 102 308 | real/snake/real_270_000102.jpg 102 309 | real/snake/real_270_000258.jpg 102 310 | real/speedboat/real_276_000037.jpg 103 311 | real/speedboat/real_276_000333.jpg 103 312 | real/speedboat/real_276_000303.jpg 103 313 | real/spider/real_277_000534.jpg 104 314 | real/spider/real_277_000506.jpg 104 315 | real/spider/real_277_000288.jpg 104 316 | real/squirrel/real_282_000010.jpg 105 317 | real/squirrel/real_282_000387.jpg 105 318 | real/squirrel/real_282_000256.jpg 105 319 | real/strawberry/real_291_000348.jpg 106 320 | real/strawberry/real_291_000424.jpg 106 321 | real/strawberry/real_291_000244.jpg 106 322 | real/streetlight/real_292_000339.jpg 107 323 | real/streetlight/real_292_000140.jpg 107 324 | real/streetlight/real_292_000364.jpg 107 325 | real/string_bean/real_293_000416.jpg 108 326 | real/string_bean/real_293_000436.jpg 108 327 | real/string_bean/real_293_000430.jpg 108 328 | real/submarine/real_294_000594.jpg 109 329 | real/submarine/real_294_000301.jpg 109 330 | real/submarine/real_294_000192.jpg 109 331 | real/swan/real_297_000278.jpg 110 332 | real/swan/real_297_000157.jpg 110 333 | real/swan/real_297_000089.jpg 110 334 | real/table/real_302_000296.jpg 111 335 | real/table/real_302_000311.jpg 111 336 | real/table/real_302_000307.jpg 111 337 | real/teapot/real_303_000264.jpg 112 338 | real/teapot/real_303_000158.jpg 112 339 | real/teapot/real_303_000550.jpg 112 340 | real/teddy-bear/real_304_000326.jpg 113 341 | real/teddy-bear/real_304_000477.jpg 113 342 | real/teddy-bear/real_304_000319.jpg 113 343 | real/television/real_306_000320.jpg 114 344 | real/television/real_306_000038.jpg 114 345 | real/television/real_306_000391.jpg 114 346 | real/The_Eiffel_Tower/real_309_000440.jpg 115 347 | real/The_Eiffel_Tower/real_309_000131.jpg 115 348 | real/The_Eiffel_Tower/real_309_000177.jpg 115 349 | real/The_Great_Wall_of_China/real_310_000424.jpg 116 350 | real/The_Great_Wall_of_China/real_310_000294.jpg 116 351 | real/The_Great_Wall_of_China/real_310_000440.jpg 116 352 | real/tiger/real_312_000291.jpg 117 353 | real/tiger/real_312_000124.jpg 117 354 | real/tiger/real_312_000013.jpg 117 355 | real/toe/real_314_000228.jpg 118 356 | real/toe/real_314_000054.jpg 118 357 | real/toe/real_314_000296.jpg 118 358 | real/train/real_322_000531.jpg 119 359 | real/train/real_322_000518.jpg 119 360 | real/train/real_322_000003.jpg 119 361 | real/truck/real_326_000562.jpg 120 362 | real/truck/real_326_000313.jpg 120 363 | real/truck/real_326_000459.jpg 120 364 | real/umbrella/real_329_000104.jpg 121 365 | real/umbrella/real_329_000169.jpg 121 366 | real/umbrella/real_329_000001.jpg 121 367 | real/vase/real_332_000040.jpg 122 368 | real/vase/real_332_000327.jpg 122 369 | real/vase/real_332_000583.jpg 122 370 | real/watermelon/real_335_000422.jpg 123 371 | real/watermelon/real_335_000311.jpg 123 372 | real/watermelon/real_335_000092.jpg 123 373 | real/whale/real_337_000211.jpg 124 374 | real/whale/real_337_000537.jpg 124 375 | real/whale/real_337_000312.jpg 124 376 | real/zebra/real_344_000175.jpg 125 377 | real/zebra/real_344_000073.jpg 125 378 | real/zebra/real_344_000281.jpg 125 379 | -------------------------------------------------------------------------------- /data/txt/multi/validation_target_images_real_3.txt: -------------------------------------------------------------------------------- 1 | real/aircraft_carrier/real_001_000337.jpg 0 2 | real/aircraft_carrier/real_001_000100.jpg 0 3 | real/aircraft_carrier/real_001_000085.jpg 0 4 | real/alarm_clock/real_003_000071.jpg 1 5 | real/alarm_clock/real_003_000318.jpg 1 6 | real/alarm_clock/real_003_000017.jpg 1 7 | real/ant/real_007_000336.jpg 2 8 | real/ant/real_007_000098.jpg 2 9 | real/ant/real_007_000120.jpg 2 10 | real/anvil/real_008_000191.jpg 3 11 | real/anvil/real_008_000192.jpg 3 12 | real/anvil/real_008_000054.jpg 3 13 | real/asparagus/real_011_000313.jpg 4 14 | real/asparagus/real_011_000325.jpg 4 15 | real/asparagus/real_011_000512.jpg 4 16 | real/axe/real_012_000073.jpg 5 17 | real/axe/real_012_000039.jpg 5 18 | real/axe/real_012_000241.jpg 5 19 | real/banana/real_014_000031.jpg 6 20 | real/banana/real_014_000233.jpg 6 21 | real/banana/real_014_000073.jpg 6 22 | real/basket/real_019_000063.jpg 7 23 | real/basket/real_019_000412.jpg 7 24 | real/basket/real_019_000397.jpg 7 25 | real/bathtub/real_022_000213.jpg 8 26 | real/bathtub/real_022_000039.jpg 8 27 | real/bathtub/real_022_000216.jpg 8 28 | real/bear/real_024_000080.jpg 9 29 | real/bear/real_024_000558.jpg 9 30 | real/bear/real_024_000508.jpg 9 31 | real/bee/real_027_000322.jpg 10 32 | real/bee/real_027_000192.jpg 10 33 | real/bee/real_027_000019.jpg 10 34 | real/bird/real_032_000167.jpg 11 35 | real/bird/real_032_000171.jpg 11 36 | real/bird/real_032_000674.jpg 11 37 | real/blackberry/real_034_000410.jpg 12 38 | real/blackberry/real_034_000372.jpg 12 39 | real/blackberry/real_034_000187.jpg 12 40 | real/blueberry/real_035_000169.jpg 13 41 | real/blueberry/real_035_000563.jpg 13 42 | real/blueberry/real_035_000382.jpg 13 43 | real/bottlecap/real_038_000549.jpg 14 44 | real/bottlecap/real_038_000523.jpg 14 45 | real/bottlecap/real_038_000185.jpg 14 46 | real/broccoli/real_044_000062.jpg 15 47 | real/broccoli/real_044_000485.jpg 15 48 | real/broccoli/real_044_000557.jpg 15 49 | real/bus/real_048_000079.jpg 16 50 | real/bus/real_048_000570.jpg 16 51 | real/bus/real_048_000538.jpg 16 52 | real/butterfly/real_050_000315.jpg 17 53 | real/butterfly/real_050_000609.jpg 17 54 | real/butterfly/real_050_000027.jpg 17 55 | real/cactus/real_051_000122.jpg 18 56 | real/cactus/real_051_000627.jpg 18 57 | real/cactus/real_051_000399.jpg 18 58 | real/cake/real_052_000271.jpg 19 59 | real/cake/real_052_000081.jpg 19 60 | real/cake/real_052_000249.jpg 19 61 | real/calculator/real_053_000011.jpg 20 62 | real/calculator/real_053_000150.jpg 20 63 | real/calculator/real_053_000200.jpg 20 64 | real/camel/real_055_000427.jpg 21 65 | real/camel/real_055_000335.jpg 21 66 | real/camel/real_055_000302.jpg 21 67 | real/camera/real_056_000372.jpg 22 68 | real/camera/real_056_000333.jpg 22 69 | real/camera/real_056_000038.jpg 22 70 | real/candle/real_059_000602.jpg 23 71 | real/candle/real_059_000111.jpg 23 72 | real/candle/real_059_000362.jpg 23 73 | real/cannon/real_060_000103.jpg 24 74 | real/cannon/real_060_000054.jpg 24 75 | real/cannon/real_060_000030.jpg 24 76 | real/canoe/real_061_000108.jpg 25 77 | real/canoe/real_061_000478.jpg 25 78 | real/canoe/real_061_000549.jpg 25 79 | real/carrot/real_063_000135.jpg 26 80 | real/carrot/real_063_000113.jpg 26 81 | real/carrot/real_063_000452.jpg 26 82 | real/castle/real_064_000119.jpg 27 83 | real/castle/real_064_000013.jpg 27 84 | real/castle/real_064_000677.jpg 27 85 | real/cat/real_065_000740.jpg 28 86 | real/cat/real_065_000248.jpg 28 87 | real/cat/real_065_000127.jpg 28 88 | real/ceiling_fan/real_066_000186.jpg 29 89 | real/ceiling_fan/real_066_000079.jpg 29 90 | real/ceiling_fan/real_066_000131.jpg 29 91 | real/cello/real_067_000373.jpg 30 92 | real/cello/real_067_000062.jpg 30 93 | real/cello/real_067_000194.jpg 30 94 | real/cell_phone/real_068_000446.jpg 31 95 | real/cell_phone/real_068_000486.jpg 31 96 | real/cell_phone/real_068_000147.jpg 31 97 | real/chair/real_069_000078.jpg 32 98 | real/chair/real_069_000177.jpg 32 99 | real/chair/real_069_000205.jpg 32 100 | real/chandelier/real_070_000254.jpg 33 101 | real/chandelier/real_070_000128.jpg 33 102 | real/chandelier/real_070_000234.jpg 33 103 | real/coffee_cup/real_076_000326.jpg 34 104 | real/coffee_cup/real_076_000147.jpg 34 105 | real/coffee_cup/real_076_000034.jpg 34 106 | real/compass/real_077_000052.jpg 35 107 | real/compass/real_077_000171.jpg 35 108 | real/compass/real_077_000017.jpg 35 109 | real/computer/real_078_000200.jpg 36 110 | real/computer/real_078_000236.jpg 36 111 | real/computer/real_078_000122.jpg 36 112 | real/cow/real_082_000441.jpg 37 113 | real/cow/real_082_000497.jpg 37 114 | real/cow/real_082_000315.jpg 37 115 | real/crab/real_083_000199.jpg 38 116 | real/crab/real_083_000628.jpg 38 117 | real/crab/real_083_000559.jpg 38 118 | real/crocodile/real_085_000276.jpg 39 119 | real/crocodile/real_085_000060.jpg 39 120 | real/crocodile/real_085_000400.jpg 39 121 | real/cruise_ship/real_087_000489.jpg 40 122 | real/cruise_ship/real_087_000398.jpg 40 123 | real/cruise_ship/real_087_000258.jpg 40 124 | real/dog/real_092_000398.jpg 41 125 | real/dog/real_092_000048.jpg 41 126 | real/dog/real_092_000658.jpg 41 127 | real/dolphin/real_093_000090.jpg 42 128 | real/dolphin/real_093_000575.jpg 42 129 | real/dolphin/real_093_000472.jpg 42 130 | real/dragon/real_096_000399.jpg 43 131 | real/dragon/real_096_000083.jpg 43 132 | real/dragon/real_096_000173.jpg 43 133 | real/drums/real_099_000652.jpg 44 134 | real/drums/real_099_000084.jpg 44 135 | real/drums/real_099_000545.jpg 44 136 | real/duck/real_100_000100.jpg 45 137 | real/duck/real_100_000087.jpg 45 138 | real/duck/real_100_000183.jpg 45 139 | real/dumbbell/real_101_000547.jpg 46 140 | real/dumbbell/real_101_000229.jpg 46 141 | real/dumbbell/real_101_000293.jpg 46 142 | real/elephant/real_104_000511.jpg 47 143 | real/elephant/real_104_000372.jpg 47 144 | real/elephant/real_104_000567.jpg 47 145 | real/eyeglasses/real_108_000257.jpg 48 146 | real/eyeglasses/real_108_000184.jpg 48 147 | real/eyeglasses/real_108_000087.jpg 48 148 | real/feather/real_111_000479.jpg 49 149 | real/feather/real_111_000015.jpg 49 150 | real/feather/real_111_000227.jpg 49 151 | real/fence/real_112_000168.jpg 50 152 | real/fence/real_112_000403.jpg 50 153 | real/fence/real_112_000252.jpg 50 154 | real/fish/real_117_000347.jpg 51 155 | real/fish/real_117_000278.jpg 51 156 | real/fish/real_117_000151.jpg 51 157 | real/flamingo/real_118_000311.jpg 52 158 | real/flamingo/real_118_000053.jpg 52 159 | real/flamingo/real_118_000314.jpg 52 160 | real/flower/real_122_000092.jpg 53 161 | real/flower/real_122_000126.jpg 53 162 | real/flower/real_122_000191.jpg 53 163 | real/foot/real_124_000250.jpg 54 164 | real/foot/real_124_000546.jpg 54 165 | real/foot/real_124_000527.jpg 54 166 | real/fork/real_125_000187.jpg 55 167 | real/fork/real_125_000086.jpg 55 168 | real/fork/real_125_000310.jpg 55 169 | real/frog/real_126_000256.jpg 56 170 | real/frog/real_126_000208.jpg 56 171 | real/frog/real_126_000079.jpg 56 172 | real/giraffe/real_130_000445.jpg 57 173 | real/giraffe/real_130_000540.jpg 57 174 | real/giraffe/real_130_000517.jpg 57 175 | real/goatee/real_131_000449.jpg 58 176 | real/goatee/real_131_000194.jpg 58 177 | real/goatee/real_131_000026.jpg 58 178 | real/grapes/real_133_000543.jpg 59 179 | real/grapes/real_133_000726.jpg 59 180 | real/grapes/real_133_000474.jpg 59 181 | real/guitar/real_135_000302.jpg 60 182 | real/guitar/real_135_000084.jpg 60 183 | real/guitar/real_135_000154.jpg 60 184 | real/hammer/real_137_000219.jpg 61 185 | real/hammer/real_137_000023.jpg 61 186 | real/hammer/real_137_000129.jpg 61 187 | real/helicopter/real_143_000491.jpg 62 188 | real/helicopter/real_143_000339.jpg 62 189 | real/helicopter/real_143_000768.jpg 62 190 | real/helmet/real_144_000509.jpg 63 191 | real/helmet/real_144_000203.jpg 63 192 | real/helmet/real_144_000354.jpg 63 193 | real/horse/real_148_000069.jpg 64 194 | real/horse/real_148_000275.jpg 64 195 | real/horse/real_148_000591.jpg 64 196 | real/kangaroo/real_160_000278.jpg 65 197 | real/kangaroo/real_160_000386.jpg 65 198 | real/kangaroo/real_160_000275.jpg 65 199 | real/lantern/real_166_000394.jpg 66 200 | real/lantern/real_166_000001.jpg 66 201 | real/lantern/real_166_000051.jpg 66 202 | real/laptop/real_167_000195.jpg 67 203 | real/laptop/real_167_000201.jpg 67 204 | real/laptop/real_167_000216.jpg 67 205 | real/leaf/real_168_000210.jpg 68 206 | real/leaf/real_168_000135.jpg 68 207 | real/leaf/real_168_000336.jpg 68 208 | real/lion/real_175_000462.jpg 69 209 | real/lion/real_175_000065.jpg 69 210 | real/lion/real_175_000377.jpg 69 211 | real/lipstick/real_176_000324.jpg 70 212 | real/lipstick/real_176_000196.jpg 70 213 | real/lipstick/real_176_000309.jpg 70 214 | real/lobster/real_177_000278.jpg 71 215 | real/lobster/real_177_000585.jpg 71 216 | real/lobster/real_177_000447.jpg 71 217 | real/microphone/real_185_000092.jpg 72 218 | real/microphone/real_185_000283.jpg 72 219 | real/microphone/real_185_000137.jpg 72 220 | real/monkey/real_187_000328.jpg 73 221 | real/monkey/real_187_000531.jpg 73 222 | real/monkey/real_187_000179.jpg 73 223 | real/mosquito/real_189_000558.jpg 74 224 | real/mosquito/real_189_000525.jpg 74 225 | real/mosquito/real_189_000417.jpg 74 226 | real/mouse/real_192_000093.jpg 75 227 | real/mouse/real_192_000035.jpg 75 228 | real/mouse/real_192_000131.jpg 75 229 | real/mug/real_195_000342.jpg 76 230 | real/mug/real_195_000086.jpg 76 231 | real/mug/real_195_000482.jpg 76 232 | real/mushroom/real_196_000049.jpg 77 233 | real/mushroom/real_196_000516.jpg 77 234 | real/mushroom/real_196_000141.jpg 77 235 | real/onion/real_203_000581.jpg 78 236 | real/onion/real_203_000068.jpg 78 237 | real/onion/real_203_000210.jpg 78 238 | real/panda/real_209_000138.jpg 79 239 | real/panda/real_209_000547.jpg 79 240 | real/panda/real_209_000387.jpg 79 241 | real/peanut/real_215_000095.jpg 80 242 | real/peanut/real_215_000044.jpg 80 243 | real/peanut/real_215_000365.jpg 80 244 | real/pear/real_216_000136.jpg 81 245 | real/pear/real_216_000061.jpg 81 246 | real/pear/real_216_000205.jpg 81 247 | real/peas/real_217_000333.jpg 82 248 | real/peas/real_217_000471.jpg 82 249 | real/peas/real_217_000150.jpg 82 250 | real/pencil/real_218_000262.jpg 83 251 | real/pencil/real_218_000442.jpg 83 252 | real/pencil/real_218_000392.jpg 83 253 | real/penguin/real_219_000310.jpg 84 254 | real/penguin/real_219_000229.jpg 84 255 | real/penguin/real_219_000080.jpg 84 256 | real/pig/real_223_000072.jpg 85 257 | real/pig/real_223_000191.jpg 85 258 | real/pig/real_223_000073.jpg 85 259 | real/pillow/real_224_000295.jpg 86 260 | real/pillow/real_224_000133.jpg 86 261 | real/pillow/real_224_000323.jpg 86 262 | real/pineapple/real_225_000246.jpg 87 263 | real/pineapple/real_225_000597.jpg 87 264 | real/pineapple/real_225_000082.jpg 87 265 | real/potato/real_233_000131.jpg 88 266 | real/potato/real_233_000044.jpg 88 267 | real/potato/real_233_000004.jpg 88 268 | real/power_outlet/real_234_000380.jpg 89 269 | real/power_outlet/real_234_000615.jpg 89 270 | real/power_outlet/real_234_000029.jpg 89 271 | real/purse/real_235_000353.jpg 90 272 | real/purse/real_235_000088.jpg 90 273 | real/purse/real_235_000402.jpg 90 274 | real/rabbit/real_236_000100.jpg 91 275 | real/rabbit/real_236_000525.jpg 91 276 | real/rabbit/real_236_000123.jpg 91 277 | real/raccoon/real_237_000138.jpg 92 278 | real/raccoon/real_237_000480.jpg 92 279 | real/raccoon/real_237_000560.jpg 92 280 | real/rhinoceros/real_243_000669.jpg 93 281 | real/rhinoceros/real_243_000609.jpg 93 282 | real/rhinoceros/real_243_000406.jpg 93 283 | real/rifle/real_244_000190.jpg 94 284 | real/rifle/real_244_000301.jpg 94 285 | real/rifle/real_244_000455.jpg 94 286 | real/saxophone/real_251_000474.jpg 95 287 | real/saxophone/real_251_000470.jpg 95 288 | real/saxophone/real_251_000345.jpg 95 289 | real/screwdriver/real_255_000402.jpg 96 290 | real/screwdriver/real_255_000309.jpg 96 291 | real/screwdriver/real_255_000162.jpg 96 292 | real/sea_turtle/real_256_000446.jpg 97 293 | real/sea_turtle/real_256_000171.jpg 97 294 | real/sea_turtle/real_256_000492.jpg 97 295 | real/see_saw/real_257_000094.jpg 98 296 | real/see_saw/real_257_000003.jpg 98 297 | real/see_saw/real_257_000163.jpg 98 298 | real/sheep/real_259_000077.jpg 99 299 | real/sheep/real_259_000299.jpg 99 300 | real/sheep/real_259_000660.jpg 99 301 | real/shoe/real_260_000469.jpg 100 302 | real/shoe/real_260_000573.jpg 100 303 | real/shoe/real_260_000542.jpg 100 304 | real/skateboard/real_264_000197.jpg 101 305 | real/skateboard/real_264_000336.jpg 101 306 | real/skateboard/real_264_000519.jpg 101 307 | real/snake/real_270_000425.jpg 102 308 | real/snake/real_270_000462.jpg 102 309 | real/snake/real_270_000400.jpg 102 310 | real/speedboat/real_276_000597.jpg 103 311 | real/speedboat/real_276_000535.jpg 103 312 | real/speedboat/real_276_000256.jpg 103 313 | real/spider/real_277_000269.jpg 104 314 | real/spider/real_277_000395.jpg 104 315 | real/spider/real_277_000194.jpg 104 316 | real/squirrel/real_282_000333.jpg 105 317 | real/squirrel/real_282_000426.jpg 105 318 | real/squirrel/real_282_000318.jpg 105 319 | real/strawberry/real_291_000327.jpg 106 320 | real/strawberry/real_291_000201.jpg 106 321 | real/strawberry/real_291_000318.jpg 106 322 | real/streetlight/real_292_000406.jpg 107 323 | real/streetlight/real_292_000217.jpg 107 324 | real/streetlight/real_292_000285.jpg 107 325 | real/string_bean/real_293_000075.jpg 108 326 | real/string_bean/real_293_000447.jpg 108 327 | real/string_bean/real_293_000289.jpg 108 328 | real/submarine/real_294_000039.jpg 109 329 | real/submarine/real_294_000490.jpg 109 330 | real/submarine/real_294_000427.jpg 109 331 | real/swan/real_297_000121.jpg 110 332 | real/swan/real_297_000177.jpg 110 333 | real/swan/real_297_000320.jpg 110 334 | real/table/real_302_000300.jpg 111 335 | real/table/real_302_000269.jpg 111 336 | real/table/real_302_000316.jpg 111 337 | real/teapot/real_303_000161.jpg 112 338 | real/teapot/real_303_000531.jpg 112 339 | real/teapot/real_303_000575.jpg 112 340 | real/teddy-bear/real_304_000436.jpg 113 341 | real/teddy-bear/real_304_000335.jpg 113 342 | real/teddy-bear/real_304_000476.jpg 113 343 | real/television/real_306_000247.jpg 114 344 | real/television/real_306_000200.jpg 114 345 | real/television/real_306_000256.jpg 114 346 | real/The_Eiffel_Tower/real_309_000273.jpg 115 347 | real/The_Eiffel_Tower/real_309_000326.jpg 115 348 | real/The_Eiffel_Tower/real_309_000425.jpg 115 349 | real/The_Great_Wall_of_China/real_310_000388.jpg 116 350 | real/The_Great_Wall_of_China/real_310_000370.jpg 116 351 | real/The_Great_Wall_of_China/real_310_000491.jpg 116 352 | real/tiger/real_312_000204.jpg 117 353 | real/tiger/real_312_000367.jpg 117 354 | real/tiger/real_312_000363.jpg 117 355 | real/toe/real_314_000327.jpg 118 356 | real/toe/real_314_000166.jpg 118 357 | real/toe/real_314_000340.jpg 118 358 | real/train/real_322_000130.jpg 119 359 | real/train/real_322_000617.jpg 119 360 | real/train/real_322_000480.jpg 119 361 | real/truck/real_326_000508.jpg 120 362 | real/truck/real_326_000166.jpg 120 363 | real/truck/real_326_000651.jpg 120 364 | real/umbrella/real_329_000232.jpg 121 365 | real/umbrella/real_329_000159.jpg 121 366 | real/umbrella/real_329_000038.jpg 121 367 | real/vase/real_332_000591.jpg 122 368 | real/vase/real_332_000284.jpg 122 369 | real/vase/real_332_000235.jpg 122 370 | real/watermelon/real_335_000388.jpg 123 371 | real/watermelon/real_335_000627.jpg 123 372 | real/watermelon/real_335_000630.jpg 123 373 | real/whale/real_337_000510.jpg 124 374 | real/whale/real_337_000183.jpg 124 375 | real/whale/real_337_000173.jpg 124 376 | real/zebra/real_344_000413.jpg 125 377 | real/zebra/real_344_000125.jpg 125 378 | real/zebra/real_344_000430.jpg 125 379 | -------------------------------------------------------------------------------- /utils/loss.py: -------------------------------------------------------------------------------- 1 | import torch.nn.functional as F 2 | import torch 3 | import numpy as np 4 | from torch.autograd import Function 5 | import torch.nn as nn 6 | from pdb import set_trace as breakpoint 7 | import sys 8 | 9 | # from vat import VirtualAdversarialPerturbationGenerator,disable_tracking_bn_stats 10 | 11 | class GradReverse(Function): 12 | def __init__(self, lambd): 13 | self.lambd = lambd 14 | 15 | def forward(self, x): 16 | return x.view_as(x) 17 | 18 | def backward(self, grad_output): 19 | return (grad_output * -self.lambd) 20 | 21 | 22 | def grad_reverse(x, lambd=1.0): 23 | return GradReverse(lambd)(x) 24 | 25 | 26 | def calc_coeff(iter_num, high=1.0, low=0.0, alpha=10.0, max_iter=10000.0): 27 | return np.float(2.0 * (high - low) / 28 | (1.0 + np.exp(-alpha * iter_num / max_iter)) - 29 | (high - low) + low) 30 | 31 | 32 | def entropy(F1, feat, lamda, eta=1.0): 33 | out_t1 = F1(feat, reverse=True, eta=-eta) 34 | out_t1 = F.softmax(out_t1) 35 | loss_ent = -lamda * torch.mean(torch.sum(out_t1 * 36 | (torch.log(out_t1 + 1e-5)), 1)) 37 | return loss_ent 38 | 39 | 40 | def adentropy(F1, feat, lamda, eta=1.0): 41 | # feat = fea 42 | out_t1 = F1(feat, reverse=True, eta=eta) 43 | out_t1 = F.softmax(out_t1) 44 | loss_adent = lamda * torch.mean(torch.sum(out_t1 * 45 | (torch.log(out_t1 + 1e-5)), 1)) 46 | return loss_adent 47 | 48 | 49 | 50 | 51 | def kl_div_consistency(F1, feat, feat_aug): 52 | bs = feat.size(0) 53 | all_feat = torch.cat((feat, feat_aug)) 54 | all_logit = F1(all_feat) 55 | feat_logit, aug_logit = all_logit[:bs], all_logit[bs:] 56 | kl_div_loss = nn.functional.kl_div(F.log_softmax(aug_logit, dim=1), F.softmax(feat_logit, dim=1))*bs 57 | 58 | return kl_div_loss 59 | 60 | 61 | 62 | 63 | def joint_ent(F1, x_out, x_tf_out, lamb=1.0, gamma=1.0,eta=1.0,EPS=sys.float_info.epsilon): 64 | # has had softmax applied 65 | out_t1 = F1(x_out, reverse=True, eta=-eta) 66 | out_t1 = F.softmax(out_t1) 67 | 68 | out_t2 = F1(x_tf_out, reverse=True, eta=-eta) 69 | out_t2 = F.softmax(out_t2) 70 | #breakpoint() 71 | _, k = out_t1.size() 72 | p_i_j = compute_joint(out_t1, out_t2) 73 | assert (p_i_j.size() == (k, k)) 74 | 75 | 76 | loss = - p_i_j * torch.log(p_i_j) 77 | #breakpoint() 78 | loss = loss.sum() 79 | 80 | return lamb*loss 81 | 82 | def compute_joint(x_out, x_tf_out): 83 | # produces variable that requires grad (since args require grad) 84 | 85 | bn, k = x_out.size() 86 | assert (x_tf_out.size(0) == bn and x_tf_out.size(1) == k) 87 | 88 | p_i_j = x_out.unsqueeze(2) * x_tf_out.unsqueeze(1) # bn, k, k 89 | p_i_j = p_i_j.sum(dim=0) # k, k 90 | p_i_j = (p_i_j + p_i_j.t()) / 2. # symmetrise 91 | p_i_j = p_i_j / p_i_j.sum() # normalise 92 | 93 | return p_i_j 94 | 95 | # def kl(p, q): 96 | # return torch.sum(p * F.log((p + 1e-8) / (q + 1e-8))) / float(len(p.data)) 97 | 98 | def contractive_loss(inputs,temp=0.1): 99 | 100 | similarity = inputs / inputs.norm(dim=1)[:, None] 101 | #b_norm = b / b.norm(dim=1)[:, None] 102 | similarity = torch.mm(similarity, similarity.transpose(0,1))/temp # (2n, 2n) 103 | similarity[range(len(similarity)), range(len(similarity))] = torch.zeros(len(inputs)).cuda() 104 | #similarity = F.cosine_similarity(inputs, inputs)/temp # (2n, 2n) 105 | N=len(inputs)/2 106 | for i in range(0,N): 107 | if i==0: 108 | loss = -torch.log(similarity[i,i+N]/ torch.sum( similarity[i] )) -torch.log(similarity[i+N,i]/ torch.sum( similarity[i+N] )) 109 | else: 110 | loss += -torch.log(similarity[i,i+N]/ torch.sum( similarity[i] ))-torch.log(similarity[i+N,i]/ torch.sum( similarity[i+N] )) 111 | return loss/(2*N) 112 | 113 | 114 | 115 | class LDSLoss(object): 116 | def __init__(self, feature_extractor,classifier, xi=1e-6, eps=15, ip=1): 117 | self.feature_extractor = feature_extractor 118 | self.classifier = classifier 119 | self.vap_generator = VirtualAdversarialPerturbationGenerator(self.feature_extractor,self.classifier, xi=xi, eps=eps, ip=ip) 120 | self.kl_div_loss = nn.KLDivLoss() 121 | 122 | def __call__(self, inputs): 123 | r_adv, logits = self.vap_generator(inputs) 124 | 125 | adv_inputs = inputs + r_adv 126 | with disable_tracking_bn_stats(self.feature_extractor): 127 | with disable_tracking_bn_stats(self.classifier): 128 | adv_logits = self.feature_extractor(adv_inputs) 129 | adv_logits = self.classifier(adv_logits) 130 | lds_loss = self.kl_div_loss(F.log_softmax(adv_logits, dim=1), F.softmax(logits, dim=1)) 131 | 132 | return lds_loss 133 | 134 | 135 | 136 | def normalize(x, axis=-1): 137 | """Normalizing to unit length along the specified dimension. 138 | Args: 139 | x: pytorch Variable 140 | Returns: 141 | x: pytorch Variable, same shape as input 142 | """ 143 | x = 1. * x / (torch.norm(x, 2, axis, keepdim=True).expand_as(x) + 1e-12) 144 | return x 145 | 146 | 147 | def euclidean_dist(x, y): 148 | """ 149 | Args: 150 | x: pytorch Variable, with shape [m, d] 151 | y: pytorch Variable, with shape [n, d] 152 | Returns: 153 | dist: pytorch Variable, with shape [m, n] 154 | """ 155 | m, n = x.size(0), y.size(0) 156 | xx = torch.pow(x, 2).sum(1, keepdim=True).expand(m, n) 157 | yy = torch.pow(y, 2).sum(1, keepdim=True).expand(n, m).t() 158 | dist = xx + yy 159 | dist.addmm_(1, -2, x, y.t()) 160 | dist = dist.clamp(min=1e-12).sqrt() # for numerical stability 161 | return dist 162 | 163 | 164 | def regLoss(feat_s1, feat_s2, feat_t, gen_feat, margin=0.1): 165 | 166 | dist_ss = torch.sum((feat_s1 - feat_s2)**2, dim=1) 167 | dist_gen_t = torch.sum((feat_t - gen_feat)**2, dim=1) 168 | dist_gen_s1 = torch.sum((feat_s1 - gen_feat)**2, dim=1) 169 | dist_gen_s2 = torch.sum((feat_s2 - gen_feat)**2, dim=1) 170 | min_dist_gen_s = torch.min(dist_gen_s1, dist_gen_s2) 171 | 172 | loss1 = F.relu(dist_ss - dist_gen_t + margin).mean() 173 | loss2 = F.relu(dist_gen_t - min_dist_gen_s + margin).mean() 174 | 175 | # loss1 = F.relu(dist_ss - dist_gen_t + margin) 176 | # loss2 = F.relu(dist_gen_t - min_dist_gen_s + margin) 177 | 178 | return loss1 + loss2 179 | 180 | 181 | def regLoss_dummy(feat_s1, feat_s2, feat_t, gen_feat, margin=0.1): 182 | 183 | faet = torch.cat((feat_s1, feat_s2, feat_t)) 184 | 185 | # dist_ss = torch.sum((feat_s1 - feat_s2)**2, dim=1) 186 | # dist_gen_t = torch.sum((feat_t - gen_feat)**2, dim=1) 187 | # dist_gen_s1 = torch.sum((feat_s1 - gen_feat)**2, dim=1) 188 | # dist_gen_s2 = torch.sum((feat_s2 - gen_feat)**2, dim=1) 189 | # min_dist_gen_s = torch.min(dist_gen_s1, dist_gen_s2) 190 | 191 | # loss1 = F.relu(dist_ss - dist_gen_t + margin).mean() 192 | # loss2 = F.relu(dist_gen_t - min_dist_gen_s + margin).mean() 193 | 194 | return loss1 + loss2 195 | 196 | 197 | 198 | 199 | """ 200 | dSNE Loss 201 | """ 202 | def __init__(self, margin=None): 203 | self.margin = margin 204 | # if margin is not None: 205 | # self.ranking_loss = nn.MarginRankingLoss(margin=margin) 206 | # else: 207 | self.ranking_loss = nn.SoftMarginLoss() 208 | 209 | def __call__(self, fts, ys, ftt, yt, normalize_feature=False): 210 | 211 | if normalize_feature: 212 | fts = normalize(fts) 213 | ftt = normalize(ftt) 214 | 215 | ns, nt = fts.size(0), ftt.size(0) 216 | #breakpoint() 217 | fts_rpt = fts.unsqueeze(0).expand(nt, ns, -1) 218 | ftt_rpt = ftt.unsqueeze(1).expand(nt, ns, -1) 219 | 220 | # fts_rpt = F.broadcast_to(fts.expand_dims(axis=0), shape=(self._bs_tgt, self._bs_src, self._embed_size)) 221 | # ftt_rpt = F.broadcast_to(ftt.expand_dims(axis=1), shape=(self._bs_tgt, self._bs_src, self._embed_size)) 222 | 223 | dist_mat = torch.sum((ftt_rpt - fts_rpt)**2, dim=2) 224 | 225 | # breakpoint() 226 | # is_pos = yt.expand(N, N).eq(ys.expand(N, N).t()) 227 | # is_neg = yt.expand(N, N).ne(ys.expand(N, N).t()) 228 | 229 | ys_rep = ys.unsqueeze(0).expand(nt, ns) 230 | yt_rep = yt.unsqueeze(1).expand(nt, ns) 231 | is_pos = yt_rep.eq(ys_rep) 232 | is_neg = 1-is_pos 233 | 234 | #breakpoint() 235 | 236 | intra_cls_dists = dist_mat * is_pos.float() 237 | inter_cls_dists = dist_mat * is_neg.float() 238 | 239 | 240 | max_dists, _ = torch.max(dist_mat, dim=1, keepdim=True) 241 | max_dists = max_dists.expand(nt, ns) 242 | 243 | revised_inter_cls_dists = torch.where(is_pos, max_dists, inter_cls_dists) 244 | 245 | max_intra_cls_dist, _ = torch.max(intra_cls_dists, dim=1, keepdim=True) 246 | min_inter_cls_dist, _ = torch.min(revised_inter_cls_dists, dim=1, keepdim=True) 247 | 248 | # dist_ap, relative_p_inds = torch.max( 249 | # dist_mat[is_pos].contiguous().view(N, -1), 1, keepdim=True) 250 | # dist_an, relative_n_inds = torch.min( 251 | # dist_mat[is_neg].contiguous().view(N, -1), 1, keepdim=True) 252 | 253 | dist_ap = max_intra_cls_dist.squeeze(1) 254 | dist_an = min_inter_cls_dist.squeeze(1) 255 | 256 | 257 | # breakpoint() 258 | 259 | # y = dist_an.new().resize_as_(dist_an).fill_(1) 260 | # if self.margin is not None: 261 | # loss = self.ranking_loss(dist_an, dist_ap, y) 262 | # else: 263 | # loss = self.ranking_loss(dist_an - dist_ap, y) 264 | # return loss 265 | 266 | # breakpoint() 267 | 268 | loss = F.relu(dist_ap - dist_an + self.margin).mean() 269 | return loss 270 | 271 | 272 | 273 | 274 | class PrototypeLoss(object): 275 | def __init__(self, ways=10, trg_shots=3, src_shots=10): 276 | self.ways = ways 277 | self.trg_shots = trg_shots 278 | self.src_shots = src_shots 279 | 280 | label = torch.arange(self.ways).unsqueeze(0).repeat(self.src_shots, 1).t().contiguous().view(-1).squeeze(0) 281 | # label = torch.arange(self.src_shots).repeat(self.src_shots) 282 | 283 | label = label.type(torch.cuda.LongTensor) 284 | self.label = label 285 | 286 | 287 | def __call__(self, src_feat, target_feat, normalize_feature=False): 288 | 289 | if normalize: 290 | src_feat = normalize(src_feat, axis=-1) 291 | proto = normalize(target_feat, axis=-1) 292 | 293 | # breakpoint() 294 | 295 | if self.trg_shots > 1: 296 | proto = proto.reshape(self.trg_shots, self.ways, -1).mean(dim=0) 297 | 298 | 299 | n = src_feat.shape[0] 300 | m = proto.shape[0] 301 | src_feat = src_feat.unsqueeze(1).expand(n, m, -1) 302 | proto = proto.unsqueeze(0).expand(n, m, -1) 303 | logits = -((src_feat - proto)**2).sum(dim=2) 304 | 305 | # breakpoint() 306 | 307 | loss = F.cross_entropy(logits, self.label) 308 | 309 | return loss 310 | 311 | 312 | 313 | 314 | class CrossEntropyLabelSmooth(nn.Module): 315 | """Cross entropy loss with label smoothing regularizer. 316 | 317 | Reference: 318 | Szegedy et al. Rethinking the Inception Architecture for Computer Vision. CVPR 2016. 319 | Equation: y = (1 - epsilon) * y + epsilon / K. 320 | 321 | Args: 322 | num_classes (int): number of classes. 323 | epsilon (float): weight. 324 | """ 325 | def __init__(self, num_classes, epsilon=0.1, use_gpu=True): 326 | super(CrossEntropyLabelSmooth, self).__init__() 327 | self.num_classes = num_classes 328 | self.epsilon = epsilon 329 | # self.use_gpu = use_gpu 330 | self.logsoftmax = nn.LogSoftmax(dim=1) 331 | 332 | def forward(self, inputs, targets): 333 | """ 334 | Args: 335 | inputs: prediction matrix (before softmax) with shape (batch_size, num_classes) 336 | targets: ground truth labels with shape (num_classes) 337 | """ 338 | log_probs = self.logsoftmax(inputs) 339 | targets = torch.zeros(log_probs.size()).scatter_(1, targets.unsqueeze(1).data.cpu(), 1) 340 | # if self.use_gpu: targets = targets.cuda() 341 | targets = targets.cuda() 342 | targets = (1 - self.epsilon) * targets + self.epsilon / self.num_classes 343 | loss = (- targets * log_probs).mean(0).sum() 344 | return loss 345 | 346 | 347 | class CrossEntropyKLD(object): 348 | def __init__(self, num_class=126, mr_weight_kld=0.1): 349 | self.num_class = num_class 350 | self.mr_weight_kld = mr_weight_kld 351 | 352 | def __call__(self, pred, label, mask): 353 | # valid_reg_num = len(label) 354 | logsoftmax = F.log_softmax(pred, dim=1) 355 | 356 | kld = torch.sum(-logsoftmax/self.num_class, dim=1) 357 | ce = (F.cross_entropy(pred, label, reduction='none')*mask).mean() 358 | kld = (self.mr_weight_kld*kld*mask).mean() 359 | 360 | ce_kld = ce + kld 361 | 362 | return ce_kld 363 | 364 | 365 | 366 | 367 | class ProtoLoss(object): 368 | def __init__(self, num_classes, feat_dim): 369 | self.kl_div_loss = nn.KLDivLoss() 370 | self.prototypes = torch.FloatTensor(num_classes, feat_dim).cuda() 371 | self.prototypes.normal_(0, 0.02) 372 | self.num_classes = num_classes 373 | 374 | def __call__(self, feat, cls_logit, target_feat, target_label, normalize_feature=False): 375 | if normalize_feature: 376 | feat = normalize(feat, axis=-1) 377 | target_feat = normalize(target_feat, axis=-1) 378 | 379 | 380 | feat = feat.data 381 | target_feat = target_feat.data 382 | 383 | proto_logit = torch.mm(feat, self.prototypes.transpose(0,1)) 384 | kl_div_loss = nn.functional.kl_div(F.log_softmax(cls_logit, dim=1), F.softmax(proto_logit, dim=1))*feat.size(0) 385 | # kl_div_loss = nn.functional.kl_div(F.log_softmax(cls_logit, dim=1), F.softmax(proto_logit, dim=1)) 386 | 387 | # breakpoint() 388 | 389 | uni_target_label = torch.unique(target_label, sorted=False) 390 | 391 | # one_hot_support_label = torch.zeros(target_label.size(0), self.num_classes).cuda() 392 | # one_hot_support_label.scatter_(1, target_label.unsqueeze(1), 1) 393 | # breakpoint() 394 | # support_feature = self.FeatExemplarAvgBlock(target_feat, one_hot_support_label) 395 | 396 | # breakpoint() 397 | target_feat_list = [target_feat[i*3:i*3+3].mean(dim=0, keepdim=True) for i in range(len(uni_target_label))] 398 | 399 | # breakpoint() 400 | 401 | target_feat = torch.cat(target_feat_list, dim=0) 402 | 403 | # breakpoint() 404 | 405 | # self.prototypes[uni_target_label, :] = 406 | # self.prototypes[uni_target_label, :] = 0.01*self.prototypes[uni_target_label, :].clone() + 0.99*target_feat.data 407 | 408 | self.prototypes[uni_target_label, :] = target_feat 409 | 410 | 411 | return kl_div_loss 412 | 413 | 414 | # def FeatExemplarAvgBlock(self, features_train, labels_train): 415 | # labels_train_transposed = labels_train.transpose(0,1) 416 | 417 | # weight_novel = torch.mm(labels_train_transposed, features_train) 418 | 419 | # breakpoint() 420 | 421 | # weight_novel = weight_novel.div(labels_train_transposed.sum(dim=1, keepdim=True).expand_as(weight_novel)) 422 | # return weight_novel 423 | -------------------------------------------------------------------------------- /data/txt/multi/labeled_target_images_sketch_3.txt: -------------------------------------------------------------------------------- 1 | sketch/aircraft_carrier/sketch_001_000034.jpg 0 2 | sketch/aircraft_carrier/sketch_001_000002.jpg 0 3 | sketch/aircraft_carrier/sketch_001_000048.jpg 0 4 | sketch/alarm_clock/sketch_003_000003.jpg 1 5 | sketch/alarm_clock/sketch_003_000197.jpg 1 6 | sketch/alarm_clock/sketch_003_000058.jpg 1 7 | sketch/ant/sketch_007_000005.jpg 2 8 | sketch/ant/sketch_007_000033.jpg 2 9 | sketch/ant/sketch_007_000091.jpg 2 10 | sketch/anvil/sketch_008_000066.jpg 3 11 | sketch/anvil/sketch_008_000040.jpg 3 12 | sketch/anvil/sketch_008_000030.jpg 3 13 | sketch/asparagus/sketch_011_000033.jpg 4 14 | sketch/asparagus/sketch_011_000197.jpg 4 15 | sketch/asparagus/sketch_011_000016.jpg 4 16 | sketch/axe/sketch_012_000064.jpg 5 17 | sketch/axe/sketch_012_000118.jpg 5 18 | sketch/axe/sketch_012_000125.jpg 5 19 | sketch/banana/sketch_014_000048.jpg 6 20 | sketch/banana/sketch_014_000021.jpg 6 21 | sketch/banana/sketch_014_000085.jpg 6 22 | sketch/basket/sketch_019_000120.jpg 7 23 | sketch/basket/sketch_019_000021.jpg 7 24 | sketch/basket/sketch_019_000038.jpg 7 25 | sketch/bathtub/sketch_022_000142.jpg 8 26 | sketch/bathtub/sketch_022_000005.jpg 8 27 | sketch/bathtub/sketch_022_000202.jpg 8 28 | sketch/bear/sketch_024_000137.jpg 9 29 | sketch/bear/sketch_024_000016.jpg 9 30 | sketch/bear/sketch_024_000091.jpg 9 31 | sketch/bee/sketch_027_000058.jpg 10 32 | sketch/bee/sketch_027_000107.jpg 10 33 | sketch/bee/sketch_027_000059.jpg 10 34 | sketch/bird/sketch_032_000033.jpg 11 35 | sketch/bird/sketch_032_000159.jpg 11 36 | sketch/bird/sketch_032_000148.jpg 11 37 | sketch/blackberry/sketch_034_000016.jpg 12 38 | sketch/blackberry/sketch_034_000033.jpg 12 39 | sketch/blackberry/sketch_034_000006.jpg 12 40 | sketch/blueberry/sketch_035_000016.jpg 13 41 | sketch/blueberry/sketch_035_000038.jpg 13 42 | sketch/blueberry/sketch_035_000118.jpg 13 43 | sketch/bottlecap/sketch_038_000131.jpg 14 44 | sketch/bottlecap/sketch_038_000009.jpg 14 45 | sketch/bottlecap/sketch_038_000058.jpg 14 46 | sketch/broccoli/sketch_044_000104.jpg 15 47 | sketch/broccoli/sketch_044_000121.jpg 15 48 | sketch/broccoli/sketch_044_000118.jpg 15 49 | sketch/bus/sketch_048_000214.jpg 16 50 | sketch/bus/sketch_048_000209.jpg 16 51 | sketch/bus/sketch_048_000228.jpg 16 52 | sketch/butterfly/sketch_050_000241.jpg 17 53 | sketch/butterfly/sketch_050_000186.jpg 17 54 | sketch/butterfly/sketch_050_000235.jpg 17 55 | sketch/cactus/sketch_051_000046.jpg 18 56 | sketch/cactus/sketch_051_000008.jpg 18 57 | sketch/cactus/sketch_051_000019.jpg 18 58 | sketch/cake/sketch_052_000017.jpg 19 59 | sketch/cake/sketch_052_000067.jpg 19 60 | sketch/cake/sketch_052_000034.jpg 19 61 | sketch/calculator/sketch_053_000042.jpg 20 62 | sketch/calculator/sketch_053_000064.jpg 20 63 | sketch/calculator/sketch_053_000049.jpg 20 64 | sketch/camel/sketch_055_000089.jpg 21 65 | sketch/camel/sketch_055_000033.jpg 21 66 | sketch/camel/sketch_055_000069.jpg 21 67 | sketch/camera/sketch_056_000087.jpg 22 68 | sketch/camera/sketch_056_000003.jpg 22 69 | sketch/camera/sketch_056_000068.jpg 22 70 | sketch/candle/sketch_059_000046.jpg 23 71 | sketch/candle/sketch_059_000016.jpg 23 72 | sketch/candle/sketch_059_000032.jpg 23 73 | sketch/cannon/sketch_060_000013.jpg 24 74 | sketch/cannon/sketch_060_000019.jpg 24 75 | sketch/cannon/sketch_060_000017.jpg 24 76 | sketch/canoe/sketch_061_000044.jpg 25 77 | sketch/canoe/sketch_061_000099.jpg 25 78 | sketch/canoe/sketch_061_000085.jpg 25 79 | sketch/carrot/sketch_063_000018.jpg 26 80 | sketch/carrot/sketch_063_000023.jpg 26 81 | sketch/carrot/sketch_063_000032.jpg 26 82 | sketch/castle/sketch_064_000006.jpg 27 83 | sketch/castle/sketch_064_000052.jpg 27 84 | sketch/castle/sketch_064_000039.jpg 27 85 | sketch/cat/sketch_065_000123.jpg 28 86 | sketch/cat/sketch_065_000051.jpg 28 87 | sketch/cat/sketch_065_000017.jpg 28 88 | sketch/ceiling_fan/sketch_066_000019.jpg 29 89 | sketch/ceiling_fan/sketch_066_000024.jpg 29 90 | sketch/ceiling_fan/sketch_066_000002.jpg 29 91 | sketch/cello/sketch_067_000004.jpg 30 92 | sketch/cello/sketch_067_000035.jpg 30 93 | sketch/cello/sketch_067_000048.jpg 30 94 | sketch/cell_phone/sketch_068_000008.jpg 31 95 | sketch/cell_phone/sketch_068_000023.jpg 31 96 | sketch/cell_phone/sketch_068_000011.jpg 31 97 | sketch/chair/sketch_069_000079.jpg 32 98 | sketch/chair/sketch_069_000084.jpg 32 99 | sketch/chair/sketch_069_000090.jpg 32 100 | sketch/chandelier/sketch_070_000002.jpg 33 101 | sketch/chandelier/sketch_070_000022.jpg 33 102 | sketch/chandelier/sketch_070_000007.jpg 33 103 | sketch/coffee_cup/sketch_076_000031.jpg 34 104 | sketch/coffee_cup/sketch_076_000005.jpg 34 105 | sketch/coffee_cup/sketch_076_000019.jpg 34 106 | sketch/compass/sketch_077_000012.jpg 35 107 | sketch/compass/sketch_077_000010.jpg 35 108 | sketch/compass/sketch_077_000013.jpg 35 109 | sketch/computer/sketch_078_000013.jpg 36 110 | sketch/computer/sketch_078_000016.jpg 36 111 | sketch/computer/sketch_078_000004.jpg 36 112 | sketch/cow/sketch_082_000008.jpg 37 113 | sketch/cow/sketch_082_000004.jpg 37 114 | sketch/cow/sketch_082_000005.jpg 37 115 | sketch/crab/sketch_083_000136.jpg 38 116 | sketch/crab/sketch_083_000062.jpg 38 117 | sketch/crab/sketch_083_000108.jpg 38 118 | sketch/crocodile/sketch_085_000100.jpg 39 119 | sketch/crocodile/sketch_085_000093.jpg 39 120 | sketch/crocodile/sketch_085_000059.jpg 39 121 | sketch/cruise_ship/sketch_087_000078.jpg 40 122 | sketch/cruise_ship/sketch_087_000030.jpg 40 123 | sketch/cruise_ship/sketch_087_000091.jpg 40 124 | sketch/dog/sketch_092_000095.jpg 41 125 | sketch/dog/sketch_092_000043.jpg 41 126 | sketch/dog/sketch_092_000164.jpg 41 127 | sketch/dolphin/sketch_093_000008.jpg 42 128 | sketch/dolphin/sketch_093_000064.jpg 42 129 | sketch/dolphin/sketch_093_000044.jpg 42 130 | sketch/dragon/sketch_096_000031.jpg 43 131 | sketch/dragon/sketch_096_000124.jpg 43 132 | sketch/dragon/sketch_096_000177.jpg 43 133 | sketch/drums/sketch_099_000176.jpg 44 134 | sketch/drums/sketch_099_000130.jpg 44 135 | sketch/drums/sketch_099_000188.jpg 44 136 | sketch/duck/sketch_100_000224.jpg 45 137 | sketch/duck/sketch_100_000034.jpg 45 138 | sketch/duck/sketch_100_000177.jpg 45 139 | sketch/dumbbell/sketch_101_000062.jpg 46 140 | sketch/dumbbell/sketch_101_000160.jpg 46 141 | sketch/dumbbell/sketch_101_000060.jpg 46 142 | sketch/elephant/sketch_104_000031.jpg 47 143 | sketch/elephant/sketch_104_000021.jpg 47 144 | sketch/elephant/sketch_104_000175.jpg 47 145 | sketch/eyeglasses/sketch_108_000020.jpg 48 146 | sketch/eyeglasses/sketch_108_000203.jpg 48 147 | sketch/eyeglasses/sketch_108_000089.jpg 48 148 | sketch/feather/sketch_111_000122.jpg 49 149 | sketch/feather/sketch_111_000142.jpg 49 150 | sketch/feather/sketch_111_000220.jpg 49 151 | sketch/fence/sketch_112_000026.jpg 50 152 | sketch/fence/sketch_112_000090.jpg 50 153 | sketch/fence/sketch_112_000020.jpg 50 154 | sketch/fish/sketch_117_000090.jpg 51 155 | sketch/fish/sketch_117_000351.jpg 51 156 | sketch/fish/sketch_117_000103.jpg 51 157 | sketch/flamingo/sketch_118_000095.jpg 52 158 | sketch/flamingo/sketch_118_000007.jpg 52 159 | sketch/flamingo/sketch_118_000091.jpg 52 160 | sketch/flower/sketch_122_000336.jpg 53 161 | sketch/flower/sketch_122_000232.jpg 53 162 | sketch/flower/sketch_122_000250.jpg 53 163 | sketch/foot/sketch_124_000142.jpg 54 164 | sketch/foot/sketch_124_000095.jpg 54 165 | sketch/foot/sketch_124_000156.jpg 54 166 | sketch/fork/sketch_125_000118.jpg 55 167 | sketch/fork/sketch_125_000097.jpg 55 168 | sketch/fork/sketch_125_000007.jpg 55 169 | sketch/frog/sketch_126_000048.jpg 56 170 | sketch/frog/sketch_126_000101.jpg 56 171 | sketch/frog/sketch_126_000100.jpg 56 172 | sketch/giraffe/sketch_130_000109.jpg 57 173 | sketch/giraffe/sketch_130_000174.jpg 57 174 | sketch/giraffe/sketch_130_000149.jpg 57 175 | sketch/goatee/sketch_131_000062.jpg 58 176 | sketch/goatee/sketch_131_000179.jpg 58 177 | sketch/goatee/sketch_131_000109.jpg 58 178 | sketch/grapes/sketch_133_000199.jpg 59 179 | sketch/grapes/sketch_133_000175.jpg 59 180 | sketch/grapes/sketch_133_000286.jpg 59 181 | sketch/guitar/sketch_135_000039.jpg 60 182 | sketch/guitar/sketch_135_000139.jpg 60 183 | sketch/guitar/sketch_135_000166.jpg 60 184 | sketch/hammer/sketch_137_000051.jpg 61 185 | sketch/hammer/sketch_137_000049.jpg 61 186 | sketch/hammer/sketch_137_000034.jpg 61 187 | sketch/helicopter/sketch_143_000191.jpg 62 188 | sketch/helicopter/sketch_143_000038.jpg 62 189 | sketch/helicopter/sketch_143_000013.jpg 62 190 | sketch/helmet/sketch_144_000207.jpg 63 191 | sketch/helmet/sketch_144_000023.jpg 63 192 | sketch/helmet/sketch_144_000021.jpg 63 193 | sketch/horse/sketch_148_000099.jpg 64 194 | sketch/horse/sketch_148_000033.jpg 64 195 | sketch/horse/sketch_148_000011.jpg 64 196 | sketch/kangaroo/sketch_160_000038.jpg 65 197 | sketch/kangaroo/sketch_160_000092.jpg 65 198 | sketch/kangaroo/sketch_160_000039.jpg 65 199 | sketch/lantern/sketch_166_000005.jpg 66 200 | sketch/lantern/sketch_166_000031.jpg 66 201 | sketch/lantern/sketch_166_000027.jpg 66 202 | sketch/laptop/sketch_167_000038.jpg 67 203 | sketch/laptop/sketch_167_000181.jpg 67 204 | sketch/laptop/sketch_167_000264.jpg 67 205 | sketch/leaf/sketch_168_000323.jpg 68 206 | sketch/leaf/sketch_168_000037.jpg 68 207 | sketch/leaf/sketch_168_000180.jpg 68 208 | sketch/lion/sketch_175_000179.jpg 69 209 | sketch/lion/sketch_175_000077.jpg 69 210 | sketch/lion/sketch_175_000075.jpg 69 211 | sketch/lipstick/sketch_176_000058.jpg 70 212 | sketch/lipstick/sketch_176_000004.jpg 70 213 | sketch/lipstick/sketch_176_000011.jpg 70 214 | sketch/lobster/sketch_177_000082.jpg 71 215 | sketch/lobster/sketch_177_000079.jpg 71 216 | sketch/lobster/sketch_177_000072.jpg 71 217 | sketch/microphone/sketch_185_000046.jpg 72 218 | sketch/microphone/sketch_185_000038.jpg 72 219 | sketch/microphone/sketch_185_000049.jpg 72 220 | sketch/monkey/sketch_187_000116.jpg 73 221 | sketch/monkey/sketch_187_000025.jpg 73 222 | sketch/monkey/sketch_187_000042.jpg 73 223 | sketch/mosquito/sketch_189_000009.jpg 74 224 | sketch/mosquito/sketch_189_000035.jpg 74 225 | sketch/mosquito/sketch_189_000103.jpg 74 226 | sketch/mouse/sketch_192_000026.jpg 75 227 | sketch/mouse/sketch_192_000044.jpg 75 228 | sketch/mouse/sketch_192_000010.jpg 75 229 | sketch/mug/sketch_195_000054.jpg 76 230 | sketch/mug/sketch_195_000184.jpg 76 231 | sketch/mug/sketch_195_000012.jpg 76 232 | sketch/mushroom/sketch_196_000019.jpg 77 233 | sketch/mushroom/sketch_196_000004.jpg 77 234 | sketch/mushroom/sketch_196_000212.jpg 77 235 | sketch/onion/sketch_203_000133.jpg 78 236 | sketch/onion/sketch_203_000062.jpg 78 237 | sketch/onion/sketch_203_000067.jpg 78 238 | sketch/panda/sketch_209_000067.jpg 79 239 | sketch/panda/sketch_209_000037.jpg 79 240 | sketch/panda/sketch_209_000028.jpg 79 241 | sketch/peanut/sketch_215_000112.jpg 80 242 | sketch/peanut/sketch_215_000055.jpg 80 243 | sketch/peanut/sketch_215_000061.jpg 80 244 | sketch/pear/sketch_216_000151.jpg 81 245 | sketch/pear/sketch_216_000054.jpg 81 246 | sketch/pear/sketch_216_000168.jpg 81 247 | sketch/peas/sketch_217_000032.jpg 82 248 | sketch/peas/sketch_217_000061.jpg 82 249 | sketch/peas/sketch_217_000045.jpg 82 250 | sketch/pencil/sketch_218_000008.jpg 83 251 | sketch/pencil/sketch_218_000001.jpg 83 252 | sketch/pencil/sketch_218_000016.jpg 83 253 | sketch/penguin/sketch_219_000189.jpg 84 254 | sketch/penguin/sketch_219_000017.jpg 84 255 | sketch/penguin/sketch_219_000147.jpg 84 256 | sketch/pig/sketch_223_000199.jpg 85 257 | sketch/pig/sketch_223_000117.jpg 85 258 | sketch/pig/sketch_223_000192.jpg 85 259 | sketch/pillow/sketch_224_000029.jpg 86 260 | sketch/pillow/sketch_224_000069.jpg 86 261 | sketch/pillow/sketch_224_000032.jpg 86 262 | sketch/pineapple/sketch_225_000090.jpg 87 263 | sketch/pineapple/sketch_225_000009.jpg 87 264 | sketch/pineapple/sketch_225_000052.jpg 87 265 | sketch/potato/sketch_233_000055.jpg 88 266 | sketch/potato/sketch_233_000009.jpg 88 267 | sketch/potato/sketch_233_000027.jpg 88 268 | sketch/power_outlet/sketch_234_000022.jpg 89 269 | sketch/power_outlet/sketch_234_000078.jpg 89 270 | sketch/power_outlet/sketch_234_000001.jpg 89 271 | sketch/purse/sketch_235_000093.jpg 90 272 | sketch/purse/sketch_235_000063.jpg 90 273 | sketch/purse/sketch_235_000097.jpg 90 274 | sketch/rabbit/sketch_236_000065.jpg 91 275 | sketch/rabbit/sketch_236_000061.jpg 91 276 | sketch/rabbit/sketch_236_000029.jpg 91 277 | sketch/raccoon/sketch_237_000039.jpg 92 278 | sketch/raccoon/sketch_237_000307.jpg 92 279 | sketch/raccoon/sketch_237_000191.jpg 92 280 | sketch/rhinoceros/sketch_243_000166.jpg 93 281 | sketch/rhinoceros/sketch_243_000145.jpg 93 282 | sketch/rhinoceros/sketch_243_000069.jpg 93 283 | sketch/rifle/sketch_244_000103.jpg 94 284 | sketch/rifle/sketch_244_000050.jpg 94 285 | sketch/rifle/sketch_244_000090.jpg 94 286 | sketch/saxophone/sketch_251_000145.jpg 95 287 | sketch/saxophone/sketch_251_000287.jpg 95 288 | sketch/saxophone/sketch_251_000059.jpg 95 289 | sketch/screwdriver/sketch_255_000148.jpg 96 290 | sketch/screwdriver/sketch_255_000109.jpg 96 291 | sketch/screwdriver/sketch_255_000008.jpg 96 292 | sketch/sea_turtle/sketch_256_000214.jpg 97 293 | sketch/sea_turtle/sketch_256_000164.jpg 97 294 | sketch/sea_turtle/sketch_256_000014.jpg 97 295 | sketch/see_saw/sketch_257_000391.jpg 98 296 | sketch/see_saw/sketch_257_000302.jpg 98 297 | sketch/see_saw/sketch_257_000053.jpg 98 298 | sketch/sheep/sketch_259_000239.jpg 99 299 | sketch/sheep/sketch_259_000317.jpg 99 300 | sketch/sheep/sketch_259_000396.jpg 99 301 | sketch/shoe/sketch_260_000007.jpg 100 302 | sketch/shoe/sketch_260_000114.jpg 100 303 | sketch/shoe/sketch_260_000134.jpg 100 304 | sketch/skateboard/sketch_264_000336.jpg 101 305 | sketch/skateboard/sketch_264_000046.jpg 101 306 | sketch/skateboard/sketch_264_000381.jpg 101 307 | sketch/snake/sketch_270_000347.jpg 102 308 | sketch/snake/sketch_270_000437.jpg 102 309 | sketch/snake/sketch_270_000267.jpg 102 310 | sketch/speedboat/sketch_276_000245.jpg 103 311 | sketch/speedboat/sketch_276_000042.jpg 103 312 | sketch/speedboat/sketch_276_000256.jpg 103 313 | sketch/spider/sketch_277_000235.jpg 104 314 | sketch/spider/sketch_277_000178.jpg 104 315 | sketch/spider/sketch_277_000372.jpg 104 316 | sketch/squirrel/sketch_282_000203.jpg 105 317 | sketch/squirrel/sketch_282_000119.jpg 105 318 | sketch/squirrel/sketch_282_000195.jpg 105 319 | sketch/strawberry/sketch_291_000021.jpg 106 320 | sketch/strawberry/sketch_291_000179.jpg 106 321 | sketch/strawberry/sketch_291_000043.jpg 106 322 | sketch/streetlight/sketch_292_000218.jpg 107 323 | sketch/streetlight/sketch_292_000207.jpg 107 324 | sketch/streetlight/sketch_292_000153.jpg 107 325 | sketch/string_bean/sketch_293_000010.jpg 108 326 | sketch/string_bean/sketch_293_000056.jpg 108 327 | sketch/string_bean/sketch_293_000049.jpg 108 328 | sketch/submarine/sketch_294_000091.jpg 109 329 | sketch/submarine/sketch_294_000096.jpg 109 330 | sketch/submarine/sketch_294_000023.jpg 109 331 | sketch/swan/sketch_297_000151.jpg 110 332 | sketch/swan/sketch_297_000110.jpg 110 333 | sketch/swan/sketch_297_000008.jpg 110 334 | sketch/table/sketch_302_000154.jpg 111 335 | sketch/table/sketch_302_000016.jpg 111 336 | sketch/table/sketch_302_000076.jpg 111 337 | sketch/teapot/sketch_303_000283.jpg 112 338 | sketch/teapot/sketch_303_000186.jpg 112 339 | sketch/teapot/sketch_303_000067.jpg 112 340 | sketch/teddy-bear/sketch_304_000204.jpg 113 341 | sketch/teddy-bear/sketch_304_000171.jpg 113 342 | sketch/teddy-bear/sketch_304_000026.jpg 113 343 | sketch/television/sketch_306_000082.jpg 114 344 | sketch/television/sketch_306_000079.jpg 114 345 | sketch/television/sketch_306_000021.jpg 114 346 | sketch/The_Eiffel_Tower/sketch_309_000090.jpg 115 347 | sketch/The_Eiffel_Tower/sketch_309_000074.jpg 115 348 | sketch/The_Eiffel_Tower/sketch_309_000265.jpg 115 349 | sketch/The_Great_Wall_of_China/sketch_310_000069.jpg 116 350 | sketch/The_Great_Wall_of_China/sketch_310_000090.jpg 116 351 | sketch/The_Great_Wall_of_China/sketch_310_000092.jpg 116 352 | sketch/tiger/sketch_312_000299.jpg 117 353 | sketch/tiger/sketch_312_000005.jpg 117 354 | sketch/tiger/sketch_312_000277.jpg 117 355 | sketch/toe/sketch_314_000047.jpg 118 356 | sketch/toe/sketch_314_000041.jpg 118 357 | sketch/toe/sketch_314_000018.jpg 118 358 | sketch/train/sketch_322_000062.jpg 119 359 | sketch/train/sketch_322_000060.jpg 119 360 | sketch/train/sketch_322_000231.jpg 119 361 | sketch/truck/sketch_326_000259.jpg 120 362 | sketch/truck/sketch_326_000246.jpg 120 363 | sketch/truck/sketch_326_000102.jpg 120 364 | sketch/umbrella/sketch_329_000117.jpg 121 365 | sketch/umbrella/sketch_329_000202.jpg 121 366 | sketch/umbrella/sketch_329_000054.jpg 121 367 | sketch/vase/sketch_332_000044.jpg 122 368 | sketch/vase/sketch_332_000005.jpg 122 369 | sketch/vase/sketch_332_000017.jpg 122 370 | sketch/watermelon/sketch_335_000075.jpg 123 371 | sketch/watermelon/sketch_335_000095.jpg 123 372 | sketch/watermelon/sketch_335_000110.jpg 123 373 | sketch/whale/sketch_337_000120.jpg 124 374 | sketch/whale/sketch_337_000113.jpg 124 375 | sketch/whale/sketch_337_000133.jpg 124 376 | sketch/zebra/sketch_344_000036.jpg 125 377 | sketch/zebra/sketch_344_000096.jpg 125 378 | sketch/zebra/sketch_344_000229.jpg 125 379 | --------------------------------------------------------------------------------