MCPcopy Create free account

hub / github.com/PABannier/sam3.cpp / functions

Functions893 in github.com/PABannier/sam3.cpp

↓ 2 callersFunctionupload_texture
examples/main_image.cpp:160
↓ 2 callersMethodvit_head_dim
5184
sam3.cpp:181
↓ 1 callersFunction_install_triton_mock
Install a mock triton package so SAM3 and torch._dynamo can import.
tests/dump_fenc_from_package.py:21
↓ 1 callersFunctionapply_rotary_enc
(xq, xk, freqs_cis, repeat_freqs_k=False)
tests/dump_phase3_reference.py:66
↓ 1 callersFunctionapply_rotary_enc
(xq, xk, freqs_cis)
tests/check_f16_weight_error.py:85
↓ 1 callersFunctionapply_rotary_enc
(xq, xk, freqs_cis, repeat_freqs_k=False)
tests/dump_vit_reference.py:50
↓ 1 callersFunctionapply_rotary_enc
(xq: torch.Tensor, xk: torch.Tensor, freqs_cis: torch.Tensor, repeat_freqs_k: bool = False)
tests/dump_phase7_reference.py:205
↓ 1 callersFunctionapply_theme
examples/main_image.cpp:47
↓ 1 callersFunctionapply_theme
examples/main_video.cpp:45
↓ 1 callersFunctionbox_cxcywh_to_xyxy
(x)
tests/dump_phase5_reference.py:80
↓ 1 callersFunctionbox_cxcywh_to_xyxy
Convert CxCyWH to XYXY format.
tests/dump_geom_encoder_reference.py:116
↓ 1 callersFunctionbox_cxcywh_to_xyxy
(x)
tests/dump_ddec_from_package.py:73
↓ 1 callersMethodbpe
(self, token)
scripts/verify_tokenizer.py:77
↓ 1 callersFunctionbuild_cases
tests/test_debug_fenc.cpp:15
↓ 1 callersFunctionbuild_frame_overlay
examples/main_video.cpp:173
↓ 1 callersFunctionbuild_no_point_prompt_encoder_outputs
(prompt_weights: Dict[str, torch.Tensor])
tests/dump_phase7_reference.py:271
↓ 1 callersFunctionbuild_point_inputs
(case: PromptCase)
tests/dump_phase6_reference.py:130
↓ 1 callersFunctionbuild_prompt_and_pos
( tracker_weights: Dict[str, torch.Tensor], mem_outputs: List[dict[str, torch.Tensor]], obj_ptrs:
tests/dump_phase7_reference.py:592
↓ 1 callersFunctionbuild_prompt_encoder_outputs
(weights: Dict[str, torch.Tensor], case: PromptCase)
tests/dump_phase6_reference.py:157
↓ 1 callersFunctionbytes_to_unicode
()
scripts/verify_tokenizer.py:21
↓ 1 callersFunctioncategory_for_tensor
tests/test_phase4.cpp:54
↓ 1 callersFunctionchild_benchmark
POSIX: fork a subprocess for crash isolation
examples/benchmark.cpp:302
↓ 1 callersFunctioncompare
(name, ref, cpp, atol=1e-3)
tests/compare_sam2_video.py:25
↓ 1 callersFunctioncompare
(name, ref_path, cpp_path, atol=1e-4)
tests/compare_tensors.py:15
↓ 1 callersFunctioncompare
(name, ref_path, cpp_path)
tests/compare_mask_decoder.py:50
↓ 1 callersFunctioncompare
Compare flat arrays, handling NCHW vs ggml [C, W, H] transposition.
tests/test_full_pipeline.py:17
↓ 1 callersFunctioncompare_dump_direct
tests/test_metal_python_ref_compare.cpp:296
↓ 1 callersFunctioncompare_ggml_vs_nchw
Compare C++ ggml tensor (dumped as [C, W, H]) vs Python NCHW [1, C, H, W] ggml stores: flat[c + w*C + h*C*W] Python NCHW: flat[c*H*W + h*W + w] These
tests/test_debug_encoder.cpp:34
↓ 1 callersFunctioncompare_ggml_vs_nhwc
Compare C++ ggml tensor (dumped as [ne0, ne1, ne2]) vs Python NHWC [1, H, W, E] ggml stores: flat[e + w*E + h*E*W] where ne0=E, ne1=W, ne2=H Python NH
tests/test_debug_encoder.cpp:24
↓ 1 callersFunctioncompare_state_nhwc
tests/test_metal_python_ref_compare.cpp:202
↓ 1 callersFunctioncompare_variant
Compare Python and C++ results for one variant.
tests/test_sam2_e2e_all_variants.py:160
↓ 1 callersFunctioncompute_axial_cis
(dim, end_x, end_y, theta=10000.0, scale_pos=1.0, offset=0, device=None)
tests/dump_phase7_reference.py:189
↓ 1 callersFunctioncompute_sine_pe
Sinusoidal PE matching SAM3's PositionEmbeddingSine.
tests/dump_phase5_reference.py:298
↓ 1 callersFunctioncompute_sine_pe
Sinusoidal PE matching SAM3's PositionEmbeddingSine.
tests/dump_geom_encoder_reference.py:412
↓ 1 callersFunctionconvert_repvit_backbone
Convert RepViT backbone tensors with BN fusion and RepVGG reparameterization. Returns dict of {ggml_name: numpy_array}.
convert_edgetam_to_ggml.py:192
↓ 1 callersFunctioncpp_preprocess
Replicate C++ sam3_preprocess_image exactly. C++ does: 1. Bilinear resize to img_size x img_size (half-pixel center mapping) 2. Quantize
tests/compare_preprocessing.py:14
↓ 1 callersFunctioncreate_backend
tests/test_metal_conv_transpose_2d.cpp:114
↓ 1 callersFunctioncreate_backend
tests/test_metal_conv_transpose_2d_stress.cpp:86
↓ 1 callersFunctiondefault_specs_for_block
tests/test_metal_vit_upstream_compare.cpp:245
↓ 1 callersFunctiondetect_variant_from_checkpoint
Auto-detect SAM2 variant from checkpoint tensor shapes.
convert_sam2_to_ggml.py:323
↓ 1 callersFunctiondiscover_models
examples/benchmark.cpp:136
↓ 1 callersFunctiondo_roi_align
ROI Align from image features using box coordinates in CxCyWH [0,1] format. Args: img_feats_nchw: [B, C, H, W] backbone feature map
tests/dump_geom_encoder_reference.py:128
↓ 1 callersFunctiondraw_busy_overlay
Draw a spinning indicator + message as a centered overlay
examples/main_image.cpp:321
↓ 1 callersFunctiondump_backbone
Stage 1: Dump Hiera backbone outputs.
tests/dump_sam2_reference.py:67
↓ 1 callersFunctiondump_case
(case: PromptCase, prompt_weights: Dict[str, torch.Tensor], mask_weights: Dict[str
tests/dump_phase6_reference.py:256
↓ 1 callersFunctiondump_checkpoints
tests/test_metal_encoder_checkpoints.cpp:28
↓ 1 callersFunctiondump_fpn_neck
Stage 2: Dump FPN neck outputs (backbone + neck together).
tests/dump_sam2_reference.py:93
↓ 1 callersFunctiondump_image_features
Stage 3: Dump prepared image features (what set_image produces).
tests/dump_sam2_reference.py:118
↓ 1 callersFunctiondump_named_tensors
tests/test_metal_vit_upstream_compare.cpp:54
↓ 1 callersFunctiondump_named_tensors
tests/test_metal_block0_stage_compare.cpp:43
↓ 1 callersFunctiondump_named_tensors
tests/test_metal_flash_attn_ext_block15_compare.cpp:77
↓ 1 callersFunctiondump_named_tensors
tests/test_metal_block_stage_compare.cpp:49
↓ 1 callersFunctiondump_pvs_inference
Stage 4-5: Dump prompt encoding + mask decoding.
tests/dump_sam2_reference.py:140
↓ 1 callersFunctiondump_reference_mismatch
tests/test_metal_conv_transpose_2d.cpp:206
↓ 1 callersFunctiondump_tensor_f32
tests/test_sam2_video_debug.cpp:23
↓ 1 callersFunctionedgetam_encode_image
Full EdgeTAM image encoding: preprocess → RepViT → FPN → state
sam3.cpp:4833
↓ 1 callersMethodedgetam_feat_size
sam3.cpp:193
↓ 1 callersFunctionedgetam_load_extra_hparams
sam3.cpp:1548
↓ 1 callersFunctionedgetam_make_divisible
Helper: make_divisible(v, divisor) — rounds v up to nearest multiple of divisor
sam3.cpp:2066
↓ 1 callersFunctionedgetam_perceiver_forward
sam3.cpp:5606
↓ 1 callersFunctionedgetam_print_hparams
sam3.cpp:1632
↓ 1 callersFunctionedgetam_register_tensors
sam3.cpp:2073
↓ 1 callersFunctionedgetam_window_partition_cpu
CPU-side window partition: rearrange [D, H*W] features into [256, 16, D] (256 windows of 4x4=16 tokens each, assuming H=W=64 and window_size=4). Input
sam3.cpp:5546
↓ 1 callersFunctionexport_frame_masks
examples/main_video.cpp:346
↓ 1 callersFunctionexport_masks
examples/main_image.cpp:301
↓ 1 callersFunctionfill_input_data
tests/test_metal_conv_transpose_2d.cpp:100
↓ 1 callersFunctionfill_weight_data
tests/test_metal_conv_transpose_2d.cpp:106
↓ 1 callersFunctionformat_shape
tests/test_metal_encoder_checkpoints.cpp:16
↓ 1 callersFunctionformat_shape
tests/test_metal_vit_prefix_compare.cpp:9
↓ 1 callersFunctionfused_mha_forward
(query, key, value, in_proj_w, in_proj_b, out_w, out_b, num_heads, attn_mask=None, key_p
tests/dump_ddec_from_package.py:115
↓ 1 callersFunctiongen_sineembed_for_position
Generate sinusoidal positional embedding for 2D/4D reference points.
tests/dump_phase5_reference.py:52
↓ 1 callersFunctiongen_sineembed_for_position
(pos_tensor, num_feats=256)
tests/dump_ddec_from_package.py:46
↓ 1 callersFunctionget_1d_sine_pe
(pos_inds: torch.Tensor, dim: int, temperature: float = 10000.0)
tests/dump_phase7_reference.py:174
↓ 1 callersFunctionget_abs_pos
(abs_pos, has_cls_token, hw, tiling=False)
tests/dump_phase3_reference.py:103
↓ 1 callersFunctionget_abs_pos
(abs_pos, has_cls_token, hw, tiling=False)
tests/check_f16_weight_error.py:70
↓ 1 callersFunctionggml_dump_to_nhwc_flat
tests/test_metal_python_ref_compare.cpp:84
↓ 1 callersFunctionggml_to_pytorch_bchw
Convert ggml [E, W, H] flat data to PyTorch [1, C, H, W] array. ggml element (e, w, h) at flat index e + w*E + h*E*W maps to PyTorch [0, e, h,
tests/compare_vit_output.py:22
↓ 1 callersFunctionggml_type_name_public
tests/test_metal_flash_attn_ext_block15_compare.cpp:67
↓ 1 callersMethodhiera_feat_size
sam3.cpp:204
↓ 1 callersMethodhiera_stage_dim
sam3.cpp:212
↓ 1 callersFunctioninit_t_xy
(end_x, end_y, scale=1.0, offset=0)
tests/dump_phase3_reference.py:42
↓ 1 callersFunctioninit_t_xy
(end_x, end_y, scale=1.0, offset=0)
tests/dump_vit_reference.py:26
↓ 1 callersFunctioninit_t_xy
(end_x, end_y, scale=1.0, offset=0, device=None)
tests/dump_phase7_reference.py:182
↓ 1 callersFunctioninstall_backbone_hook
Capture backbone FPN features after set_image.
tests/dump_fenc_from_package.py:278
↓ 1 callersFunctioninstall_encoder_patch
Monkey-patch TransformerEncoder.forward (the base class used by TransformerEncoderFusion) to dump inputs and per-layer outputs. Transfor
tests/dump_fenc_from_package.py:151
↓ 1 callersFunctioninstall_prompt_hook
Hook into _encode_prompt to capture the assembled prompt (text + geo + visual).
tests/dump_fenc_from_package.py:261
↓ 1 callersFunctioninstall_text_encoder_hook
Hook into the text encoder output to capture text features and token info. We intercept backbone.forward_text by wrapping it.
tests/dump_fenc_from_package.py:241
↓ 1 callersFunctioninverse_sigmoid
(x, eps=1e-3)
tests/dump_phase5_reference.py:45
↓ 1 callersFunctioninverse_sigmoid
(x, eps=1e-3)
tests/dump_ddec_from_package.py:39
↓ 1 callersFunctionis_global_block
tests/test_metal_block_stage_compare.cpp:220
↓ 1 callersMethodis_hiera_global_attn
sam3.cpp:240
↓ 1 callersFunctionlabel_for_category
tests/test_phase4.cpp:74
↓ 1 callersFunctionlayer_norm_2d
(x: torch.Tensor, weight: torch.Tensor, bias: torch.Tensor, eps: float = 1e-6)
tests/dump_phase6_reference.py:249
↓ 1 callersFunctionlist_keys
Quick utility: python convert_sam3_to_ggml.py --list --model sam3.pt
convert_sam3_to_ggml.py:411
↓ 1 callersFunctionload_block_norm_params
tests/test_metal_vit_upstream_compare.cpp:103
↓ 1 callersFunctionload_cases
(path: str)
tests/dump_phase6_reference.py:108
↓ 1 callersFunctionload_cases
tests/test_phase7.cpp:33
↓ 1 callersFunctionload_cases
tests/test_phase6.cpp:75
↓ 1 callersFunctionload_cases
tests/test_metal_phase6.cpp:66
↓ 1 callersFunctionload_cases
(path: str)
tests/dump_phase7_reference.py:121
← previousnext →401–500 of 893, ranked by callers