INNER CODE UNIT · Python
threaded_process_submap
MIT-SPARK/VGGT-SLAM · main_realtime.py:78
def threaded_process_submap(image_names_subset, solver, model, args, clip_model, clip_preprocess):
"""Background thread: run VGGT inference + graph optimisation for one submap."""
try:
print(f"[SLAM] Processing submap ({len(image_names_subset)} frames)...")
predictions = solver.run_predictions(
image_names_subset, model, args.max_loops, clip_model, clip_preprocess
)
with data_lock:
solver.add_points(predictions)
solver.graph.optimize()
if args.vis_map:
if len(predictions.get("detected_loops", [])) > 0:
solver.update_all_submap_vis()
else:
solver.update_latest_submap_vis()
print("[SLAM] Submap done.")
except Exception as e:
import traceback