MCPcopy Create free account

hub / github.com/apple/ml-pointersect / functions

Functions743 in github.com/apple/ml-pointersect

Methodforward
r""" Run the network T (= seq_len) times and generate T outputs, where T is the sequence length of xs. Args: xs: (seq_len
cdslib/core/nn/modules/graves.py:352
Methodforward
Run the network T (= seq_len) times and generate T outputs, where T is the sequence length of xs. Args: xs: (seq_len, ba
cdslib/core/nn/modules/vrnn.py:483
Methodforward
r""" Args: input: :math:`(*, C_{in})`, input tensor. Returns: :math:`(*, C_{out})`, output te
cdslib/core/nn/modules/linear.py:85
Methodforward
r""" Args: x: :math:`(*, C_{in})`, input tensor. Returns: :math:`(*, C_{out})`, output tensor
cdslib/core/nn/modules/linear.py:277
Methodforward
r""" Args: x (\*, in_features): input tensor dx (\*, in_features): same shape as x, or
cdslib/core/nn/modules/linear.py:363
Methodforward
r""" Args: x (batch, dim_input, seq_len) or (seq_len, batch, dim_input): the input sequence. batch_fi
cdslib/core/nn/modules/filtered_conv.py:286
Methodforward
r""" Args: input (batch, cin, seq_len): input sequence Returns: output (batch, cin, seq_len_o
cdslib/core/nn/modules/filtered_conv.py:429
Methodforward
Args: input: (batch, cin, seq_len) style: (batch, dim_style) Returns: (batch, cout, seq_len_out)
cdslib/core/nn/modules/filtered_conv.py:618
Methodforward
Args: inputs: (seq_len, batch_size, dim_input) input used to compute attention context_vectors: (num_
cdslib/core/nn/modules/attention.py:95
Methodforward
Args: x: (num_char, batch, dim_input) symbol embedding valid_lens: (batch,) valid seq
cdslib/core/nn/modules/tacotron_content_encoder.py:93
Methodforward
r""" Args: input: - For A: `(*, in_features)` - For AT: `(*, out_features)` - For
cdslib/core/nn/modules/subspace.py:71
Methodforward
r""" Args: x `(*, in_features)`: input tensor s `(*, style_features)`: style tensor or
cdslib/core/nn/modules/subspace.py:284
Methodforward
r""" Args: x `(*, in_features)`: input tensor styles `(*, style_features)` or list of tensors `(*, sty
cdslib/core/nn/modules/subspace.py:464
Methodforward
r""" Args: x: `(*, B, C)` Returns: y: `(*, B, C)`
cdslib/core/nn/modules/nested_dropout.py:41
Methodforward
Args: logits (N, C): tensor of logits. targets (N, ): :math:`targets_i \in {0,1}`
cdslib/core/nn/modules/focal_loss.py:43
Methodforward
(self, x: torch.Tensor)
cdslib/core/nn/modules/conv.py:277
Methodforward
Args: x (batch, dim_input, seq_len) or (seq_len, batch, dim_input): input sequence batch_first (bool)
cdslib/core/nn/modules/conv.py:681
Methodforward
Args: x: (batch, dim_input) h: current/initial hidden state. If None, a all-zero hidd
cdslib/core/nn/modules/lstm.py:117
Methodforward
Args: x: (seq_len, batch_size, dim_input) h0: hidden state of the lstm. See :py:class:`nn.LSTM`.
cdslib/core/nn/modules/lstm.py:255
Methodforward
apply the color correction Args: x: (*, 3) Returns: (*, 3) corrected x
pointersect/inference/structures.py:4279
Methodforward
r"""Pass the input through the encoder layer. Args: src: the sequence to the encoder layer (required). src_mask: the
pointersect/models/network_transformer.py:105
Methodforward
r"""Pass the input through the encoder layers in turn. Args: src: the sequence to the encoder (required). mask: the m
pointersect/models/network_transformer.py:199
Methodforward
Args: points: (b, m, k, 3) or (bm, k, 3), m: number of rays, n: number of neighbor points, xyz coord of points addit
pointersect/models/pointersect.py:222
Functiongather_points_v1
Gather the points belonging to each grid cell. Args: grid_idxs: (b, n), grid linear index of each point total_cells: (b,) total grid cells valid_mask
pointersect/pr/cuda/pr_cuda.cpp:222
Functiongather_points_v2
Gather the points belonging to each grid cell. Args: grid_idxs: (b, n), grid linear index of each point total_cells: (b,) total grid cells valid_mask
pointersect/pr/cuda/pr_cuda.cpp:257
Functiongenerate_camera_circle_path
Generate a camera path that looks at the world origin Args: num_poses: number of camera poses sampled on the circle
plib/utils.py:2033
Functiongenerate_camera_grids
( num_x: int, num_y: int, cam_position_center, # (1, 3) delta: float = 0.5, )
plib/utils.py:2410
Functiongenerate_camera_polar_grids
Sample grid on theta and phi. phi here: angle between z-axis and camera position Args: num_theta: num_phi: including two
plib/utils.py:2453
Functiongenerate_camera_rect_path
Generate a rect camera path that looks at x_center, y_center Args: num_poses: number of camera poses sampled on the rect
plib/utils.py:2139
Functiongenerate_camera_spiral_path
Generate a spiral camera path that looks at the world origin Args: num_poses: number of camera poses sampled on the spira
plib/utils.py:2292
Functiongenerate_random_camera_poses
Generate `n` random camera poses, all of them within a cone of angle of `max_angle` (in degree) (i.e., -max_angle, max_angle) pointing toward
plib/rigid_motion.py:571
Functiongenerated_cleaned_mesh
Generate a cleaned mesh in the new directory. Args: input_dir: input folder of the mesh (obj) output_dir: output folder of t
plib/preprocess_obj.py:16
Functionget_H_c2w_Rt
Construct a camera pose homogeneous matrix H_c2w from camera frame R_w and position t_w. Args: R_w: (*, 3, 3) camera coo
plib/rigid_motion.py:528
Functionget_H_c2w_lookat
Construct a camera pose homogeneous matrix H_c2w. Args: pinhole_location_w: (*, 3) pinhole location in the world coordin
plib/rigid_motion.py:469
Functionget_Sketchfab_model_list
( rootpath: str, setting: str, num_classes: int = 3, rnd_seed: int = 0 )
pointersect/data/genlist.py:165
Functionget_Sketchfab_with_license_model_list
( rootpath: str, setting: str, num_classes: int = 3, rnd_seed: int = 0 )
pointersect/data/genlist.py:146
Methodget_all_num_pixels
(self)
pointersect/data/mesh_dataset_v2.py:411
Functionget_base_dir
()
pointersect/meta_script/meta_script_utils.py:10
Methodget_camera_trajectory_arrows
Create arrows pointing from one camera position to the next one. Returns: list of list of arrows. (b, q-1)
pointersect/inference/structures.py:1997
Methodget_current_lr
Get the current learning rate.
cdslib/core/optim/tf_optim.py:157
Methodget_dataloaders
(self)
tests/cdslib/script/test_base_train.py:73
Methodget_dataloaders
This function is called after setup_assets.
pointersect/script/train_v2.py:294
Functionget_dataset
( dataset_name: str, dataset_info: T.Dict[str, T.Any], input_camera_setting: T.Dict[st
pointersect/data/dataset_helper.py:432
Functionget_embedding_function
r""" Returns a lambda function that internally calls positional_encoding. Args: num_encoding_functions: Number of encodin
pointersect/models/model_utils.py:253
Methodget_extra_state
(self)
pointersect/inference/structures.py:4271
Functionget_grid_idx
Compute the grid index given xyz_w. Args: points: (b, n, 3) grid_size: (b, 3) long. number of grid cells in x y z. center: (b, 3) center of the grid
pointersect/pr/cuda/pr_cuda.cpp:189
Functionget_img_max_val
(img: T.Union[np.ndarray, torch.Tensor])
plib/utils.py:2712
Methodget_init_h
(self, batch_size=1, device=torch.device("cpu"))
cdslib/core/nn/modules/lstm.py:244
Methodget_invalid_idxs
Return indexes of which the files do not exist.
cdslib/core/data/index_reader.py:108
Functionget_k_neighbor_points_in_chunks
Given n points (xyz) and m rays, return the neighboring points to each ray. Args: points: (*, n, 3) ray_origins:
plib/utils.py:447
Functionget_np_dtype
Return the cooresponding numpy dtype.
plib/sample_utils.py:10
Methodget_num_points
get number of points (excluding point at inf) but including the invalid points.
pointersect/inference/structures.py:101
Methodget_num_valid_points
get number of valid points (excluding point at inf) but including the invalid points.
pointersect/inference/structures.py:111
Functionget_o3d_camera_frame
Create a camera coordinate frame (as a mesh) in the world coordinate.
plib/utils.py:2551
Functionget_pointersect_max_ray_chunk_size
Returns the max ray chunk size.
pointersect/inference/inference_utils.py:19
Methodget_rgbd_image
Return rgbd_image (with surface normal) to compare with other methods. Camera should be the orignal camera used to cast the camera ra
pointersect/inference/structures.py:1505
Functionget_samples
Uniformly distribute `total_samples` within [0, 1)^{d}. Args: total_samples: total number of samples d:
plib/sample_utils.py:46
Methodget_shape
Returns the shape of idx-th sample.
cdslib/core/data/chunked_memmap.py:181
Methodget_spiral_trajectory
Given a trajectory of camera poses, create a trajectory that is a spiral near the trajectory. The function only moves the ca
pointersect/inference/structures.py:4129
Functionget_torch_dtype
Return the cooresponding numpy dtype.
plib/sample_utils.py:28
Methodget_uid
Return the uid of the i-th line in the index file. If with_uid was set to False, returns None.
cdslib/core/data/index_reader.py:102
Functiongif_to_nparray
Load gif to numpy array. Args: filename: filename of the gif crop_ratio: ratio of part to be cropped crop_dir: dire
plib/render.py:523
Functiongrid_ray_intersection
Compute the intersection between grid cells and the ray. Args: ray_origins: (b, m, 3) ray_directions: (b, m, 3) ray_radius: (b,) grid_size: (b, 3) lo
pointersect/pr/cuda/pr_cuda.cpp:299
Methodidxmap
pointersect/pr/cpp/pr.cpp:22
Functionind2sub
Given linear index, return (i,j,k) Args: ind: # (*, n) long, x + y * sx + z * sx * sy (*, n) long, z + y *
pointersect/pr/naive.py:41
Functionind2sub
Given linear index, return (i,j,k) Args: ind: (*, n) int64_t, z + y * sz + x * sy * sz size: (*, 3) int64_t Returns: (*, n, 3) int64_t
pointersect/pr/cpp/pr.cpp:129
Functionind2sub_c
pointersect/pr/cpp/pr.cpp:64
Methodindex_select
(self, dim: int, index: torch.Tensor)
pointersect/inference/structures.py:2159
Methodinfer
Called during inference.
cdslib/core/models/base_model.py:360
Functioninit_distributed
(n_gpus=-1, rank=-1, auto_detect: bool = True)
cdslib/core/utils/multigpu_utils.py:15
Functioninit_weight
A helper function to initialize the weights of a linear/convolutional layer. Args: weight: (*), an n-dimensional torch.T
cdslib/core/nn/nn_utils.py:17
Functioninterp_homegeneous_matrices
Interpolate rotation and translation so that it follows the shortest path and has constant speed. Ref: https://www.geometrictools.com/Do
plib/rigid_motion.py:199
Functioninterp_homegeneous_tensors
Geodestic interpolation between RigidMotion H0 and RigidMotion H1. t=0 -> H0, t=1 -> H1. Args: t: float or (*,), interp
plib/rigid_motion.py:232
Functioninterp_surface_normal_from_ray_tracing_results
Interpolate the surface normal of the intersection points using surface normal on the vertices. Args: mesh: raycast_results:
plib/render.py:182
Functionkeep_min_k_values
pointersect/pr/cuda/pr_cuda.cpp:550
Functionlaunch
launch the inference, using the parameters in the config yaml file. Args: config_filename: yaml filename
pointersect/inference/main.py:2076
Functionload_hypersim_camera_info
Load the csv file containing the camera information about each scene. Args: filename: csv file containing the camera inf
pointersect/data/hypersim_dataset.py:46
Functionload_model
Load a model (:py:class:`BaseModel`) to device and as eval mode. Args: filename: filename of the pt file model_n
cdslib/core/models/model_utils.py:14
Functionload_pointersect
load a pretrained pointersect model from bolt. Args: filename: filename of the model checkpoint device:
pointersect/inference/inference_utils.py:42
Methodload_state_dict
Load the state dictionary.
pointersect/inference/structures.py:260
Methodload_state_dict
Load the state dictionary.
pointersect/inference/structures.py:1305
Methodload_state_dict
Load the state dictionary.
pointersect/inference/structures.py:2457
Functionlpips
Convenient function to call lpips library to calculate the LPIPS metric. Not differentiable. Args: rgb: (h, w, 3), in the range
plib/metrics.py:41
Functionmain_full
()
pointersect/inference/main.py:2270
Functionmain_pcd
()
pointersect/inference/main.py:2267
Functionoptimizer_to
Move optimizer to a specific device. Args: optimizer: the optimzer to move device: the torch device
cdslib/core/optim/optim_utils.py:8
Functionpad_till_sequence_length
Pad x in the sequence dimension so that x has sequence length at least min_seq_len Args: x: (seq_len, b, dim) if not
cdslib/core/nn/nn_utils.py:389
Functionplane_ray_intersection
Compute the intersection between plane_i and ray_i. Returns: ts: (*,)
plib/utils.py:1895
Functionplot_multiple_images
Plot multiple images by concatenate them in space.
plib/utils.py:1761
Functionplot_points_and_rays
( points: torch.Tensor, # (n, 3) ray_origins: torch.Tensor, # (m, 3) ray_directions:
plib/utils.py:1470
Functionpreprocess_mesh
Clean the mesh uv and textures, normalize the mesh within [-scale, scale]. Args: mesh: input mesh scale: parameter to scalin
plib/mesh_utils.py:71
Functionprint2D
Print a 2D matrix. The function automatically breaks lines when printing a large 2D array. Args: arr: The matrix to prin
cdslib/core/utils/print_and_save.py:112
Functionpsnr
Calculate the PSNR metric. Non-differentiable. Args: rgb: (h, w, 3), in the range of [0, 1] gts: (h, w, 3), in the range of
plib/metrics.py:12
Functionrandn_like
Create a new tensor or nested list of tensors that has the same shape as x. Each of the tensor is filled with iid samples from a standard nor
cdslib/core/nn/nn_utils.py:119
Functionrandom_crop
Randomly crop a sequence from each sequence in xs. Args: xs: (seq_len, batch, *) input sequences valid_lens:
cdslib/core/utils/tensor_utils.py:45
Functionrasterize
Use open3d's visualizer to render image and depth_map from the camera. Args: meshes: a list of meshes intrinsic_matrix:
plib/render.py:225
Functionray_aabb_intersection
Check whether a ray intersect with an axis-aligned bounding box. Args: ray_origin: (3,) a point on the ray (with t = 0)
plib/utils.py:266
Functionread_config
(filename: str)
pointersect/meta_script/meta_script_utils.py:19
Functionrectify_points
Given n points associated with each of the m rays (each row in points), rotate and translate the coordinate so that - ray direction becom
plib/utils.py:928
Functionremesh_file
Uvmap a mesh file using xatlas. All existing textures are discarded. Args: filename: input mesh file out_filena
plib/render.py:844
← previousnext →501–600 of 743, ranked by callers