MCPcopy Create free account
hub / github.com/drinkingcoder/FlowFormer-Official / MpiSintel

Class MpiSintel

core/utils/datasets.py:122–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 self.flow_list += sorted(glob(osp.join(flow_root, scene, '*.flo')))
121
122class MpiSintel(FlowDataset):
123 def __init__(self, aug_params=None, split='training', root='datasets/Sintel', dstype='clean'):
124 super(MpiSintel, self).__init__(aug_params)
125
126 root = 's3://'
127
128 self.image_list = []
129 with open("./flow_dataset/Sintel/Sintel_"+dstype+"_png.txt") as f:
130 images = f.readlines()
131 for img1, img2 in zip(images[0::2], images[1::2]):
132 self.image_list.append([root+img1.strip(), root+img2.strip()])
133
134 self.flow_list = []
135 with open("./flow_dataset/Sintel/Sintel_"+dstype+"_flo.txt") as f:
136 flows = f.readlines()
137 for flow in flows:
138 self.flow_list.append(root+flow.strip())
139
140 assert (len(self.image_list) == len(self.flow_list))
141
142 self.extra_info = []
143 with open("./flow_dataset/Sintel/Sintel_"+dstype+"_extra_info.txt") as f:
144 info = f.readlines()
145 for scene, id in zip(info[0::2], info[1::2]):
146 self.extra_info.append((scene.strip(), int(id.strip())))
147 # flow_root = osp.join(root, split, 'flow')
148 # image_root = osp.join(root, split, dstype)
149
150 # if split == 'test':
151 # self.is_test = True
152
153 # for scene in os.listdir(image_root):
154 # image_list = sorted(glob(osp.join(image_root, scene, '*.png')))
155 # for i in range(len(image_list)-1):
156 # self.image_list += [ [image_list[i], image_list[i+1]] ]
157 # self.extra_info += [ (scene, i) ] # scene and frame_id
158
159 # if split != 'test':
160 # self.flow_list += sorted(glob(osp.join(flow_root, scene, '*.flo')))
161
162
163class FlyingChairs(FlowDataset):

Callers 2

fetch_dataloaderFunction · 0.70
datasets.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected