MCPcopy Create free account
hub / github.com/SAMMiCA/ChangeSim / __init__

Method __init__

script/visualization.py:20–45  ·  view source on GitHub ↗

ChangeSim Dataloader for Visualization Please download ChangeSim Dataset in https://github.com/SAMMiCA/ChangeSim Args: crop_size (tuple): Image resize shape (H,W) (default: (320, 240)) num_classes (int): Number of target change detection class

(self, crop_size=(320, 240), num_classes=5, set='train')

Source from the content-addressed store, hash-verified

18
19class ChangeSim(data.Dataset):
20 def __init__(self, crop_size=(320, 240), num_classes=5, set='train'):
21 """
22 ChangeSim Dataloader for Visualization
23 Please download ChangeSim Dataset in https://github.com/SAMMiCA/ChangeSim
24
25 Args:
26 crop_size (tuple): Image resize shape (H,W) (default: (320, 240))
27 num_classes (int): Number of target change detection class
28 5 for multi-class change detection
29 2 for binary change detection (default: 5)
30 set (str): 'train' or 'test' (defalut: 'train')
31 """
32 self.crop_size = crop_size
33 self.num_classes = num_classes
34 self.set = set
35 train_list = ['Warehouse_0', 'Warehouse_1', 'Warehouse_2', 'Warehouse_3', 'Warehouse_4', 'Warehouse_5']
36 test_list = ['Warehouse_6', 'Warehouse_7', 'Warehouse_8', 'Warehouse_9']
37 self.image_total_files = []
38 if set == 'train':
39 for map in train_list:
40 self.image_total_files += glob.glob('../Query/Query_Seq_Train/' + map + '/Seq_0/rgb/*.png')
41 self.image_total_files += glob.glob('../Query/Query_Seq_Train/' + map + '/Seq_1/rgb/*.png')
42 elif set == 'test':
43 for map in test_list:
44 self.image_total_files += glob.glob('../Query/Query_Seq_Test/' + map + '/Seq_0/rgb/*.png')
45 self.image_total_files += glob.glob('../Query/Query_Seq_Test/' + map + '/Seq_1/rgb/*.png')
46
47 def __len__(self):
48 return len(self.image_total_files)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected