-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when run TUM dataset #10
Comments
it's probably the make sure the
|
Thank you for your reply. By the way, TUM dataset didn't provide this format's groundtruth file. The |
I use the code below along with import argparse
import os
import sys
LOCAL_PATH = './'
if LOCAL_PATH not in sys.path:
sys.path.append(LOCAL_PATH)
from associate import associate, read_file_list
from tqdm import tqdm
def associate_two_files(fname1, fname2, outname, filehead):
fname1_list = read_file_list(fname1)
fname2_list = read_file_list(fname2)
fname1_fname2_matches = associate(fname1_list, fname2_list, float(args.offset), float(args.max_difference))
with open(outname, 'w') as f:
f.write(filehead)
for a, b in fname1_fname2_matches:
f.write("%f %s %s\n" % (a, " ".join(fname1_list[a]), " ".join(fname2_list[b])))
if __name__ == '__main__':
# parse command line
parser = argparse.ArgumentParser(
description='''This script associate the rgb.txt, depth.txt, groundtruth.txt for all tumrgbd data sequences''')
parser.add_argument('root_path', help='first text file (format: timestamp data)')
parser.add_argument('--offset', help='time offset added to the timestamps of the second file (default: 0.0)',
default=0.0)
parser.add_argument('--max_difference',
help='maximally allowed time difference for matching entries (default: 0.02)', default=0.02)
args = parser.parse_args()
for sequence_name in tqdm(os.listdir(args.root_path)):
rgbd = os.path.join(args.root_path, sequence_name, 'rgbd.txt')
if not os.path.exists(rgbd):
rgb = os.path.join(args.root_path, sequence_name, 'rgb.txt')
depth = os.path.join(args.root_path, sequence_name, 'depth.txt')
associate_two_files(rgb, depth, rgbd, '# rgbd\n'
'# timestamp rgb_filename depth_filename\n')
rgbd_gt = os.path.join(args.root_path, sequence_name, 'rgbd_gt.txt')
if not os.path.exists(rgbd_gt):
gt = os.path.join(args.root_path, sequence_name, 'groundtruth.txt')
associate_two_files(rgbd, gt, rgbd_gt, '# rgbd with groundtruth\n'
'# timestamp rgb_filename depth_filename tx ty tz qx qy qz qw\n') |
你们好,我想请教下问题,为什么我按照这个格式跑TUM数据集: |
I try to run code in TUM datasets but get the error message.
Traceback (most recent call last):
File "main.py", line 109, in
run(args)
File "main.py", line 65, in run
loader = create_dataloader(config["dataset"])
File "/home/zhy/PyProject/Python-VO/DataLoader/init.py", line 9, in create_dataloader
loader = eval(code_line)
File "", line 1, in
File "/home/zhy/PyProject/Python-VO/DataLoader/TUMRGBLoader.py", line 32, in init
self.read_imgs()
File "/home/zhy/PyProject/Python-VO/DataLoader/TUMRGBLoader.py", line 76, in read_imgs
rgb_list = lines[:, 1]
IndexError: too many indices for array
I use this code for running:
python main.py --config params/tumrgb_superpoint_supergluematch.yaml
The TUM dataset is organized as follows:
├ TUM
└rgbd_dataset_freiburg1_360
└── depth
└ ...
└── rgb
└ ...
└── depth.txt
└── rgb.txt
└── rgbd_gt.txt
How to fix this error?
The text was updated successfully, but these errors were encountered: