Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/apple/ml-sharp
/ functions
Functions
179 in github.com/apple/ml-sharp
⨍
Functions
179
◇
Types & classes
48
↳
Endpoints
2
↓ 14 callers
Method
to
Move Gaussians to device.
src/sharp/utils/gaussians.py:35
↓ 9 callers
Function
checkpoint_wrapper
Helper function that applies checkpointing. If enabled applies grad checkpointing, otherwise just executes the function normally.
src/sharp/utils/training.py:10
↓ 6 callers
Function
_create_project_upsample_block
( dim_in: int, dim_out: int, upsample_layers: int, dim_intermediate: int | None = None, )
src/sharp/models/gaussian_decoder.py:50
↓ 6 callers
Function
residual_block_2d
Create a simple 2D residual block.
src/sharp/models/blocks.py:76
↓ 4 callers
Function
_create_block
(dim_in: int, dim_out: int)
src/sharp/models/blocks.py:97
↓ 4 callers
Function
merge
Merge the patched input into a image with sliding window.
src/sharp/models/encoders/spn_encoder.py:341
↓ 4 callers
Function
norm_layer_2d
Create normalization layer.
src/sharp/models/blocks.py:18
↓ 4 callers
Function
split
Split the input into small patches with sliding window.
src/sharp/models/encoders/spn_encoder.py:319
↓ 3 callers
Function
_compute_depth_quantiles
Compute disparity quantiles for scene and extrinsics id.
src/sharp/utils/camera.py:368
↓ 3 callers
Function
_save_image_tensor
(tensor: torch.Tensor, suffix: str)
src/sharp/utils/gsplat.py:35
↓ 3 callers
Function
colorize_scalar_map
Colorize a scalar map of. Args: scalar_map: Map of with format BHW. val_min: Minimu value to display. val_max: Maximum va
src/sharp/utils/vis.py:44
↓ 3 callers
Function
eyes
Create batch of identity matrices.
src/sharp/utils/linalg.py:74
↓ 3 callers
Method
reshape_feature
Discard class token and reshape 1D feature map to a 2D grid.
src/sharp/models/encoders/vit_encoder.py:46
↓ 2 callers
Method
__init__
Initialize MeanStdNormalizer.
src/sharp/models/normalizers.py:21
↓ 2 callers
Method
_create_head
(self, dim_decoder: int, dim_out: int)
src/sharp/models/gaussian_decoder.py:197
↓ 2 callers
Method
_residual_block
Create a residual block.
src/sharp/models/blocks.py:187
↓ 2 callers
Function
clamp_with_pushback
Variant of clamp function which avoid the vanishing gradient problem. This function is equivalent to adding a regularizer of the form pu
src/sharp/utils/math.py:146
↓ 2 callers
Function
create_vit
Factory function for creating a ViT model.
src/sharp/models/encoders/vit_encoder.py:94
↓ 2 callers
Method
forward
Combine predicted delta values with base gaussian values and apply activation function. Args: delta: The delta values predicted b
src/sharp/models/composer.py:92
↓ 2 callers
Function
normalize
(clamp_range: SoftClampRange)
src/sharp/utils/math.py:93
↓ 2 callers
Function
render_gaussians
Render a single gaussian checkpoint file.
src/sharp/cli/render.py:70
↓ 2 callers
Function
robust_where
Robust torch.where function to avoid NaN in backward pass. See https://github.com/pytorch/pytorch/issues/68425 Args: condition: When
src/sharp/utils/robust.py:14
↓ 1 callers
Method
__init__
Initialize ResidualBlock.
src/sharp/models/blocks.py:60
↓ 1 callers
Method
__init__
Initialize DepthAlignmentWrapper. Args: scale_map_estimator: Module to align monodepth to ground truth depth.
src/sharp/models/predictor.py:30
↓ 1 callers
Method
__init__
Initialize MonodepthWithEncodingAdaptor. Args: monodepth_predictor: The monodepth model. return_encoder_features: Whe
src/sharp/models/monodepth.py:170
↓ 1 callers
Method
__init__
Initialize SkipConvBackbone.
src/sharp/models/gaussian_decoder.py:96
↓ 1 callers
Method
__init__
Initialize projection module.
src/sharp/models/encoders/monodepth_encoder.py:65
↓ 1 callers
Method
_color_activation
(self, base: torch.Tensor, learned_delta: torch.Tensor)
src/sharp/models/composer.py:230
↓ 1 callers
Method
_conics_to_covars2d
Convert conics to covariance matrices.
src/sharp/utils/gsplat.py:176
↓ 1 callers
Function
_create_base_scale
Create base scale for the gaussians.
src/sharp/models/initializer.py:274
↓ 1 callers
Function
_create_base_xy
Create base x and y coordinates for the gaussians in NDC space.
src/sharp/models/initializer.py:256
↓ 1 callers
Method
_create_image_encoder
Create image encoder and return based on parameters.
src/sharp/models/gaussian_decoder.py:218
↓ 1 callers
Method
_create_pyramid
Creates a 3-level image pyramid.
src/sharp/models/encoders/spn_encoder.py:192
↓ 1 callers
Method
_forward_mean
(self, base_values: GaussianBaseValues, delta: torch.Tensor)
src/sharp/models/composer.py:157
↓ 1 callers
Function
_get_scale_activation_constant
Return constants for scale activation function.
src/sharp/models/composer.py:21
↓ 1 callers
Function
_inverse_sigmoid
(tensor: torch.Tensor)
src/sharp/utils/gaussians.py:352
↓ 1 callers
Method
_mean_activation
Mean activation function. Args: base: Tensor of shape [B, 3, H, W], where first two feature dimensions (x,y) are
src/sharp/models/composer.py:186
↓ 1 callers
Method
_opacity_activation
(self, base: torch.Tensor, learned_delta: torch.Tensor)
src/sharp/models/composer.py:247
↓ 1 callers
Method
_quaternion_activation
( self, base: torch.Tensor, learned_delta: torch.Tensor )
src/sharp/models/composer.py:224
↓ 1 callers
Function
_rescale_depth
Rescale a depth image tensor. Args: depth: The depth tensor to transform. depth_min: The min depth to scale depth to. dep
src/sharp/models/initializer.py:281
↓ 1 callers
Method
_scale_activation
( self, base: torch.Tensor, learned_delta: torch.Tensor, min_scale: float,
src/sharp/models/composer.py:211
↓ 1 callers
Method
add_frame
Add a single frame to output.
src/sharp/utils/io.py:195
↓ 1 callers
Function
apply_transform
Apply an affine transformation to 3D Gaussians. Args: gaussians: The Gaussians to transform. transform: An affine transform with
src/sharp/utils/gaussians.py:101
↓ 1 callers
Function
branch_false_func
(x)
src/sharp/utils/color_space.py:49
↓ 1 callers
Function
branch_true_func
(x)
src/sharp/utils/color_space.py:46
↓ 1 callers
Method
close
Finish writing.
src/sharp/utils/io.py:211
↓ 1 callers
Function
colorize_depth
Colorize depth map.
src/sharp/utils/vis.py:16
↓ 1 callers
Function
compose_covariance_matrices
Compose 3D covariance matrices into quaternions and singular values. Args: quaternions: The quaternions describing the principal basis.
src/sharp/utils/gaussians.py:172
↓ 1 callers
Method
compose_with_background
Compose rendered RGB with background color.
src/sharp/utils/gsplat.py:152
↓ 1 callers
Method
compute
Compute camera for eye position.
src/sharp/utils/camera.py:321
↓ 1 callers
Function
compute_max_offset
Compute the maximum offset for camera along X/Y/Z axis.
src/sharp/utils/camera.py:53
↓ 1 callers
Function
convert_focallength
Converts a focal length given in mm to pixels.
src/sharp/utils/io.py:97
↓ 1 callers
Function
convert_rgb_to_spherical_harmonics
Convert RGB to degree-0 spherical harmonics. Reference: https://en.wikipedia.org/wiki/Table_of_spherical_harmonics
src/sharp/utils/gaussians.py:200
↓ 1 callers
Function
convert_spherical_harmonics_to_rgb
Convert degree-0 spherical harmonics to RGB. Reference: https://en.wikipedia.org/wiki/Table_of_spherical_harmonics
src/sharp/utils/gaussians.py:190
↓ 1 callers
Function
create_alignment
Create depth alignment.
src/sharp/models/alignment.py:22
↓ 1 callers
Function
create_camera_matrix
Create camera matrix from vectors.
src/sharp/utils/camera.py:233
↓ 1 callers
Function
create_eye_trajectory_rotate
Create a rotating trajectory.
src/sharp/utils/camera.py:155
↓ 1 callers
Function
create_eye_trajectory_rotate_forward
Create a rotating trajectory.
src/sharp/utils/camera.py:179
↓ 1 callers
Function
create_eye_trajectory_shake
Create a left right shake followed by an up down shake trajectory.
src/sharp/utils/camera.py:124
↓ 1 callers
Function
create_eye_trajectory_swipe
Create a left to right swipe trajectory.
src/sharp/utils/camera.py:109
↓ 1 callers
Function
create_gaussian_decoder
Create gaussian_decoder model specified by gaussian_decoder_name.
src/sharp/models/gaussian_decoder.py:25
↓ 1 callers
Function
create_initializer
Create inpainter.
src/sharp/models/initializer.py:17
↓ 1 callers
Function
create_monodepth_adaptor
Create an adaptor that returns both disparity and features.
src/sharp/models/monodepth.py:254
↓ 1 callers
Function
create_monodepth_decoder
Create DepthDensePredictionTransformer model. Args: patch_encoder_preset: The preset patch encoder architecture in SPN. dims_deco
src/sharp/models/decoders/monodepth_decoder.py:18
↓ 1 callers
Function
create_monodepth_dpt
Creates DepthDensePredictionTransformer model. Args: params: Parameters of monodepth network. Returns: The configured monode
src/sharp/models/monodepth.py:105
↓ 1 callers
Function
create_monodepth_encoder
Creates DepthDensePredictionTransformer model. Args: patch_encoder_preset: The preset patch encoder architecture in SPN. image_en
src/sharp/models/encoders/monodepth_encoder.py:25
↓ 1 callers
Function
create_predictor
Create gaussian predictor model specified by name.
src/sharp/models/__init__.py:23
↓ 1 callers
Function
decompose_covariance_matrices
Decompose 3D covariance matrices into quaternions and singular values. Args: covariance_matrices: The covariance matrices to decompose.
src/sharp/utils/gaussians.py:134
↓ 1 callers
Function
extract_exif
Return exif information as a dictionary.
src/sharp/utils/io.py:84
↓ 1 callers
Function
get_cross_product_matrix
Generate cross product matrix for vector exterior product.
src/sharp/utils/linalg.py:62
↓ 1 callers
Method
get_feature_dims
Return dimensions of output feature maps.
src/sharp/models/monodepth.py:229
↓ 1 callers
Function
get_screen_resolution_px_from_input
Get resolution for metadata dictionary.
src/sharp/utils/camera.py:353
↓ 1 callers
Function
get_unprojection_matrix
Compute unprojection matrix to transform Gaussians to Euclidean space. Args: extrinsics: The 4x4 extrinsics matrix of the camera view.
src/sharp/utils/gaussians.py:54
↓ 1 callers
Method
internal_resolution
Internal resolution.
src/sharp/models/predictor.py:194
↓ 1 callers
Method
internal_resolution
Return the internal image size of the network.
src/sharp/models/monodepth.py:240
↓ 1 callers
Method
internal_resolution
Return the full image size of the SPN network.
src/sharp/models/encoders/spn_encoder.py:157
↓ 1 callers
Function
load_ply
Loads a ply from a file.
src/sharp/utils/gaussians.py:210
↓ 1 callers
Function
predict_image
Predict Gaussians from an image.
src/sharp/cli/predict.py:159
↓ 1 callers
Method
prepare_feature_input
Prepare the feature input to the Guassian predictor.
src/sharp/models/initializer.py:116
↓ 1 callers
Method
replicate_head
Replicate the last convolution layer (head[4] in DPT) for multi layer depth.
src/sharp/models/monodepth.py:244
↓ 1 callers
Function
sRGB2linearRGB
SRGB to linearRGB conversion function. Reference: https://developer.apple.com/metal/Metal-Shading-Language-Specification.pdf Section 7.7.
src/sharp/utils/color_space.py:31
↓ 1 callers
Function
save_ply
Save a predicted Gaussian3D to a ply file.
src/sharp/utils/gaussians.py:347
↓ 1 callers
Method
set_grad_checkpointing
Enable grad checkpointing.
src/sharp/models/monodepth.py:86
↓ 1 callers
Method
set_requires_grad_
Set requires grad for separate components.
src/sharp/models/encoders/spn_encoder.py:169
↓ 1 callers
Function
unproject_gaussians
Unproject Gaussians from NDC space to world coordinates.
src/sharp/utils/gaussians.py:89
↓ 1 callers
Method
upsample_delta_value
Upsample the delta value. Args: delta: The delta values predicted by gaussian predictor. scale_factor: The scale fact
src/sharp/models/composer.py:70
↓ 1 callers
Function
upsampling_layer
Create upsampling layer.
src/sharp/models/blocks.py:32
↓ 1 callers
Function
write_image
Write image to binary stream.
src/sharp/utils/io.py:127
Method
__init__
Initialize VideoWriter.
src/sharp/utils/io.py:185
Method
__init__
Initialize gsplat renderer. Args: color_space: The color space to use for rendering. background_color: The background
src/sharp/utils/gsplat.py:54
Method
__init__
Initialize GeneralPinholeCameraModel. Args: scene: The scene to display. screen_extrinsics: Extrinsics of the default
src/sharp/utils/camera.py:274
Method
__init__
Initialize feature fusion block. Args: dim_in: Dimensions of input. dim_out: Dimensions of output. batch_
src/sharp/models/blocks.py:134
Method
__init__
Initialize RGBGaussianPredictor. Args: init_model: A model mapping image and depth to base values. monodepth_model: T
src/sharp/models/predictor.py:69
Method
__init__
Initialize AffineRangeNormalizer.
src/sharp/models/normalizers.py:47
Method
__init__
Initialize MobileNetNormalizer.
src/sharp/models/normalizers.py:78
Method
__init__
Initialize MultilayerInitializer. Args: stride: The downsample rate of output feature map. base_depth: The depth of t
src/sharp/models/initializer.py:75
Method
__init__
Initialize Dense Prediction Transformer. Args: encoder: The SlidingPyramidTransformer backbone. decoder: The Multires
src/sharp/models/monodepth.py:36
Method
__init__
Initialize Dense Prediction Transformer for Gaussian. Args: decoder: Decoder to decode features. monodepth_decoder: O
src/sharp/models/gaussian_decoder.py:133
Method
__init__
Initialize DirectGaussianPredictor. Args: feature_dim: Number of input features. num_layers: The number of layers of
src/sharp/models/heads.py:18
Method
__init__
Initialize GaussianComposer. Args: delta_factor: Multiply delta offsets by this factor. min_scale: The minimal scale
src/sharp/models/composer.py:37
next →
1–100 of 179, ranked by callers