Skip to content

Commit

Permalink
Update twelve_scenes.py
Browse files Browse the repository at this point in the history
  • Loading branch information
DK-HU authored Jan 23, 2023
1 parent a5f232c commit f0b3cc0
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions datasets/twelve_scenes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,9 @@ def __init__(self, root, dataset='12S', scene='apt2/bed', split='train', model='
'.label.png']
self.obj_keys = ['color', 'pose', 'depth', 'label']

if self.dataset == '12S' or self.split == 'test':
with open(os.path.join(self.root, self.scene,
'{}{}'.format(self.split, '.txt')), 'r') as f:
self.frames = f.readlines()
else:
self.frames = []
for scene in self.scenes:
with open(os.path.join(self.root, scene,
'{}{}'.format(self.split, '.txt')), 'r') as f:
frames = f.readlines()
frames = [scene + ' ' + frame for frame in frames]
self.frames.extend(frames)
with open(os.path.join(self.root, self.scene,
'{}{}'.format(self.split, '.txt')), 'r') as f:
self.frames = f.readlines()

def __len__(self):
return len(self.frames)
Expand All @@ -51,7 +42,6 @@ def __getitem__(self, index):
seq_id, frame_id = frame.split('-')
objs = {}

# 加载数据集中的文件
objs['color'] = '/mnt/share/sda-2T/xietao/12Scenes/' + self.scene + '/data/' + seq_id + '-' + frame_id + '.color.jpg'
objs['depth'] = '/mnt/share/sda-2T/xietao/12Scenes/' + self.scene + '/data/' + seq_id + '-' + frame_id + '.depth.png' # Twc
objs['pose'] = '/mnt/share/sda-2T/xietao/12Scenes/' + self.scene + '/data/' + seq_id + '-' + frame_id + '.pose.txt'
Expand Down

0 comments on commit f0b3cc0

Please sign in to comment.