MCPcopy Create free account

hub / github.com/InternRobotics/G2VLM / functions

Functions2,118 in github.com/InternRobotics/G2VLM

Functionload_images_as_tensor
Loads images from a directory or video, resizes them to a uniform size, then converts and stacks them into a single [N, 3, H, W] PyTorch tens
eval_code/recons/models/pi3/utils/basic.py:11
Functionload_pretrained_weights
(model, pretrained_weights, checkpoint_key)
modeling/pi3/models/dinov2/utils/utils.py:20
Functionload_pretrained_weights
(model, pretrained_weights, checkpoint_key)
eval_code/recons/models/moge/model/dinov2/utils/utils.py:20
Functionload_pretrained_weights
(model, pretrained_weights, checkpoint_key)
eval_code/recons/models/pi3/models/dinov2/utils/utils.py:20
Functionmask_aware_area_resize_numpy
Resize 2D map by nearest interpolation. Return the nearest neighbor index and mask of the resized map. ### Parameters - `image`: Input 2
eval_code/recons/models/moge/utils/geometry_numpy.py:216
Functionmask_aware_nearest_resize
Resize 2D map by nearest interpolation. Return the nearest neighbor index and mask of the resized map. ### Parameters - `inputs`: a sing
eval_code/recons/models/moge/utils/geometry_torch.py:173
Functionmasked_max
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:878
Functionmasked_min
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:872
Functionmatrix_to_axis_angle
Convert rotations given as rotation matrices to axis/angle. Args: matrix: Rotation matrices as tensor of shape (..., 3, 3). Ret
modeling/g2vlm/rotation_utils.py:494
Functionmatrix_to_axis_angle
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:902
Functionmatrix_to_euler_angles
Convert rotations given as rotation matrices to Euler angles in radians. Args: matrix: Rotation matrices as tensor of shape (..., 3,
modeling/g2vlm/rotation_utils.py:279
Functionmatrix_to_euler_angles
Convert rotations given as rotation matrices to Euler angles in radians. NOTE: The composition order eg. `XYZ` means `Rz * Ry * Rx` (like ble
eval_code/recons/models/moge/utils3d/torch/transforms.py:867
Functionmatrix_to_euler_angles
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:896
Functionmatrix_to_quaternion
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:590
Functionmatrix_to_rotation_6d
Converts rotation matrices to 6D rotation representation by Zhou et al. [1] by dropping the last row. Note that 6D representation is not uniq
modeling/g2vlm/rotation_utils.py:598
Functionmax_pool_1d
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:296
Functionmax_pool_2d
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:302
Functionmax_pool_nd
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:308
Functionmerge_duplicate_vertices
Merge duplicate vertices of a triangular mesh. Duplicate vertices are merged by selecte one of them, and the face indices are updated accord
eval_code/recons/models/moge/utils3d/torch/mesh.py:452
Functionmerge_duplicate_vertices
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:206
Functionmerge_duplicate_vertices
Merge duplicate vertices of a triangular mesh. Duplicate vertices are merged by selecte one of them, and the face indices are updated accord
eval_code/recons/models/moge/utils3d/numpy/mesh.py:201
Functionmerge_panorama_depth
(width: int, height: int, distance_maps: List[np.ndarray], pred_masks: List[np.ndarray], extrinsics: List[np.n
eval_code/recons/models/moge/utils/panorama.py:105
Functionmesh_relations
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:224
Functionmesh_relations
Calculate the relation between vertices and faces. NOTE: The input mesh must be a manifold triangle mesh. Args: faces (np.ndarra
eval_code/recons/models/moge/utils3d/numpy/mesh.py:291
Functionmipnerf_render_rays
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:848
Functionmipnerf_render_view
MipNeRF rendering of views. Note that it supports arbitrary batch dimensions (denoted as `...`) Args: extrinsics: (..., 4, 4) extrin
eval_code/recons/models/moge/utils3d/torch/nerf.py:567
Functionmipnerf_render_view
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:860
Functionmkdir
Checks whether the directory exists and creates it if necessacy.
eval_code/recons/datasets/preprocess/prepare_7scenes.py:37
Methodmodel_input_names
(self)
modeling/qwen2vl/processing_qwen2_vl.py:190
Functionmotion_blur_opencv
(image, kernel_size=15, angle=0)
data/transforms.py:234
Functionmultithead_execute
(inputs: List[Any], num_workers: int, pbar = None)
eval_code/recons/models/moge/utils/tools.py:224
Functionnerf_render_rays
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:842
Functionnerf_render_view
NeRF rendering of views. Note that it supports arbitrary batch dimensions (denoted as `...`) Args: extrinsics: (..., 4, 4) extrinsic
eval_code/recons/models/moge/utils3d/torch/nerf.py:504
Functionnerf_render_view
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:854
Functionneus_render_rays
TODO NeuS rendering of rays. Note that it supports arbitrary batch dimensions (denoted as `...`) Args: neus: neus model, which t
eval_code/recons/models/moge/utils3d/torch/nerf.py:417
Methodno_weight_decay
(self)
modeling/pi3/models/segformer/backbone.py:305
Functionnorm3d
Faster `np.linalg.norm(x, axis=-1)` for 3D vectors
eval_code/recons/models/moge/utils/geometry_numpy.py:286
Functionnormal_init
(module, mean=0, std=1, bias=0)
modeling/pi3/models/segformer/head.py:31
Functionnormalize_intrinsics
Normalize camera intrinsics(s) to uv space Args: intrinsics (torch.Tensor): [..., 3, 3] camera intrinsics(s) to normalize wi
eval_code/recons/models/moge/utils3d/torch/transforms.py:452
Functionnormalize_intrinsics
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:512
Functionnormalize_intrinsics
Normalize intrinsics from pixel cooridnates to uv coordinates Args: intrinsics (np.ndarray): [..., 3, 3] camera intrinsics(s) to nor
eval_code/recons/models/moge/utils3d/numpy/transforms.py:372
Functionnormals_edge
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:320
Functionnormals_edge
Compute the edge mask from normal map. Args: normal (np.ndarray): shape (..., height, width, 3), normal map tol (float): tol
eval_code/recons/models/moge/utils3d/numpy/utils.py:161
Methodnum_layers
(self)
modeling/g2vlm/qwen2vl.py:243
Functionone_value
(dtype)
eval_code/recons/models/moge/utils3d/numpy/rasterization.py:33
Functionopencv_camera_to_plucker
(poses, K, H, W)
modeling/pi3/utils/geometry.py:322
Functionopencv_camera_to_plucker
(poses, K, H, W)
eval_code/recons/models/pi3/utils/geometry.py:330
Functionopencv_from_cameras_projection
(R, T, focal, p0, image_size)
eval_code/recons/datasets/co3d_v2.py:22
Functionopencv_from_cameras_projection_intr
(focal, p0, image_size)
eval_code/recons/datasets/co3d_v2.py:69
Functionparse
(x)
eval_code/recons/models/vggt/heads/track_modules/modules.py:20
Methodparse_row
(self, row)
data/interleave_datasets/recon_then_und_dataset.py:360
Functionperspective
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:422
Functionperspective_from_fov
Get OpenGL perspective matrix from field of view in largest dimension Args: fov (float | torch.Tensor): field of view in largest dim
eval_code/recons/models/moge/utils3d/torch/transforms.py:147
Functionperspective_from_fov
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:428
Functionperspective_from_fov
Get OpenGL perspective matrix from field of view in largest dimension Args: fov (float | np.ndarray): field of view in largest dimen
eval_code/recons/models/moge/utils3d/numpy/transforms.py:85
Functionperspective_from_fov_xy
Get OpenGL perspective matrix from field of view in x and y axis Args: fov_x (float | torch.Tensor): field of view in x axis
eval_code/recons/models/moge/utils3d/torch/transforms.py:172
Functionperspective_from_fov_xy
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:434
Functionperspective_from_fov_xy
Get OpenGL perspective matrix from field of view in x and y axis Args: fov_x (float | np.ndarray): field of view in x axis f
eval_code/recons/models/moge/utils3d/numpy/transforms.py:110
Functionperspective_to_intrinsics
OpenGL perspective matrix to OpenCV intrinsics Args: perspective (torch.Tensor): [..., 4, 4] OpenGL perspective matrix Returns:
eval_code/recons/models/moge/utils3d/torch/transforms.py:370
Functionperspective_to_intrinsics
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:482
Functionperspective_to_intrinsics
OpenGL perspective matrix to OpenCV intrinsics Args: perspective (np.ndarray): [..., 4, 4] OpenGL perspective matrix Returns:
eval_code/recons/models/moge/utils3d/numpy/transforms.py:279
Functionperspective_to_near_far
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:488
Functionperspective_to_near_far
Get near and far planes from OpenGL perspective matrix Args:
eval_code/recons/models/moge/utils3d/numpy/transforms.py:297
Functionpiecewise_lerp
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:662
Functionpiecewise_lerp
Linear spline interpolation. ### Parameters: - `x`: np.ndarray, shape (n, d): the values of data points. - `t`: np.ndarray, shape (n
eval_code/recons/models/moge/utils3d/numpy/transforms.py:1031
Functionpiecewise_lerp_se3_matrix
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:668
Functionpiecewise_lerp_se3_matrix
Linear spline interpolation for SE(3) matrices. ### Parameters: - `T`: np.ndarray, shape (n, 4, 4): the SE(3) matrices. - `t`: np.nd
eval_code/recons/models/moge/utils3d/numpy/transforms.py:1060
Functionpil_img2rgb_no_alpha
(image)
data/data_utils.py:266
Methodpin_memory
(self)
data/dataset_base.py:682
Methodpin_memory
(self)
data/dataset_base_periter.py:678
Functionpixel_to_ndc
Args: pixel (torch.Tensor): [..., 2] pixel coordinrates defined in image space, x range is (0, W - 1), y range is (0, H - 1) widt
eval_code/recons/models/moge/utils3d/torch/transforms.py:555
Functionpixel_to_ndc
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:530
Functionpixel_to_ndc
Args: pixel (np.ndarray): [..., 2] pixel coordinrates defined in image space, x range is (0, W - 1), y range is (0, H - 1) width
eval_code/recons/models/moge/utils3d/numpy/transforms.py:484
Functionpixel_to_uv
Args: pixel (torch.Tensor): [..., 2] pixel coordinrates defined in image space, x range is (0, W - 1), y range is (0, H - 1) wid
eval_code/recons/models/moge/utils3d/torch/transforms.py:515
Functionpixel_to_uv
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:524
Functionpixel_to_uv
Args: pixel (np.ndarray): [..., 2] pixel coordinrates defined in image space, x range is (0, W - 1), y range is (0, H - 1) width
eval_code/recons/models/moge/utils3d/numpy/transforms.py:443
Functionpoint_map_to_depth_legacy
(points: torch.Tensor)
eval_code/recons/models/moge/utils/geometry_torch.py:90
Functionpoint_map_to_depth_legacy_numpy
(points: np.ndarray)
eval_code/recons/models/moge/utils/geometry_numpy.py:59
Functionpoints_to_normals
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:380
Methodpost_process_image_text_to_text
Post-process the output of the model to decode the text. Args: generated_outputs (`torch.Tensor` or `np.ndarray`):
modeling/qwen2vl/processing_qwen2_vl.py:173
Methodprepare_for_tokenization
(self, text, **kwargs)
modeling/qwen2/tokenization_qwen2.py:326
Methodprepare_inputs_for_generation
( self, input_ids, past_key_values=None, attention_mask=None, inputs_e
modeling/qwen2vl/modeling_qwen2_vl.py:1814
Methodprepare_prompts
(self, curr_kvlens, curr_rope, prompts, tokenizer, new_token_ids)
modeling/g2vlm/g2vlm.py:662
Methodprepare_prompts_addeos
(self, curr_kvlens, curr_rope, prompts, tokenizer, new_token_ids)
modeling/g2vlm/g2vlm.py:592
Methodpreprocess
Args: images (`ImageInput`): Image to preprocess. Expects a single or batch of images with pixel values ranging f
modeling/qwen2vl/image_processing_qwen2_vl.py:275
Methodpreprocess
Args: images (`ImageInput`): Image to preprocess. Expects a single or batch of images with pixel values ranging f
modeling/qwen2vl/image_processing_qwen2_vl_fast.py:230
Functionprocess_directory
(directory)
eval_code/recons/relpose/evo_utils.py:468
Methodprocess_one_image
Process a single image and its associated data. This method handles image transformations, depth processing, and coordinate conversi
data/recon_dataset.py:490
Functionprocess_scene
(ds)
eval_code/recons/datasets/preprocess/prepare_7scenes.py:65
Functionproject_cv
Project 3D points to 2D following the OpenCV convention Args: points (torch.Tensor): [..., N, 3] or [..., N, 4] 3D points to project
eval_code/recons/models/moge/utils3d/torch/transforms.py:655
Functionproject_cv
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:566
Functionproject_cv
Project 3D points to 2D following the OpenCV convention Args: points (np.ndarray): [..., N, 3] or [..., N, 4] 3D points to project,
eval_code/recons/models/moge/utils3d/numpy/transforms.py:583
Functionproject_depth
Project linear depth to depth value in screen space Args: depth (torch.Tensor): [...] depth value near (float | torch.Tensor
eval_code/recons/models/moge/utils3d/torch/transforms.py:577
Functionproject_depth
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:542
Functionproject_depth
Project linear depth to depth value in screen space Args: depth (np.ndarray): [...] depth value near (float | np.ndarray): [
eval_code/recons/models/moge/utils3d/numpy/transforms.py:507
Functionproject_gl
Project 3D points to 2D following the OpenGL convention (except for row major matrice) Args: points (torch.Tensor): [..., N, 3 or 4]
eval_code/recons/models/moge/utils3d/torch/transforms.py:617
Functionproject_gl
(*args, **kwargs)
eval_code/recons/models/moge/utils3d/_unified/__init__.py:572
Functionproject_gl
Project 3D points to 2D following the OpenGL convention (except for row major matrice) Args: points (np.ndarray): [..., N, 3] or [..
eval_code/recons/models/moge/utils3d/numpy/transforms.py:547
Methodprovide
(self)
eval_code/recons/models/moge/utils/pipeline.py:214
Functionquaternion_apply
Apply the rotation given by a quaternion to a 3D point. Usual torch rules for broadcasting apply. Args: quaternion: Tensor of qu
modeling/g2vlm/rotation_utils.py:453
← previousnext →1,801–1,900 of 2,118, ranked by callers