Update localization_log_gamma_model.py

This commit is contained in:
HappyZ 2019-06-07 10:29:28 -05:00
parent a7a0a9d604
commit 921da8c8b1
1 changed files with 10 additions and 6 deletions

View File

@ -32,11 +32,15 @@ def fittingSingle(filepath, args):
print("err: failed to load file {}".format(filepath))
return
location_gt_tmp = None
location_gt = [float('nan'), float('nan')]
if len(data) is 2:
data, location_gt_tmp = data
if location_gt_tmp is not None:
location_gt = [location_gt_tmp[0] * 0.1, location_gt_tmp[1] * 0.1]
if 'img_' in os.path.basename(filepath):
location_gt_tmp = os.path.basename(filepath).split('_')
location_gt = [float(location_gt_tmp[1]) + 3.2, float(location_gt_tmp[2]) + 3.2]
else:
location_gt = [float('nan'), float('nan')]
if len(data) is 2:
data, location_gt_tmp = data
if location_gt_tmp is not None:
location_gt = [location_gt_tmp[0] * 0.1, location_gt_tmp[1] * 0.1]
if args.only_true_loc and location_gt_tmp is None:
print("skipped as no groundtruth")
return
@ -116,7 +120,7 @@ def main(args):
filepaths.append(args.filepath)
if args.folderpath:
files = os.listdir(args.folderpath)
filepaths.extend(["{}/{}".format(args.folderpath, file) for file in files if '.pickle' in file])
filepaths.extend(["{}/{}".format(args.folderpath, file) for file in files if '.pickle' in file and '_floormap.pickle' not in file])
# prepare
if args.outputfile: