Skip to content

Commit

Permalink
fix: config error in grip_downsample
Browse files Browse the repository at this point in the history
  • Loading branch information
AtticusZeller committed May 29, 2024
1 parent 1a092b9 commit 160830c
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tqdm = "^4.66.4"
scipy = "^1.13.0"
wandb = "^0.17.0"
# torchimize = "^0.0.16"
small-gicp = "^0.0.6"
#small-gicp = "^0.0.6"



Expand Down
4 changes: 3 additions & 1 deletion src/component/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class WandbLogger:
def __init__(self, run_name: str | None = None, config: dict = None):
"""
Initialize the Weights & Biases logging.
use wandb login with api key https://wandb.ai/authorize
"""
if run_name is None:
run_name = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
Expand Down Expand Up @@ -198,6 +199,7 @@ def __init__(
extra_config = {}
wandb_config = registration_config._asdict()
wandb_config.update({"name": name, **extra_config})
self.grid_downsample = registration_config.grid_downsample_resolution
self.logger = WandbLogger(run_name=name, config=wandb_config)

def run(self, max_images: int = 2000):
Expand All @@ -215,7 +217,7 @@ def run(self, max_images: int = 2000):
pre_pose = rgbd_image.pose

# NOTE: down sample
new_pcd = rgbd_image.pointclouds(1)
new_pcd = rgbd_image.pointclouds(self.grid_downsample)

# NOTE: align interface
if i == 0:
Expand Down
11 changes: 8 additions & 3 deletions src/grip_downsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@
grid_downsample_resolutions = [1, 2, 4, 8, 10, 12, 16, 20]
grid_downsample_resolutions.reverse()

rooms = ["room" + str(i) for i in range(3)] + ["office" + str(i) for i in range(5)][
:1
]
rooms = ["room" + str(i) for i in range(3)] + ["office" + str(i) for i in range(5)]
finished = []
for room in rooms:
for method in methods:
for voxel_downsampling_resolution in voxel_downsampling_resolutions:
for grid_downsample_resolution in grid_downsample_resolutions:
if (
room,
grid_downsample_resolution,
voxel_downsampling_resolution,
) in finished:
continue
registration_config = RegistrationConfig(
registration_type=method,
voxel_downsampling_resolutions=voxel_downsampling_resolution,
Expand Down
17 changes: 7 additions & 10 deletions src/pcd_vis.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from collections import deque

import cv2
import numba
import numpy as np
from matplotlib import pyplot as plt

Expand All @@ -10,8 +9,6 @@
from src.slam_data.dataset import Replica
from src.slam_data.Image import RGBDImage

numba.config.THREADING_LAYER_PRIORITY = ["omp", "tbb", "workqueue"]


class PointCloudProcessor(Scan2ScanICP):
"""
Expand Down Expand Up @@ -70,13 +67,13 @@ def process_pcd(self):

if i % 30 == 0:
self.vis.update_render(new_pcd, estimate_pose)
fps = 1 / np.mean(self.stamps)
self.vis.vis_trajectory(
gt_poses=self.gt_poses,
estimated_poses=self.estimated_poses,
downsampling_resolution=self.downsampling_resolution,
fps=fps,
)
# fps = 1 / np.mean(self.stamps)
# self.vis.vis_trajectory(
# gt_poses=self.gt_poses,
# estimated_poses=self.estimated_poses,
# downsampling_resolution=self.voxel_downsampling_resolutions,
# fps=fps,
# )
self.vis.close()

# if save:
Expand Down

0 comments on commit 160830c

Please sign in to comment.