| 162 | |
| 163 | class FlyingChairs(FlowDataset): |
| 164 | def __init__(self, aug_params=None, split='train', root='datasets/FlyingChairs_release/data'): |
| 165 | super(FlyingChairs, self).__init__(aug_params) |
| 166 | |
| 167 | root = 's3://' |
| 168 | |
| 169 | with open("./flow_dataset/flying_chairs/flyingchairs_ppm.txt") as f: |
| 170 | images = f.readlines() |
| 171 | images = [root+img.strip() for img in images] |
| 172 | with open("./flow_dataset/flying_chairs/flyingchairs_flo.txt") as f: |
| 173 | flows = f.readlines() |
| 174 | flows = [root+flo.strip() for flo in flows] |
| 175 | |
| 176 | # images = sorted(glob(osp.join(root, '*.ppm'))) |
| 177 | # flows = sorted(glob(osp.join(root, '*.flo'))) |
| 178 | assert (len(images)//2 == len(flows)) |
| 179 | |
| 180 | split_list = np.loadtxt('chairs_split.txt', dtype=np.int32) |
| 181 | for i in range(len(flows)): |
| 182 | xid = split_list[i] |
| 183 | if (split=='training' and xid==1) or (split=='validation' and xid==2): |
| 184 | self.flow_list += [ flows[i] ] |
| 185 | self.image_list += [ [images[2*i], images[2*i+1]] ] |
| 186 | |
| 187 | |
| 188 | class FlyingThings3D(FlowDataset): |