diff --git a/colmap_reader.py b/colmap_reader.py deleted file mode 100644 index ea00146..0000000 --- a/colmap_reader.py +++ /dev/null @@ -1,277 +0,0 @@ -import numpy as np -import os -import torch -from scipy.spatial.transform import Rotation as R -import glob -import argparse -from PIL import Image - -def rotation_matrix_to_quaternion(rot_matrix): - """Convert rotation matrix to quaternion (w, x, y, z)""" - rotation = R.from_matrix(rot_matrix) - return rotation.as_quat()[[3, 0, 1, 2]] # Reorder from (x, y, z, w) to (w, x, y, z) - -def write_cameras_txt(intrinsics, image_shapes, output_dir): - """Write cameras.txt file""" - os.makedirs(output_dir, exist_ok=True) - - with open(os.path.join(output_dir, "cameras.txt"), "w") as f: - f.write("# Camera list with one line of data per camera:\n") - f.write("# CAMERA_ID, MODEL, WIDTH, HEIGHT, PARAMS[]\n") - f.write(f"# Number of cameras: {len(intrinsics)}\n") - - for i, (intrin, shape) in enumerate(zip(intrinsics, image_shapes)): - # Extract image dimensions - height, width = shape - - # Extract focal length and principal point - fx, fy = intrin[0, 0], intrin[1, 1] - cx, cy = intrin[0, 2], intrin[1, 2] - - # Using PINHOLE model (fx, fy, cx, cy) - camera_id = i + 1 - f.write(f"{camera_id} PINHOLE {width} {height} {fx} {fy} {cx} {cy}\n") - -def extract_sparse_point_cloud(point_maps, images, sample_step=20): - """Extract a sparse point cloud from point maps with colors from images""" - points = [] - point_colors = [] # Will store actual colors from images - point_origins = [] # Track which image/pixel each point came from - - for img_idx, (point_map, img) in enumerate(zip(point_maps, images)): - h, w, _ = point_map.shape - for y in range(0, h, sample_step): - for x in range(0, w, sample_step): - # Get 3D point coordinates - point3d = point_map[y, x] - - # Skip invalid points - if np.linalg.norm(point3d) < 0.001 or np.linalg.norm(point3d) > 1000: - continue - - # Extract the color from the image - color = img[y, x] - - # Add point, color, and origin info - points.append(point3d) - point_colors.append(color) - point_origins.append((img_idx, y, x)) - - return np.array(points), np.array(point_colors), point_origins - -def filter_points_by_distance(points, colors, origins, min_distance=0.05): - """Filter points that are too close to each other""" - # if len(points) == 0: - return points, colors, origins - -def compute_point_visibility(points3d, extrinsics, intrinsics, image_shapes): - """Compute which images can see each 3D point""" - num_points = len(points3d) - num_images = len(extrinsics) - - # For each image, store visible 2D projections - image_points = [[] for _ in range(num_images)] - - # For each 3D point, store which images see it - point_tracks = [[] for _ in range(num_points)] - - for point_idx, point3d in enumerate(points3d): - for img_idx, (extrinsic, intrinsic, shape) in enumerate(zip(extrinsics, intrinsics, image_shapes)): - # Get image dimensions - height, width = shape - - # Transform point to camera coordinates - point_cam = np.dot(extrinsic[:3, :3], point3d) + extrinsic[:3, 3] - - # Check if point is in front of camera - if point_cam[2] <= 0: - continue - - # Project to image plane - point_homo = np.dot(intrinsic, point_cam / point_cam[2]) - x, y = point_homo[0], point_homo[1] - - # Check if within image boundaries - if 0 <= x < width and 0 <= y < height: - image_points[img_idx].append((x, y, point_idx)) - point_tracks[point_idx].append((img_idx + 1, len(image_points[img_idx]) - 1)) - - return image_points, point_tracks - -def write_images_txt(extrinsics, image_points, image_names, output_dir): - """Write images.txt file""" - with open(os.path.join(output_dir, "images.txt"), "w") as f: - f.write("# Image list with two lines of data per image:\n") - f.write("# IMAGE_ID, QW, QX, QY, QZ, TX, TY, TZ, CAMERA_ID, NAME\n") - f.write("# POINTS2D[] as (X, Y, POINT3D_ID)\n") - f.write(f"# Number of images: {len(extrinsics)}\n") - - for img_idx, (extrinsic, points) in enumerate(zip(extrinsics, image_points)): - # Extract rotation matrix and translation vector - rot_matrix = extrinsic[:3, :3] - trans_vector = extrinsic[:3, 3] - - # Convert to camera-to-world transformation - rot_c2w = rot_matrix.T # Transpose for inverse rotation - trans_c2w = -np.dot(rot_c2w, trans_vector) # -R^T * t - - quat_c2w = rotation_matrix_to_quaternion(rot_c2w) - - image_id = img_idx + 1 - camera_id = img_idx + 1 # Assuming one camera per image - image_name = os.path.basename(image_names[img_idx]) - - # Write image pose - f.write(f"{image_id} {quat_c2w[0]:.9f} {quat_c2w[1]:.9f} {quat_c2w[2]:.9f} {quat_c2w[3]:.9f} {trans_c2w[0]:.9f} {trans_c2w[1]:.9f} {trans_c2w[2]:.9f} {camera_id} {image_name}\n") - - # Write 2D point observations - points2d_line = " ".join([f"{x:.6f} {y:.6f} {point3d_id}" for x, y, point3d_id in points]) - f.write(f"{points2d_line}\n") - -def write_points3d_txt(points3d, point_colors, point_tracks, output_dir): - """Write points3D.txt file""" - with open(os.path.join(output_dir, "points3D.txt"), "w") as f: - f.write("# 3D point list with one line of data per point:\n") - f.write("# POINT3D_ID, X, Y, Z, R, G, B, ERROR, TRACK[] as (IMAGE_ID, POINT2D_IDX)\n") - f.write(f"# Number of points: {len(points3d)}\n") - - valid_points = 0 - for point_idx, (point3d, color, track) in enumerate(zip(points3d, point_colors, point_tracks)): - # Skip points that aren't visible in any image - if not track: - continue - - # Convert color to integers - r, g, b = [int(c * 255) for c in color] - error = 1.0 # Placeholder for reprojection error - - # Format track information - track_str = " ".join([f"{img_id} {point2d_idx}" for img_id, point2d_idx in track]) - - # Write point information - f.write(f"{point_idx} {point3d[0]:.9f} {point3d[1]:.9f} {point3d[2]:.9f} {r} {g} {b} {error:.9f} {track_str}\n") - valid_points += 1 - - print(f"Written {valid_points} valid points (visible in at least one image)") - -def convert_to_colmap_format(extrinsics, intrinsics, point_maps, image_paths, output_dir, image_shapes, images): - """Convert model estimates to COLMAP format files""" - os.makedirs(output_dir, exist_ok=True) - - # Extract sparse point cloud with colors from images - print("Extracting colored sparse point cloud...") - points3d, point_colors, point_origins = extract_sparse_point_cloud(point_maps, images, sample_step=20) - print(f"Extracted {len(points3d)} colored points") - - # Compute point visibility in each image - print("Computing point visibility...") - image_points, point_tracks = compute_point_visibility( - points3d, extrinsics, intrinsics, image_shapes - ) - - # Write COLMAP files - print("Writing COLMAP format files...") - write_cameras_txt(intrinsics, image_shapes, output_dir) - write_images_txt(extrinsics, image_points, image_paths, output_dir) - write_points3d_txt(points3d, point_colors, point_tracks, output_dir) - - print(f"COLMAP format files written to {output_dir}") - -def main(): - parser = argparse.ArgumentParser(description="Convert VGGT estimates to COLMAP format") - parser.add_argument("image_dir", help="Directory containing input images") - parser.add_argument("output_dir", help="Directory to write COLMAP files") - parser.add_argument("--sample-step", type=int, default=10, help="Point sampling step (lower = denser point cloud)") - - args = parser.parse_args() - - # Get list of images - image_paths = sorted(glob.glob(os.path.join(args.image_dir, "*.jpg"))) + \ - sorted(glob.glob(os.path.join(args.image_dir, "*.png"))) - - if not image_paths: - raise ValueError(f"No images found in {args.image_dir}") - - print(f"Found {len(image_paths)} images") - - # Process images with VGGT model - device = "cuda" if torch.cuda.is_available() else "cpu" - dtype = torch.bfloat16 if torch.cuda.is_available() else torch.float32 - - print(f"Using device: {device}") - print("Loading VGGT model...") - - from vggt.models.vggt import VGGT - from vggt.utils.load_fn import load_and_preprocess_images - from vggt.utils.pose_enc import pose_encoding_to_extri_intri - from vggt.utils.geometry import unproject_depth_map_to_point_map - - model = VGGT.from_pretrained("facebook/VGGT-1B").to(device) - - print("Processing images...") - images_tensor = load_and_preprocess_images(image_paths).to(device) - - # Also load images in RGB format for coloring - original_images = [] - image_shapes = [] - for img_path in image_paths: - with Image.open(img_path) as img: - # Convert to RGB and numpy array for coloring purposes - np_img = np.array(img.convert('RGB')) / 255.0 # Normalize to 0-1 - original_images.append(np_img) - # Store image shape - image_shapes.append((img.height, img.width)) - - with torch.no_grad(): - with torch.cuda.amp.autocast(dtype=dtype): - images_batch = images_tensor[None] # add batch dimension - aggregated_tokens_list, ps_idx = model.aggregator(images_batch) - - print("Estimating camera parameters...") - pose_enc = model.camera_head(aggregated_tokens_list)[-1] - extrinsic, intrinsic = pose_encoding_to_extri_intri(pose_enc, images_batch.shape[-2:]) - - print("Estimating depth maps...") - depth_map, _ = model.depth_head(aggregated_tokens_list, images_batch, ps_idx) - - print("Unprojecting to 3D points...") - point_map = unproject_depth_map_to_point_map( - depth_map.squeeze(0), extrinsic.squeeze(0), intrinsic.squeeze(0) - ) - - # Convert to numpy arrays if they're not already - if isinstance(extrinsic, torch.Tensor): - extrinsic_np = extrinsic.squeeze(0).cpu().numpy() - else: - extrinsic_np = extrinsic - - if isinstance(intrinsic, torch.Tensor): - intrinsic_np = intrinsic.squeeze(0).cpu().numpy() - else: - intrinsic_np = intrinsic - - if isinstance(point_map, torch.Tensor): - point_map_np = point_map.cpu().numpy() - else: - point_map_np = point_map - - # Resize original images to match point map if needed - resized_images = [] - for i, img in enumerate(original_images): - h, w, _ = point_map_np[i].shape - if img.shape[0] != h or img.shape[1] != w: - # Use simple resizing - could be improved with better interpolation - from skimage.transform import resize - resized_img = resize(img, (h, w, 3), anti_aliasing=True) - resized_images.append(resized_img) - else: - resized_images.append(img) - - # Convert to COLMAP format - convert_to_colmap_format( - extrinsic_np, intrinsic_np, point_map_np, image_paths, - args.output_dir, image_shapes, resized_images - ) - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/deneme.txt b/deneme.txt deleted file mode 100644 index fa84cdb..0000000 --- a/deneme.txt +++ /dev/null @@ -1,259 +0,0 @@ -Initializing and loading VGGT model... -Initializing and loading VGGT model... -Files copied to input_images_20250318_113826_158596/images; took 0.213 seconds -Images for reconstruction: - input_images_20250318_113826_158596/images/sandalye1.jpg - input_images_20250318_113826_158596/images/sandalye2.jpg - input_images_20250318_113826_158596/images/sandalye3.jpg - input_images_20250318_113826_158596/images/sandalye4.jpg -Running run_model... -Processing images from input_images_20250318_113826_158596 -Found 4 images -Preprocessed images shape: torch.Size([4, 3, 518, 518]) -Running inference... -Converting pose encoding to extrinsic and intrinsic matrices... -extrinsic.shape torch.Size([1, 4, 3, 4]) - -extrinsic tensor([[[[ 1.0000e+00, 3.9872e-05, 2.8053e-04, -3.3790e-05], - [-3.9849e-05, 1.0000e+00, -8.0769e-05, 1.1223e-05], - [-2.8053e-04, 8.0758e-05, 1.0000e+00, -1.1633e-04]], - - [[ 8.7897e-01, -1.3935e-01, 4.5607e-01, -4.3532e-01], - [ 1.3684e-01, 9.8984e-01, 3.8704e-02, -2.3849e-02], - [-4.5683e-01, 2.8389e-02, 8.8910e-01, 1.1196e-01]], - - [[ 5.4024e-01, 2.4198e-01, -8.0597e-01, 7.7377e-01], - [-2.4684e-01, 9.6120e-01, 1.2313e-01, -1.2373e-01], - [ 8.0450e-01, 1.3242e-01, 5.7901e-01, 4.3251e-01]], - - [[-8.7065e-01, 1.3212e-01, -4.7383e-01, 4.1820e-01], - [-1.6372e-01, 8.3051e-01, 5.3240e-01, -5.3343e-01], - [ 4.6386e-01, 5.4111e-01, -7.0145e-01, 1.6244e+00]]]], - device='cuda:0') -extrinsic.shape torch.Size([1, 4, 3, 3]) - -intrinsic tensor([[[[635.5547, 0.0000, 259.0000], - [ 0.0000, 632.4077, 259.0000], - [ 0.0000, 0.0000, 1.0000]], - - [[673.3128, 0.0000, 259.0000], - [ 0.0000, 668.9824, 259.0000], - [ 0.0000, 0.0000, 1.0000]], - - [[647.9485, 0.0000, 259.0000], - [ 0.0000, 645.5082, 259.0000], - [ 0.0000, 0.0000, 1.0000]], - - [[657.2827, 0.0000, 259.0000], - [ 0.0000, 654.9764, 259.0000], - [ 0.0000, 0.0000, 1.0000]]]], device='cuda:0') -Computing world points from depth map... -(4, 518, 518, 3) -[[[[-0.32635777 -0.3277628 0.80045778] - [-0.32256861 -0.32521258 0.79423084] - [-0.32393473 -0.32785957 0.80069504] - ... - [ 0.3017545 -0.30691559 0.74978018] - [ 0.29972646 -0.30366574 0.74184234] - [ 0.29839372 -0.30114284 0.73568019]] - - [[-0.31818604 -0.31832302 0.78041975] - [-0.3173857 -0.31875226 0.78147245] - [-0.31967265 -0.32229703 0.79016251] - ... - [ 0.30374933 -0.30775166 0.75473664] - [ 0.30392252 -0.3067282 0.75222743] - [ 0.29965597 -0.30124899 0.73879209]] - - [[-0.31972387 -0.3186213 0.78419041] - [-0.32490816 -0.32504109 0.79998947] - [-0.32480285 -0.32619915 0.80283983] - ... - [ 0.30304874 -0.30585151 0.75299595] - [ 0.30336437 -0.30497799 0.75084603] - [ 0.2993832 -0.29980799 0.73811962]] - - ... - - [[-0.33901007 0.33658178 0.83136156] - [-0.32582639 0.32474639 0.80213335] - [-0.31179238 0.31196827 0.77057688] - ... - [ 0.30756927 0.30935648 0.7642391 ] - [ 0.29614456 0.29670384 0.73298793] - [ 0.27577959 0.27522561 0.67993796]] - - [[-0.34688456 0.34574441 0.85066747] - [-0.35423694 0.35443977 0.87205807] - [-0.33679196 0.33829626 0.83234564] - ... - [ 0.2973025 0.30019644 0.73872963] - [ 0.2851795 0.28683233 0.70584956] - [ 0.26956483 0.27007303 0.66461615]] - - [[-0.34381086 0.34401416 0.84313129] - [-0.34717483 0.34872546 0.85467628] - [-0.34365569 0.34653311 0.84930432] - ... - [ 0.28845039 0.29238992 0.71673515] - [ 0.29376423 0.29661765 0.72709672] - [ 0.29365914 0.29536141 0.72401809]]] - - - [[[-0.27946509 -0.29477718 0.69031692] - [-0.26531197 -0.29030559 0.68010908] - [-0.26449681 -0.29057286 0.68089283] - ... - [ 0.30653217 -0.34329744 0.87838063] - [ 0.30861049 -0.34085725 0.87222004] - [ 0.31028803 -0.33932096 0.86838007]] - - [[-0.2688719 -0.28984225 0.68177667] - [-0.25869788 -0.28679426 0.67483183] - [-0.24405615 -0.28214502 0.6641481 ] - ... - [ 0.30616927 -0.34339063 0.88149869] - [ 0.30734013 -0.34308526 0.8808186 ] - [ 0.31049251 -0.33810836 0.86809097]] - - [[-0.25766528 -0.28472603 0.67272506] - [-0.2610214 -0.28645689 0.67693901] - [-0.25939894 -0.28643477 0.67704571] - ... - [ 0.30660648 -0.34162906 0.87984014] - [ 0.30754778 -0.34185431 0.88052861] - [ 0.31080704 -0.33663796 0.86713213]] - - ... - - [[-0.26050822 0.39260375 0.78422529] - [-0.23273498 0.37591514 0.75874836] - [-0.19342003 0.35200265 0.72174699] - ... - [ 0.3749378 0.27278311 1.05199034] - [ 0.37321451 0.28736655 1.09755724] - [ 0.37564739 0.28077125 1.07865886]] - - [[-0.26893818 0.39936239 0.79274108] - [-0.27326109 0.40263491 0.79886063] - [-0.24693766 0.38678373 0.7747721 ] - ... - [ 0.3755698 0.27180026 1.0451034 ] - [ 0.37722163 0.26900011 1.03775596] - [ 0.38097745 0.25502119 0.99644519]] - - [[-0.23415218 0.37915543 0.75883711] - [-0.25543611 0.39302342 0.78156286] - [-0.244081 0.38648061 0.77219268] - ... - [ 0.38006765 0.25102234 0.97855636] - [ 0.38073792 0.25290644 0.9853092 ] - [ 0.38054548 0.25944408 1.00614963]]] - - - [[[-0.23509424 -0.41133813 1.08391587] - [-0.2495936 -0.40332443 1.06414579] - [-0.24803409 -0.4034823 1.06426301] - ... - [ 0.01272387 -0.23979517 0.54143505] - [ 0.01129287 -0.23923831 0.5401517 ] - [ 0.02229242 -0.24042661 0.54119231]] - - [[-0.25275668 -0.40132411 1.06256198] - [-0.26313683 -0.39544312 1.04792776] - [-0.25849008 -0.39717296 1.05189651] - ... - [ 0.01571067 -0.23917281 0.54219104] - [ 0.01542839 -0.23877725 0.54111911] - [-0.00361067 -0.23577585 0.53654601]] - - [[-0.26319948 -0.39502293 1.05013188] - [-0.2504369 -0.40083964 1.0641572 ] - [-0.25789636 -0.39645873 1.05314673] - ... - [ 0.00777232 -0.23702825 0.54087802] - [ 0.00771979 -0.23666892 0.53985876] - [-0.01090445 -0.23375314 0.53536792]] - - ... - - [[-0.17039119 0.40640899 1.60073241] - [-0.19096508 0.3885153 1.55737619] - [-0.19465709 0.38497204 1.54676109] - ... - [-0.02004279 0.38856792 0.6495685 ] - [ 0.0340838 0.42424778 0.66639606] - [ 0.03972201 0.4278182 0.66690115]] - - [[-0.15641601 0.42065152 1.62900647] - [-0.18368865 0.39695608 1.57258144] - [-0.19292603 0.38866549 1.55122962] - ... - [-0.03154959 0.38239768 0.64596448] - [-0.0069916 0.39855119 0.65292407] - [-0.0308108 0.38258874 0.64367914]] - - [[-0.19888478 0.38662463 1.54783547] - [-0.19650977 0.38824308 1.5489444 ] - [-0.22517428 0.3632996 1.49018289] - ... - [-0.0785455 0.35255071 0.63039331] - [-0.05018382 0.371291 0.63871399] - [-0.04201678 0.37657947 0.64020454]]] - - - [[[ 0.24408485 -0.35839285 1.02185841] - [ 0.22540079 -0.36147691 1.03593353] - [ 0.22383672 -0.36140655 1.03576627] - ... - [-0.33928249 -0.29961887 0.82623133] - [-0.33998192 -0.29910583 0.82418417] - [-0.33834201 -0.29527485 0.80836729]] - - [[ 0.22273443 -0.36127259 1.04010822] - [ 0.21128833 -0.36304563 1.04818302] - [ 0.21446391 -0.36209773 1.04408448] - ... - [-0.33926179 -0.29841579 0.8256513 ] - [-0.33948677 -0.29722773 0.82082631] - [-0.34343427 -0.30132617 0.83782139]] - - [[ 0.2181925 -0.36106792 1.04436677] - [ 0.22282258 -0.35983951 1.03905615] - [ 0.22128324 -0.35976713 1.03887214] - ... - [-0.34051235 -0.29900312 0.83243455] - [-0.34124158 -0.29853749 0.83059836] - [-0.34494142 -0.30232457 0.8462184 ]] - - ... - - [[ 0.71527314 0.81422378 1.12961781] - [ 0.63372771 0.72739113 1.16137676] - [ 0.63649916 0.73292072 1.15831854] - ... - [-0.36567945 1.18487171 0.38276409] - [-0.36379322 1.25170052 0.33228194] - [-0.3619157 1.32145128 0.27955365]] - - [[ 0.75121778 0.85613816 1.11595538] - [ 0.69141656 0.79312866 1.13858521] - [ 0.63250065 0.73083639 1.161045 ] - ... - [-0.36201864 1.24967404 0.33818433] - [-0.36173734 1.29338213 0.30484941] - [-0.36453465 1.29021636 0.30607512]] - - [[ 0.64923229 0.74657437 1.15902805] - [ 0.68824982 0.79207206 1.14100994] - [ 0.63004851 0.73044378 1.163124 ] - ... - [-0.35799937 1.32063673 0.28931232] - [-0.36057686 1.32153301 0.28752395] - [-0.37615691 1.11483374 0.43864225]]]] -Building GLB scene -Using Depthmap and Camera Branch -GLB Scene built -Total time: 2.53 seconds -Reconstruction successful. Processed 4 frames. -Output GLB file saved at: input_images_20250318_113826_158596/glbscene_50.0AllmaskbFalsemaskwFalse_camFalse_skyFalse_predDepthmapandCameraBranch.glb diff --git a/deneme2.txt b/deneme2.txt deleted file mode 100644 index bfe74e6..0000000 --- a/deneme2.txt +++ /dev/null @@ -1,1118 +0,0 @@ -Initializing and loading VGGT model... -Files copied to input_images_20250318_115921_809868/images; took 0.218 seconds -Images for reconstruction: - input_images_20250318_115921_809868/images/sandalye1.jpg - input_images_20250318_115921_809868/images/sandalye2.jpg - input_images_20250318_115921_809868/images/sandalye3.jpg - input_images_20250318_115921_809868/images/sandalye4.jpg -Running run_model... -Processing images from input_images_20250318_115921_809868 -Found 4 images -Preprocessed images shape: torch.Size([4, 3, 518, 518]) -Running inference... -Converting pose encoding to extrinsic and intrinsic matrices... -extrinsic.shape torch.Size([1, 4, 3, 4]) - -extrinsic tensor([[[[ 1.0000e+00, 3.9872e-05, 2.8053e-04, -3.3790e-05], - [-3.9849e-05, 1.0000e+00, -8.0769e-05, 1.1223e-05], - [-2.8053e-04, 8.0758e-05, 1.0000e+00, -1.1633e-04]], - - [[ 8.7897e-01, -1.3935e-01, 4.5607e-01, -4.3532e-01], - [ 1.3684e-01, 9.8984e-01, 3.8704e-02, -2.3849e-02], - [-4.5683e-01, 2.8389e-02, 8.8910e-01, 1.1196e-01]], - - [[ 5.4024e-01, 2.4198e-01, -8.0597e-01, 7.7377e-01], - [-2.4684e-01, 9.6120e-01, 1.2313e-01, -1.2373e-01], - [ 8.0450e-01, 1.3242e-01, 5.7901e-01, 4.3251e-01]], - - [[-8.7065e-01, 1.3212e-01, -4.7383e-01, 4.1820e-01], - [-1.6372e-01, 8.3051e-01, 5.3240e-01, -5.3343e-01], - [ 4.6386e-01, 5.4111e-01, -7.0145e-01, 1.6244e+00]]]], - device='cuda:0') -extrinsic.shape torch.Size([1, 4, 3, 3]) - -intrinsic tensor([[[[635.5547, 0.0000, 259.0000], - [ 0.0000, 632.4077, 259.0000], - [ 0.0000, 0.0000, 1.0000]], - - [[673.3128, 0.0000, 259.0000], - [ 0.0000, 668.9824, 259.0000], - [ 0.0000, 0.0000, 1.0000]], - - [[647.9485, 0.0000, 259.0000], - [ 0.0000, 645.5082, 259.0000], - [ 0.0000, 0.0000, 1.0000]], - - [[657.2827, 0.0000, 259.0000], - [ 0.0000, 654.9764, 259.0000], - [ 0.0000, 0.0000, 1.0000]]]], device='cuda:0') -Computing world points from depth map... -(4, 518, 518, 3) -[[[[-0.32635777 -0.3277628 0.80045778] - [-0.32256861 -0.32521258 0.79423084] - [-0.32393473 -0.32785957 0.80069504] - ... - [ 0.3017545 -0.30691559 0.74978018] - [ 0.29972646 -0.30366574 0.74184234] - [ 0.29839372 -0.30114284 0.73568019]] - - [[-0.31818604 -0.31832302 0.78041975] - [-0.3173857 -0.31875226 0.78147245] - [-0.31967265 -0.32229703 0.79016251] - ... - [ 0.30374933 -0.30775166 0.75473664] - [ 0.30392252 -0.3067282 0.75222743] - [ 0.29965597 -0.30124899 0.73879209]] - - [[-0.31972387 -0.3186213 0.78419041] - [-0.32490816 -0.32504109 0.79998947] - [-0.32480285 -0.32619915 0.80283983] - ... - [ 0.30304874 -0.30585151 0.75299595] - [ 0.30336437 -0.30497799 0.75084603] - [ 0.2993832 -0.29980799 0.73811962]] - - ... - - [[-0.33901007 0.33658178 0.83136156] - [-0.32582639 0.32474639 0.80213335] - [-0.31179238 0.31196827 0.77057688] - ... - [ 0.30756927 0.30935648 0.7642391 ] - [ 0.29614456 0.29670384 0.73298793] - [ 0.27577959 0.27522561 0.67993796]] - - [[-0.34688456 0.34574441 0.85066747] - [-0.35423694 0.35443977 0.87205807] - [-0.33679196 0.33829626 0.83234564] - ... - [ 0.2973025 0.30019644 0.73872963] - [ 0.2851795 0.28683233 0.70584956] - [ 0.26956483 0.27007303 0.66461615]] - - [[-0.34381086 0.34401416 0.84313129] - [-0.34717483 0.34872546 0.85467628] - [-0.34365569 0.34653311 0.84930432] - ... - [ 0.28845039 0.29238992 0.71673515] - [ 0.29376423 0.29661765 0.72709672] - [ 0.29365914 0.29536141 0.72401809]]] - - - [[[-0.27946509 -0.29477718 0.69031692] - [-0.26531197 -0.29030559 0.68010908] - [-0.26449681 -0.29057286 0.68089283] - ... - [ 0.30653217 -0.34329744 0.87838063] - [ 0.30861049 -0.34085725 0.87222004] - [ 0.31028803 -0.33932096 0.86838007]] - - [[-0.2688719 -0.28984225 0.68177667] - [-0.25869788 -0.28679426 0.67483183] - [-0.24405615 -0.28214502 0.6641481 ] - ... - [ 0.30616927 -0.34339063 0.88149869] - [ 0.30734013 -0.34308526 0.8808186 ] - [ 0.31049251 -0.33810836 0.86809097]] - - [[-0.25766528 -0.28472603 0.67272506] - [-0.2610214 -0.28645689 0.67693901] - [-0.25939894 -0.28643477 0.67704571] - ... - [ 0.30660648 -0.34162906 0.87984014] - [ 0.30754778 -0.34185431 0.88052861] - [ 0.31080704 -0.33663796 0.86713213]] - - ... - - [[-0.26050822 0.39260375 0.78422529] - [-0.23273498 0.37591514 0.75874836] - [-0.19342003 0.35200265 0.72174699] - ... - [ 0.3749378 0.27278311 1.05199034] - [ 0.37321451 0.28736655 1.09755724] - [ 0.37564739 0.28077125 1.07865886]] - - [[-0.26893818 0.39936239 0.79274108] - [-0.27326109 0.40263491 0.79886063] - [-0.24693766 0.38678373 0.7747721 ] - ... - [ 0.3755698 0.27180026 1.0451034 ] - [ 0.37722163 0.26900011 1.03775596] - [ 0.38097745 0.25502119 0.99644519]] - - [[-0.23415218 0.37915543 0.75883711] - [-0.25543611 0.39302342 0.78156286] - [-0.244081 0.38648061 0.77219268] - ... - [ 0.38006765 0.25102234 0.97855636] - [ 0.38073792 0.25290644 0.9853092 ] - [ 0.38054548 0.25944408 1.00614963]]] - - - [[[-0.23509424 -0.41133813 1.08391587] - [-0.2495936 -0.40332443 1.06414579] - [-0.24803409 -0.4034823 1.06426301] - ... - [ 0.01272387 -0.23979517 0.54143505] - [ 0.01129287 -0.23923831 0.5401517 ] - [ 0.02229242 -0.24042661 0.54119231]] - - [[-0.25275668 -0.40132411 1.06256198] - [-0.26313683 -0.39544312 1.04792776] - [-0.25849008 -0.39717296 1.05189651] - ... - [ 0.01571067 -0.23917281 0.54219104] - [ 0.01542839 -0.23877725 0.54111911] - [-0.00361067 -0.23577585 0.53654601]] - - [[-0.26319948 -0.39502293 1.05013188] - [-0.2504369 -0.40083964 1.0641572 ] - [-0.25789636 -0.39645873 1.05314673] - ... - [ 0.00777232 -0.23702825 0.54087802] - [ 0.00771979 -0.23666892 0.53985876] - [-0.01090445 -0.23375314 0.53536792]] - - ... - - [[-0.17039119 0.40640899 1.60073241] - [-0.19096508 0.3885153 1.55737619] - [-0.19465709 0.38497204 1.54676109] - ... - [-0.02004279 0.38856792 0.6495685 ] - [ 0.0340838 0.42424778 0.66639606] - [ 0.03972201 0.4278182 0.66690115]] - - [[-0.15641601 0.42065152 1.62900647] - [-0.18368865 0.39695608 1.57258144] - [-0.19292603 0.38866549 1.55122962] - ... - [-0.03154959 0.38239768 0.64596448] - [-0.0069916 0.39855119 0.65292407] - [-0.0308108 0.38258874 0.64367914]] - - [[-0.19888478 0.38662463 1.54783547] - [-0.19650977 0.38824308 1.5489444 ] - [-0.22517428 0.3632996 1.49018289] - ... - [-0.0785455 0.35255071 0.63039331] - [-0.05018382 0.371291 0.63871399] - [-0.04201678 0.37657947 0.64020454]]] - - - [[[ 0.24408485 -0.35839285 1.02185841] - [ 0.22540079 -0.36147691 1.03593353] - [ 0.22383672 -0.36140655 1.03576627] - ... - [-0.33928249 -0.29961887 0.82623133] - [-0.33998192 -0.29910583 0.82418417] - [-0.33834201 -0.29527485 0.80836729]] - - [[ 0.22273443 -0.36127259 1.04010822] - [ 0.21128833 -0.36304563 1.04818302] - [ 0.21446391 -0.36209773 1.04408448] - ... - [-0.33926179 -0.29841579 0.8256513 ] - [-0.33948677 -0.29722773 0.82082631] - [-0.34343427 -0.30132617 0.83782139]] - - [[ 0.2181925 -0.36106792 1.04436677] - [ 0.22282258 -0.35983951 1.03905615] - [ 0.22128324 -0.35976713 1.03887214] - ... - [-0.34051235 -0.29900312 0.83243455] - [-0.34124158 -0.29853749 0.83059836] - [-0.34494142 -0.30232457 0.8462184 ]] - - ... - - [[ 0.71527314 0.81422378 1.12961781] - [ 0.63372771 0.72739113 1.16137676] - [ 0.63649916 0.73292072 1.15831854] - ... - [-0.36567945 1.18487171 0.38276409] - [-0.36379322 1.25170052 0.33228194] - [-0.3619157 1.32145128 0.27955365]] - - [[ 0.75121778 0.85613816 1.11595538] - [ 0.69141656 0.79312866 1.13858521] - [ 0.63250065 0.73083639 1.161045 ] - ... - [-0.36201864 1.24967404 0.33818433] - [-0.36173734 1.29338213 0.30484941] - [-0.36453465 1.29021636 0.30607512]] - - [[ 0.64923229 0.74657437 1.15902805] - [ 0.68824982 0.79207206 1.14100994] - [ 0.63004851 0.73044378 1.163124 ] - ... - [-0.35799937 1.32063673 0.28931232] - [-0.36057686 1.32153301 0.28752395] - [-0.37615691 1.11483374 0.43864225]]]] -predictions are: {'pose_enc': array([[-3.37897363e-05, 1.12232847e-05, -1.16327807e-04, - 4.03783160e-05, 1.40253847e-04, -1.99284423e-05, - 9.99912739e-01, 7.77416885e-01, 7.73941100e-01], - [-4.35319424e-01, -2.38493308e-02, 1.11960225e-01, - -2.65991432e-03, 2.35401675e-01, 7.12177083e-02, - 9.69018340e-01, 7.38768935e-01, 7.34434426e-01], - [ 7.73772895e-01, -1.23725161e-01, 4.32510823e-01, - 2.63635046e-03, -4.57028240e-01, -1.38719589e-01, - 8.74186814e-01, 7.63139784e-01, 7.60535240e-01], - [ 4.18201447e-01, -5.33430219e-01, 1.62442684e+00, - 8.42045713e-03, -9.06855464e-01, -2.86110312e-01, - 2.49913156e-01, 7.53128111e-01, 7.50727296e-01]], dtype=float32), 'depth': array([[[[0.8004065 ], - [0.7941787 ], - [0.8006431 ], - ..., - [0.7495544 ], - [0.7416174 ], - [0.7354558 ]], - - [[0.78036696], - [0.7814194 ], - [0.7901098 ], - ..., - [0.7545102 ], - [0.75200105], - [0.73856735]], - - [[0.784138 ], - [0.799938 ], - [0.80278826], - ..., - [0.7527699 ], - [0.75061995], - [0.7378951 ]], - - ..., - - [[0.8313675 ], - [0.80213463], - [0.7705732 ], - ..., - [0.76406145], - [0.73281246], - [0.6797665 ]], - - [[0.85067636], - [0.8720697 ], - [0.8323511 ], - ..., - [0.7385541 ], - [0.7056764 ], - [0.664446 ]], - - [[0.8431392 ], - [0.8546855 ], - [0.84931237], - ..., - [0.7165615 ], - [0.7269219 ], - [0.7238432 ]]], - - - [[[0.8450213 ], - [0.8296069 ], - [0.82992375], - ..., - [0.74315095], - [0.7367934 ], - [0.73265654]], - - [[0.832729 ], - [0.82199305], - [0.80593735], - ..., - [0.74608636], - [0.7449555 ], - [0.7323405 ]], - - [[0.8197069 ], - [0.8249376 ], - [0.8242919 ], - ..., - [0.744462 ], - [0.7446377 ], - [0.73138607]], - - ..., - - [[0.9393694 ], - [0.9035564 ], - [0.85201937], - ..., - [0.8837478 ], - [0.92546266], - [0.90736145]], - - [[0.9509837 ], - [0.95849234], - [0.9245999 ], - ..., - [0.877308 ], - [0.8699413 ], - [0.8310992 ]], - - [[0.9043747 ], - [0.93469703], - [0.9209929 ], - ..., - [0.8154963 ], - [0.8212476 ], - [0.84005034]]], - - - [[[0.8165018 ], - [0.7944513 ], - [0.7957529 ], - ..., - [0.7244871 ], - [0.72266656], - [0.73196083]], - - [[0.79125446], - [0.7752091 ], - [0.7810163 ], - ..., - [0.72741014], - [0.7266148 ], - [0.7090475 ]], - - [[0.77649057], - [0.7941085 ], - [0.7823124 ], - ..., - [0.7205475 ], - [0.71996266], - [0.7027654 ]], - - ..., - - [[1.2760837 ], - [1.232059 ], - [1.2224734 ], - ..., - [0.84394604], - [0.9019588 ], - [0.90726 ]], - - [[1.3055836 ], - [1.2478346 ], - [1.2269424 ], - ..., - [0.831785 ], - [0.8577106 ], - [0.83108145]], - - [[1.2199131 ], - [1.2226802 ], - [1.1622933 ], - ..., - [0.7810087 ], - [0.811125 ], - [0.8192587 ]]], - - - [[[0.8269379 ], - [0.80672926], - [0.80615914], - ..., - [0.72536004], - [0.7267492 ], - [0.7406776 ]], - - [[0.80267465], - [0.79074174], - [0.7956026 ], - ..., - [0.7264275 ], - [0.7303505 ], - [0.7143805 ]], - - [[0.7976914 ], - [0.80422896], - [0.80368316], - ..., - [0.7207715 ], - [0.7219732 ], - [0.7072511 ]], - - ..., - - [[1.6044316 ], - [1.4973423 ], - [1.5037652 ], - ..., - [1.8274568 ], - [1.8999041 ], - [1.975504 ]], - - [[1.6533688 ], - [1.5756605 ], - [1.4988701 ], - ..., - [1.8954905 ], - [1.9426546 ], - [1.9387842 ]], - - [[1.5165621 ], - [1.571919 ], - [1.4960619 ], - ..., - [1.9700347 ], - [1.9705786 ], - [1.7455028 ]]]], dtype=float32), 'depth_conf': array([[[1.0000988, 1.000005 , 1.0000015, ..., 1.0000001, 1.0000005, - 1.0000458], - [1.0000018, 1. , 1. , ..., 1. , 1. , - 1.0000029], - [1.0000001, 1. , 1. , ..., 1. , 1. , - 1.0000002], - ..., - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1.0000013, 1. , 1. , ..., 1. , 1. , - 1.0000147]], - - [[1.0000044, 1. , 1. , ..., 1. , 1.0000004, - 1.0000345], - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000014], - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000001], - ..., - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1.0000004, 1. , 1. , ..., 1. , 1. , - 1.0000064]], - - [[1.0000017, 1. , 1. , ..., 1. , 1. , - 1.0000036], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - ..., - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000004]], - - [[1.0000017, 1. , 1. , ..., 1. , 1. , - 1.0000013], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - ..., - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ]]], dtype=float32), 'world_points': array([[[[-0.38207695, -0.37434822, 0.8221682 ], - [-0.3659399 , -0.3726825 , 0.83042854], - [-0.3607235 , -0.36651862, 0.83189493], - ..., - [ 0.35602355, -0.36010328, 0.8068627 ], - [ 0.35760617, -0.36161196, 0.80047923], - [ 0.37884474, -0.3397629 , 0.67519534]], - - [[-0.3768304 , -0.35727033, 0.82274574], - [-0.3636568 , -0.36283225, 0.8284476 ], - [-0.36103976, -0.35936093, 0.8328328 ], - ..., - [ 0.35230455, -0.35493124, 0.8073631 ], - [ 0.35267535, -0.35174412, 0.7997998 ], - [ 0.3585685 , -0.34718755, 0.79951656]], - - [[-0.37289461, -0.3527929 , 0.8113627 ], - [-0.36289504, -0.3544993 , 0.82636696], - [-0.3597397 , -0.3538873 , 0.83367336], - ..., - [ 0.35135618, -0.3495785 , 0.8078512 ], - [ 0.3506884 , -0.3476811 , 0.80013776], - [ 0.35366994, -0.3438282 , 0.80015075]], - - ..., - - [[-0.36830413, 0.35748133, 0.76419127], - [-0.35492593, 0.34797996, 0.7916368 ], - [-0.34697104, 0.34429082, 0.79116416], - ..., - [ 0.3340354 , 0.33725494, 0.7647337 ], - [ 0.33699262, 0.33828783, 0.7597029 ], - [ 0.34208027, 0.33686462, 0.7498733 ]], - - [[-0.35946357, 0.35676062, 0.7551297 ], - [-0.34762868, 0.3525526 , 0.7893895 ], - [-0.3481523 , 0.34768277, 0.787237 ], - ..., - [ 0.33289802, 0.33926642, 0.75883836], - [ 0.33963385, 0.34004268, 0.7554627 ], - [ 0.34730786, 0.33893478, 0.73482615]], - - [[-0.31300932, 0.34076336, 0.6512748 ], - [-0.34658423, 0.35089338, 0.7654841 ], - [-0.34368286, 0.35195783, 0.77350545], - ..., - [ 0.32553282, 0.34684196, 0.74781704], - [ 0.33085003, 0.34468508, 0.7436888 ], - [ 0.23658852, 0.30123493, 0.55968964]]], - - - [[[-0.31517747, -0.32796425, 0.6956756 ], - [-0.3216872 , -0.33031985, 0.7150369 ], - [-0.3211644 , -0.32745454, 0.7179589 ], - ..., - [ 0.29960877, -0.39654562, 0.96303153], - [ 0.30712298, -0.39733675, 0.9615447 ], - [ 0.34398824, -0.3796651 , 0.7922976 ]], - - [[-0.31441432, -0.31001708, 0.6954669 ], - [-0.32174408, -0.32371062, 0.7162361 ], - [-0.3263315 , -0.32245383, 0.7235892 ], - ..., - [ 0.29798135, -0.3918182 , 0.9639515 ], - [ 0.30440602, -0.388992 , 0.960985 ], - [ 0.31573662, -0.38617328, 0.96469945]], - - [[-0.31575918, -0.30630842, 0.6816451 ], - [-0.32328364, -0.3169451 , 0.7153291 ], - [-0.328416 , -0.31827652, 0.72680545], - ..., - [ 0.29887557, -0.38684273, 0.961369 ], - [ 0.30352122, -0.38550383, 0.9593147 ], - [ 0.3101416 , -0.38415724, 0.96630037]], - - ..., - - [[-0.1742928 , 0.37868387, 0.6688211 ], - [-0.16806974, 0.36278448, 0.68365645], - [-0.16413157, 0.35764956, 0.6878358 ], - ..., - [ 0.3930191 , 0.2655134 , 0.9915667 ], - [ 0.39867783, 0.26677594, 0.98919153], - [ 0.41069597, 0.26502335, 0.983859 ]], - - [[-0.16518757, 0.37712416, 0.65953976], - [-0.15989457, 0.36525798, 0.6807556 ], - [-0.15932353, 0.36112165, 0.68165493], - ..., - [ 0.39757085, 0.26926363, 0.987552 ], - [ 0.40700194, 0.26820585, 0.98846155], - [ 0.42461094, 0.2722786 , 0.96192545]], - - [[-0.14644124, 0.3461824 , 0.5716882 ], - [-0.15905654, 0.36518747, 0.66400254], - [-0.15211369, 0.36627784, 0.674485 ], - ..., - [ 0.39915967, 0.27286488, 0.97812235], - [ 0.40582418, 0.27355766, 0.9734615 ], - [ 0.29239157, 0.24710833, 0.72397953]]], - - - [[[-0.24055123, -0.47555315, 1.1497489 ], - [-0.19349965, -0.48061496, 1.1566769 ], - [-0.17696705, -0.46833646, 1.1443497 ], - ..., - [ 0.14982298, -0.283005 , 0.57548344], - [ 0.14561023, -0.28357223, 0.5719869 ], - [ 0.18514743, -0.26552632, 0.4849398 ]], - - [[-0.22764814, -0.45216978, 1.1730809 ], - [-0.1856817 , -0.46743077, 1.1567357 ], - [-0.17669863, -0.46072018, 1.1519431 ], - ..., - [ 0.15052871, -0.27879876, 0.5779284 ], - [ 0.14420916, -0.27446195, 0.5738673 ], - [ 0.14493386, -0.26612192, 0.5714314 ]], - - [[-0.23258516, -0.4539681 , 1.1535513 ], - [-0.181767 , -0.46150786, 1.1605568 ], - [-0.17119458, -0.45782885, 1.1594217 ], - ..., - [ 0.15405403, -0.274233 , 0.5803859 ], - [ 0.14459692, -0.27119967, 0.5756619 ], - [ 0.13711502, -0.2668283 , 0.5761198 ]], - - ..., - - [[-0.45554873, 0.2417899 , 1.2232995 ], - [-0.4083282 , 0.23858957, 1.2188371 ], - [-0.3930919 , 0.23561895, 1.204185 ], - ..., - [-0.05860386, 0.39561367, 0.65330356], - [-0.05958155, 0.39870408, 0.64795417], - [-0.06153874, 0.40139127, 0.645928 ]], - - [[-0.4513191 , 0.23950979, 1.2133999 ], - [-0.4035942 , 0.24191493, 1.2178581 ], - [-0.40293935, 0.23431864, 1.2031474 ], - ..., - [-0.06532838, 0.39806318, 0.6496558 ], - [-0.06056233, 0.39879057, 0.6499951 ], - [-0.05666913, 0.39766705, 0.6369729 ]], - - [[-0.39089993, 0.2608139 , 1.0048475 ], - [-0.41036615, 0.2383695 , 1.1931527 ], - [-0.41098347, 0.23569778, 1.1992356 ], - ..., - [-0.07827827, 0.4016483 , 0.6466236 ], - [-0.06544286, 0.3962488 , 0.63554287], - [-0.09346812, 0.3663947 , 0.4739664 ]]], - - - [[[ 0.26599672, -0.42771608, 1.0628014 ], - [ 0.2798947 , -0.42830792, 1.0364765 ], - [ 0.29351172, -0.4140331 , 1.0120764 ], - ..., - [-0.3184959 , -0.31673416, 0.69558513], - [-0.31787267, -0.31612438, 0.70836174], - [-0.15245034, -0.32766804, 0.5663736 ]], - - [[ 0.2758744 , -0.4150789 , 1.0773362 ], - [ 0.28306904, -0.41604182, 1.0285493 ], - [ 0.28577894, -0.40328488, 1.0122644 ], - ..., - [-0.31102625, -0.30853462, 0.6971798 ], - [-0.3075836 , -0.30468467, 0.70801514], - [-0.28554764, -0.29588708, 0.69550085]], - - [[ 0.27397716, -0.41544712, 1.049261 ], - [ 0.27388158, -0.41776782, 1.0430392 ], - [ 0.28674185, -0.39752078, 1.0046728 ], - ..., - [-0.3048553 , -0.29980552, 0.6904644 ], - [-0.3128433 , -0.30089182, 0.70536673], - [-0.3118052 , -0.29874197, 0.7096921 ]], - - ..., - - [[ 0.13315384, 0.13102354, 1.4538139 ], - [ 0.1265733 , 0.14215223, 1.415358 ], - [ 0.1263011 , 0.14365917, 1.398633 ], - ..., - [-0.39899707, 0.2947014 , 1.0817419 ], - [-0.4066646 , 0.29733956, 1.0822508 ], - [-0.41065946, 0.29718485, 1.0956538 ]], - - [[ 0.12186164, 0.13410984, 1.4557084 ], - [ 0.13160238, 0.15125132, 1.4312451 ], - [ 0.12071934, 0.14570431, 1.4097552 ], - ..., - [-0.41316128, 0.291897 , 1.0904315 ], - [-0.40633118, 0.28890496, 1.1030972 ], - [-0.38653064, 0.2937777 , 1.0761658 ]], - - [[ 0.08610126, 0.16247226, 1.1858633 ], - [ 0.12233471, 0.14179857, 1.4216311 ], - [ 0.118797 , 0.14192834, 1.4256477 ], - ..., - [-0.4227929 , 0.2989565 , 1.1016617 ], - [-0.40015313, 0.30098018, 1.083959 ], - [-0.3857455 , 0.27955198, 0.7823402 ]]]], dtype=float32), 'world_points_conf': array([[[1.000235 , 1.0000138, 1.0000021, ..., 1.0000042, 1.0000052, - 1.0002447], - [1.0000091, 1.0000032, 1.0000002, ..., 1.0000004, 1.000001 , - 1.0000838], - [1.0000017, 1.0000002, 1. , ..., 1. , 1.0000001, - 1.0000285], - ..., - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000014], - [1.0000001, 1. , 1. , ..., 1. , 1. , - 1.0000011], - [1.0000044, 1.0000011, 1.0000004, ..., 1.0000006, 1.0000007, - 1.0000303]], - - [[1.0000181, 1.0000004, 1. , ..., 1.0000008, 1.0000012, - 1.000071 ], - [1.0000001, 1. , 1. , ..., 1. , 1.0000001, - 1.0000206], - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000057], - ..., - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000002], - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000001], - [1.0000021, 1.0000005, 1.0000001, ..., 1.0000001, 1.0000001, - 1.000006 ]], - - [[1.0000092, 1.0000002, 1. , ..., 1.0000001, 1.0000004, - 1.0000556], - [1.0000001, 1. , 1. , ..., 1. , 1. , - 1.000012 ], - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000026], - ..., - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1.0000004, 1.0000001, 1. , ..., 1. , 1. , - 1.0000031]], - - [[1.0000019, 1. , 1. , ..., 1. , 1. , - 1.0000043], - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000011], - [1. , 1. , 1. , ..., 1. , 1. , - 1.0000001], - ..., - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1. , 1. , 1. , ..., 1. , 1. , - 1. ], - [1.0000005, 1.0000002, 1.0000001, ..., 1. , 1. , - 1.000001 ]]], dtype=float32), 'images': array([[[[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]], - - [[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]], - - [[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]]], - - - [[[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]], - - [[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]], - - [[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]]], - - - [[[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]], - - [[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]], - - [[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]]], - - - [[[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]], - - [[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]], - - [[1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - ..., - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.], - [1., 1., 1., ..., 1., 1., 1.]]]], dtype=float32), 'extrinsic': array([[[ 9.99999940e-01, 3.98716875e-05, 2.80530570e-04, - -3.37897363e-05], - [-3.98490338e-05, 1.00000000e+00, -8.07692631e-05, - 1.12232847e-05], - [-2.80533772e-04, 8.07580873e-05, 9.99999940e-01, - -1.16327807e-04]], - - [[ 8.78966391e-01, -1.39345944e-01, 4.56070989e-01, - -4.35319424e-01], - [ 1.36840075e-01, 9.89836752e-01, 3.87043022e-02, - -2.38493308e-02], - [-4.56829131e-01, 2.83890143e-02, 8.89101326e-01, - 1.11960225e-01]], - - [[ 5.40236592e-01, 2.41980508e-01, -8.05971384e-01, - 7.73772895e-01], - [-2.46837318e-01, 9.61202145e-01, 1.23132966e-01, - -1.23725161e-01], - [ 8.04497302e-01, 1.32422894e-01, 5.79006374e-01, - 4.32510823e-01]], - - [[-8.70646954e-01, 1.32123172e-01, -4.73832339e-01, - 4.18201447e-01], - [-1.63717493e-01, 8.30508351e-01, 5.32402456e-01, - -5.33430219e-01], - [ 4.63864446e-01, 5.41109264e-01, -7.01448679e-01, - 1.62442684e+00]]], dtype=float32), 'intrinsic': array([[[635.55475, 0. , 259. ], - [ 0. , 632.4077 , 259. ], - [ 0. , 0. , 1. ]], - - [[673.3128 , 0. , 259. ], - [ 0. , 668.98236, 259. ], - [ 0. , 0. , 1. ]], - - [[647.94855, 0. , 259. ], - [ 0. , 645.50824, 259. ], - [ 0. , 0. , 1. ]], - - [[657.28265, 0. , 259. ], - [ 0. , 654.97644, 259. ], - [ 0. , 0. , 1. ]]], dtype=float32), 'world_points_from_depth': array([[[[-0.32635777, -0.3277628 , 0.80045778], - [-0.32256861, -0.32521258, 0.79423084], - [-0.32393473, -0.32785957, 0.80069504], - ..., - [ 0.3017545 , -0.30691559, 0.74978018], - [ 0.29972646, -0.30366574, 0.74184234], - [ 0.29839372, -0.30114284, 0.73568019]], - - [[-0.31818604, -0.31832302, 0.78041975], - [-0.3173857 , -0.31875226, 0.78147245], - [-0.31967265, -0.32229703, 0.79016251], - ..., - [ 0.30374933, -0.30775166, 0.75473664], - [ 0.30392252, -0.3067282 , 0.75222743], - [ 0.29965597, -0.30124899, 0.73879209]], - - [[-0.31972387, -0.3186213 , 0.78419041], - [-0.32490816, -0.32504109, 0.79998947], - [-0.32480285, -0.32619915, 0.80283983], - ..., - [ 0.30304874, -0.30585151, 0.75299595], - [ 0.30336437, -0.30497799, 0.75084603], - [ 0.2993832 , -0.29980799, 0.73811962]], - - ..., - - [[-0.33901007, 0.33658178, 0.83136156], - [-0.32582639, 0.32474639, 0.80213335], - [-0.31179238, 0.31196827, 0.77057688], - ..., - [ 0.30756927, 0.30935648, 0.7642391 ], - [ 0.29614456, 0.29670384, 0.73298793], - [ 0.27577959, 0.27522561, 0.67993796]], - - [[-0.34688456, 0.34574441, 0.85066747], - [-0.35423694, 0.35443977, 0.87205807], - [-0.33679196, 0.33829626, 0.83234564], - ..., - [ 0.2973025 , 0.30019644, 0.73872963], - [ 0.2851795 , 0.28683233, 0.70584956], - [ 0.26956483, 0.27007303, 0.66461615]], - - [[-0.34381086, 0.34401416, 0.84313129], - [-0.34717483, 0.34872546, 0.85467628], - [-0.34365569, 0.34653311, 0.84930432], - ..., - [ 0.28845039, 0.29238992, 0.71673515], - [ 0.29376423, 0.29661765, 0.72709672], - [ 0.29365914, 0.29536141, 0.72401809]]], - - - [[[-0.27946509, -0.29477718, 0.69031692], - [-0.26531197, -0.29030559, 0.68010908], - [-0.26449681, -0.29057286, 0.68089283], - ..., - [ 0.30653217, -0.34329744, 0.87838063], - [ 0.30861049, -0.34085725, 0.87222004], - [ 0.31028803, -0.33932096, 0.86838007]], - - [[-0.2688719 , -0.28984225, 0.68177667], - [-0.25869788, -0.28679426, 0.67483183], - [-0.24405615, -0.28214502, 0.6641481 ], - ..., - [ 0.30616927, -0.34339063, 0.88149869], - [ 0.30734013, -0.34308526, 0.8808186 ], - [ 0.31049251, -0.33810836, 0.86809097]], - - [[-0.25766528, -0.28472603, 0.67272506], - [-0.2610214 , -0.28645689, 0.67693901], - [-0.25939894, -0.28643477, 0.67704571], - ..., - [ 0.30660648, -0.34162906, 0.87984014], - [ 0.30754778, -0.34185431, 0.88052861], - [ 0.31080704, -0.33663796, 0.86713213]], - - ..., - - [[-0.26050822, 0.39260375, 0.78422529], - [-0.23273498, 0.37591514, 0.75874836], - [-0.19342003, 0.35200265, 0.72174699], - ..., - [ 0.3749378 , 0.27278311, 1.05199034], - [ 0.37321451, 0.28736655, 1.09755724], - [ 0.37564739, 0.28077125, 1.07865886]], - - [[-0.26893818, 0.39936239, 0.79274108], - [-0.27326109, 0.40263491, 0.79886063], - [-0.24693766, 0.38678373, 0.7747721 ], - ..., - [ 0.3755698 , 0.27180026, 1.0451034 ], - [ 0.37722163, 0.26900011, 1.03775596], - [ 0.38097745, 0.25502119, 0.99644519]], - - [[-0.23415218, 0.37915543, 0.75883711], - [-0.25543611, 0.39302342, 0.78156286], - [-0.244081 , 0.38648061, 0.77219268], - ..., - [ 0.38006765, 0.25102234, 0.97855636], - [ 0.38073792, 0.25290644, 0.9853092 ], - [ 0.38054548, 0.25944408, 1.00614963]]], - - - [[[-0.23509424, -0.41133813, 1.08391587], - [-0.2495936 , -0.40332443, 1.06414579], - [-0.24803409, -0.4034823 , 1.06426301], - ..., - [ 0.01272387, -0.23979517, 0.54143505], - [ 0.01129287, -0.23923831, 0.5401517 ], - [ 0.02229242, -0.24042661, 0.54119231]], - - [[-0.25275668, -0.40132411, 1.06256198], - [-0.26313683, -0.39544312, 1.04792776], - [-0.25849008, -0.39717296, 1.05189651], - ..., - [ 0.01571067, -0.23917281, 0.54219104], - [ 0.01542839, -0.23877725, 0.54111911], - [-0.00361067, -0.23577585, 0.53654601]], - - [[-0.26319948, -0.39502293, 1.05013188], - [-0.2504369 , -0.40083964, 1.0641572 ], - [-0.25789636, -0.39645873, 1.05314673], - ..., - [ 0.00777232, -0.23702825, 0.54087802], - [ 0.00771979, -0.23666892, 0.53985876], - [-0.01090445, -0.23375314, 0.53536792]], - - ..., - - [[-0.17039119, 0.40640899, 1.60073241], - [-0.19096508, 0.3885153 , 1.55737619], - [-0.19465709, 0.38497204, 1.54676109], - ..., - [-0.02004279, 0.38856792, 0.6495685 ], - [ 0.0340838 , 0.42424778, 0.66639606], - [ 0.03972201, 0.4278182 , 0.66690115]], - - [[-0.15641601, 0.42065152, 1.62900647], - [-0.18368865, 0.39695608, 1.57258144], - [-0.19292603, 0.38866549, 1.55122962], - ..., - [-0.03154959, 0.38239768, 0.64596448], - [-0.0069916 , 0.39855119, 0.65292407], - [-0.0308108 , 0.38258874, 0.64367914]], - - [[-0.19888478, 0.38662463, 1.54783547], - [-0.19650977, 0.38824308, 1.5489444 ], - [-0.22517428, 0.3632996 , 1.49018289], - ..., - [-0.0785455 , 0.35255071, 0.63039331], - [-0.05018382, 0.371291 , 0.63871399], - [-0.04201678, 0.37657947, 0.64020454]]], - - - [[[ 0.24408485, -0.35839285, 1.02185841], - [ 0.22540079, -0.36147691, 1.03593353], - [ 0.22383672, -0.36140655, 1.03576627], - ..., - [-0.33928249, -0.29961887, 0.82623133], - [-0.33998192, -0.29910583, 0.82418417], - [-0.33834201, -0.29527485, 0.80836729]], - - [[ 0.22273443, -0.36127259, 1.04010822], - [ 0.21128833, -0.36304563, 1.04818302], - [ 0.21446391, -0.36209773, 1.04408448], - ..., - [-0.33926179, -0.29841579, 0.8256513 ], - [-0.33948677, -0.29722773, 0.82082631], - [-0.34343427, -0.30132617, 0.83782139]], - - [[ 0.2181925 , -0.36106792, 1.04436677], - [ 0.22282258, -0.35983951, 1.03905615], - [ 0.22128324, -0.35976713, 1.03887214], - ..., - [-0.34051235, -0.29900312, 0.83243455], - [-0.34124158, -0.29853749, 0.83059836], - [-0.34494142, -0.30232457, 0.8462184 ]], - - ..., - - [[ 0.71527314, 0.81422378, 1.12961781], - [ 0.63372771, 0.72739113, 1.16137676], - [ 0.63649916, 0.73292072, 1.15831854], - ..., - [-0.36567945, 1.18487171, 0.38276409], - [-0.36379322, 1.25170052, 0.33228194], - [-0.3619157 , 1.32145128, 0.27955365]], - - [[ 0.75121778, 0.85613816, 1.11595538], - [ 0.69141656, 0.79312866, 1.13858521], - [ 0.63250065, 0.73083639, 1.161045 ], - ..., - [-0.36201864, 1.24967404, 0.33818433], - [-0.36173734, 1.29338213, 0.30484941], - [-0.36453465, 1.29021636, 0.30607512]], - - [[ 0.64923229, 0.74657437, 1.15902805], - [ 0.68824982, 0.79207206, 1.14100994], - [ 0.63004851, 0.73044378, 1.163124 ], - ..., - [-0.35799937, 1.32063673, 0.28931232], - [-0.36057686, 1.32153301, 0.28752395], - [-0.37615691, 1.11483374, 0.43864225]]]])} -Building GLB scene -Using Depthmap and Camera Branch -GLB Scene built -Total time: 2.35 seconds -Reconstruction successful. Processed 4 frames. -Output GLB file saved at: input_images_20250318_115921_809868/glbscene_50.0AllmaskbFalsemaskwFalse_camFalse_skyFalse_predDepthmapandCameraBranch.glb diff --git a/high_quality_scene.glb b/high_quality_scene.glb deleted file mode 100644 index 3c04e2a..0000000 Binary files a/high_quality_scene.glb and /dev/null differ diff --git a/merged_scene.glb b/merged_scene.glb deleted file mode 100644 index cce0364..0000000 Binary files a/merged_scene.glb and /dev/null differ diff --git a/subtract_rows.py b/subtract_rows.py deleted file mode 100644 index 1fc7b14..0000000 --- a/subtract_rows.py +++ /dev/null @@ -1,22 +0,0 @@ -import pandas as pd - -def subtract_consecutive_rows(csv_file, output_file): - # Read the csv file into a DataFrame - df = pd.read_csv(csv_file) - - # Check if the DataFrame has at least two rows - if len(df) < 2: - print("The CSV file must have at least two rows.") - return - - # Subtract consecutive rows - result_df = df.diff().iloc[1:] - - # Save the result to a new CSV file - result_df.to_csv(output_file, index=False) - print(f"Result saved to {output_file}") - -# Example usage -csv_file_path = 'camera_poses2.csv' -output_file_path = 'camera_poses_sub2.csv' -subtract_consecutive_rows(csv_file_path, output_file_path) \ No newline at end of file