Skip to content

Commit

Permalink
yeye tolto commenti cancellato evalueate
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel committed Jan 23, 2021
1 parent 325aab7 commit 2b71941
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 213 deletions.
32 changes: 16 additions & 16 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,43 +69,43 @@ def run(args):

# NOTE: we buid a default invalid depth, in the case of system failure
if state == slampy.State.OK:
depth = app.get_depth() #calcola la depth del frame corrente
depth = app.get_depth()
pose_past_frame_to_current = app.get_pose_to_target(
precedent_frame=args.pose_id
)#calcola la pose del frame corrente rispetto all'imput dell'utente
name = os.path.splitext(os.path.basename(image_name))[0] #prepara il nome del frame
)
name = os.path.splitext(os.path.basename(image_name))[0]

depth_path = os.path.join(dest_depth, name) #prepara il file diciamo, deppth_dest from line 33
save_depth(depth_path, depth) #da arrray salva in formato .png
depth_path = os.path.join(dest_depth, name)
save_depth(depth_path, depth)

pose_path = os.path.join(dest_pose, name)
save_pose(pose_path, pose_past_frame_to_current)#salva in formato numpy
save_pose(pose_path, pose_past_frame_to_current)

curr_pose = app.get_pose_to_target(-1) #pose rispetto all'inizio
curr_pose = app.get_pose_to_target(-1)
if curr_pose is not None:
save_pose_txt(args, name, curr_pose)#salva courrent pose in file txt
save_pose_txt(args, name, curr_pose)

if args.is_evalute_depth: #depth rispetto al gt
if args.is_evaluate_depth:
gt_file_path = os.path.join(args.gt_depth, "{}.png".format(name))
err = get_error(args, name, depth, gt_file_path)
errors.append(err)

states.append(state)
pbar.update(1)

if args.is_evalute_depth:
mean_errors = np.array(errors).mean(0) #calcola la media di una matrice per colonna, risulta un erray con lo stesso numero di colonne i cui elementi sono la media di ogni clonna
if args.is_evaluate_depth:
mean_errors = np.array(errors).mean(0)
save_results = os.path.join(args.dest, "results.txt")
save_depth_err_results(save_results, "mean values", mean_errors)#la stampa di un erray vuoto in quanto mean(0) di un array vuoto da 0 credo da un errore: format() argument after * must be an iterable, not numpy.float64
save_depth_err_results(save_results, "mean values", mean_errors)


# NOTE: final dump of log.txt file
with open(os.path.join(args.dest, "log.txt"), "w") as f:
for i, state in enumerate(states):
f.write(f"{i}: {state}\n")

if args.is_evalute_pose:
print("Begin to evaluate predicted pose")#si prende il file pose di numpy array salvato prima in pose e lo confronta col gt
if args.is_evaluate_pose:
print("Begin to evaluate predicted pose")
evaluate_pose(args)
eval_tool = KittiEvalOdom()
eval_tool.eval(args)
Expand Down Expand Up @@ -142,14 +142,14 @@ def run(args):
For instance, if pose_id=2 then compute the pose between T-2->T",
)
parser.add_argument(
"--is_evalute_depth",
"--is_evaluate_depth",
default=False,
action="store_true",
help="If set, will evalute the orb depth with the gt files ",
)

parser.add_argument(
"--is_evalute_pose",
"--is_evaluate_pose",
default=False,
action="store_true",
help="If set, will evalute the orb pose with the gt files",
Expand Down
197 changes: 0 additions & 197 deletions run2.py

This file was deleted.

0 comments on commit 2b71941

Please sign in to comment.