MCPcopy Create free account

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

Functions893 in github.com/PABannier/sam3.cpp

↓ 2 callersFunctionposition_encode
(coords_norm: torch.Tensor, pe_gaussian: torch.Tensor)
tests/dump_phase6_reference.py:150
↓ 2 callersFunctionprint_result
tests/test_debug_encoder.cpp:54
↓ 2 callersFunctionprint_table
tests/test_metal_python_ref_compare.cpp:445
↓ 2 callersFunctionrename_key
Map a PyTorch state_dict key to the flat ggml name. Returns None if the tensor should be skipped.
convert_sam3_to_ggml.py:84
↓ 2 callersFunctionrepvgg_reparameterize
Fuse RepVGG 3-way parallel branches + optional final BN into single DW 3×3. Branches: 1. DW Conv 3×3 + BN (prefix.conv.c.weight + prefix.c
convert_edgetam_to_ggml.py:125
↓ 2 callersFunctionrun_backend
tests/test_metal_python_ref_compare.cpp:316
↓ 2 callersFunctionrun_backend
tests/test_metal_encoder_checkpoints.cpp:41
↓ 2 callersFunctionrun_backend
tests/test_metal_vit_upstream_compare.cpp:199
↓ 2 callersFunctionrun_bench
tests/test_metal_profile.cpp:22
↓ 2 callersFunctionrun_block0_input_or_die
tests/test_metal_block0_stage_compare.cpp:111
↓ 2 callersFunctionrun_block0_input_or_die
tests/test_metal_vit_prefix_compare.cpp:62
↓ 2 callersFunctionrun_case
tests/test_metal_conv_transpose_2d.cpp:132
↓ 2 callersFunctionrun_encoder_backend
tests/test_metal_flash_attn_ext_block15_compare.cpp:97
↓ 2 callersFunctionrun_isolated_norm
tests/test_metal_vit_upstream_compare.cpp:134
↓ 2 callersFunctionrun_isolated_qkv_prep
tests/test_metal_flash_attn_ext_block15_compare.cpp:279
↓ 2 callersFunctionrun_selective_vit
tests/test_metal_block0_stage_compare.cpp:55
↓ 2 callersFunctionrun_selective_vit
tests/test_metal_block_stage_compare.cpp:61
↓ 2 callersFunctionrun_single_benchmark
examples/benchmark.cpp:198
↓ 2 callersFunctionrun_vit
Run ViT forward pass. If use_f16_weights, quantize all 2D weights to f16.
tests/check_f16_weight_error.py:105
↓ 2 callersFunctionsam2_build_fpn_neck_graph
Build FPN neck graph for SAM2. Input: 4 stage outputs from Hiera backbone Output: 3 FPN levels (after scalp=1) in fpn_outs[] as [D, W, H, 1]
sam3.cpp:4536
↓ 2 callersFunctionsam2_build_hiera_graph
Build full Hiera backbone graph. Input: [img_size, img_size, 3, 1] preprocessed image Output: 4 stage outputs in stage_outs[] as [stage_dim, W, H, 1]
sam3.cpp:4466
↓ 2 callersFunctionsam2_compute_pos_embed
Compute Hiera positional embedding on CPU. Returns [E, H, W] in ggml column-major layout: element (e, x, y) at flat index e + x*E + y*E*W. PE = bicubi
sam3.cpp:4118
↓ 2 callersFunctionsam3_build_geom_enc_graph
sam3.cpp:7677
↓ 2 callersFunctionsam3_build_mem_attn_graph
Build memory attention graph. curr_tokens: [D, N, 1] — current frame image tokens (flattened from 72x72 = 5184) src_pos: [D, N, 1] — sinusoidal PE
sam3.cpp:9228
↓ 2 callersFunctionsam3_build_prompt_and_pos
Build prompt and prompt_pos tensors CPU-side for memory attention. mem_slot_feats[i]: [MD * H * H] raw spatial features (ggml layout) mem_slot_pes[i]:
sam3.cpp:9127
↓ 2 callersFunctionsam3_build_sam_pe
sam3.cpp:10407
↓ 2 callersFunctionsam3_build_vit_prefix_graph
Build the full ViT graph. Input: [img_size, img_size, 3, 1] (ggml convention: [W, H, C, B]) Output: [E, W, H, 1] where E=1024, W=H=72
sam3.cpp:3810
↓ 2 callersFunctionsam3_collect_pvs_prompt_tokens
Match the official image predictor prompt ordering: box corners (if any) → user points → trailing padding point. Even when a box is present, SAM keeps
sam3.cpp:10365
↓ 2 callersFunctionsam3_cxblock_forward
CXBlock: depthwise conv + LayerNorm + pointwise MLP with residual scaling.
sam3.cpp:9066
↓ 2 callersFunctionsam3_dump_raw_f32_to_path
sam3.cpp:12526
↓ 2 callersFunctionsam3_fill_holes
Fill small holes in a binary mask using BFS connected components.
sam3.cpp:9469
↓ 2 callersFunctionsam3_fill_tensor_info
sam3.cpp:14382
↓ 2 callersFunctionsam3_find_state_tensor
sam3.cpp:14338
↓ 2 callersFunctionsam3_get_state_tensor_info
sam3.cpp:14397
↓ 2 callersFunctionsam3_load_bpe_vocab_from_stream
sam3.cpp:1188
↓ 2 callersFunctionsam3_load_hparams
sam3.cpp:1481
↓ 2 callersFunctionsam3_merge_key
Unit separator (0x1F) cannot appear in byte-encoded BPE tokens.
sam3.cpp:1175
↓ 2 callersFunctionsam3_new_f32_tensor_4d_from_ne
sam3.cpp:6686
↓ 2 callersFunctionsam3_precompute_geom_input
Pre-compute geometry encoder input on CPU: box embeddings + CLS token. Reads model weights from GPU, computes embeddings, returns float vector. Layout
sam3.cpp:7803
↓ 2 callersFunctionsam3_refine_instance
sam3.cpp:11973
↓ 2 callersFunctionsam3_remove_sprinkles
Remove small foreground sprinkles.
sam3.cpp:9511
↓ 2 callersFunctionsam3_resize_bilinear
Bilinear resize of a [H, W, 3] uint8 image to [dst_h, dst_w, 3].
sam3.cpp:3445
↓ 2 callersFunctionsam3_resolve_overlaps
Resolve overlapping masks: higher-scoring instances take priority.
sam3.cpp:9550
↓ 2 callersFunctionsam3_test_dump_phase6_impl
sam3.cpp:13493
↓ 2 callersFunctionsam3_test_run_patch_mulmat_host_ref
sam3.cpp:6516
↓ 2 callersFunctionsam3_test_run_vit_block0_input
sam3.cpp:6342
↓ 2 callersFunctionsam3_test_run_vit_block_linear_host_ref
sam3.cpp:6580
↓ 2 callersFunctionsam3_test_run_vit_block_stage
sam3.cpp:6878
↓ 2 callersFunctionsam3_tokenize
Tokenize text into a fixed-length token ID vector [ctx_len]. Format: [SOT, bpe_tokens..., EOT, 0, 0, ..., 0]
sam3.cpp:1407
↓ 2 callersFunctionsam3_tracker_frame_index
sam3.cpp:12090
↓ 2 callersFunctionsam3_update_tracker
sam3.cpp:11488
↓ 2 callersFunctionsam3_utf8_len
sam3.cpp:1100
↓ 2 callersFunctionsave_ggml_2d_batch_first
(path: str, x: torch.Tensor)
tests/dump_phase4_reference.py:68
↓ 2 callersFunctionsave_ggml_2d_seq_first
(path: str, x: torch.Tensor)
tests/dump_phase4_reference.py:73
↓ 2 callersFunctionsave_ggml_whcb_from_nchw
(path: str, x_nchw: torch.Tensor)
tests/dump_phase6_reference.py:78
↓ 2 callersFunctionsinusoidal_pe
(h: int, w: int, d_model: int)
tests/dump_phase7_reference.py:154
↓ 2 callersFunctionstbi__addints_valid
returns 1 if the sum of two signed ints is valid (between -2^31 and 2^31-1 inclusive), 0 on overflow.
stb/stb_image.h:1070
↓ 2 callersFunctionstbi__bit_reverse
stb/stb_image.h:4116
↓ 2 callersFunctionstbi__bmp_parse_header
stb/stb_image.h:5448
↓ 2 callersFunctionstbi__bmp_set_mask_defaults
stb/stb_image.h:5422
↓ 2 callersFunctionstbi__build_huffman
stb/stb_image.h:2003
↓ 2 callersFunctionstbi__check_png_header
stb/stb_image.h:4621
↓ 2 callersFunctionstbi__copyval
stb/stb_image.h:6381
↓ 2 callersFunctionstbi__create_png_alpha_expand8
adds an extra all-255 alpha channel dest == src is legal img_n must be 1 or 3
stb/stb_image.h:4675
↓ 2 callersFunctionstbi__create_png_image_raw
create the png data from post-deflated data
stb/stb_image.h:4696
↓ 2 callersFunctionstbi__fill_bits
stb/stb_image.h:4202
↓ 2 callersFunctionstbi__gif_header
stb/stb_image.h:6608
↓ 2 callersFunctionstbi__gif_load_next
this function is designed to support animated gifs, although stb_image doesn't support it two back is the image from two frames ago, used for a very s
stb/stb_image.h:6778
↓ 2 callersFunctionstbi__gif_parse_colortable
stb/stb_image.h:6597
↓ 2 callersFunctionstbi__gif_test
stb/stb_image.h:6590
↓ 2 callersFunctionstbi__hdr_load
stb/stb_image.h:7158
↓ 2 callersFunctionstbi__hdr_test_core
stb/stb_image.h:7087
↓ 2 callersFunctionstbi__jpeg_decode_block
decode one 64-entry block--
stb/stb_image.h:2210
↓ 2 callersFunctionstbi__jpeg_decode_block_prog_dc
stb/stb_image.h:2265
↓ 2 callersFunctionstbi__jpeg_get_bits
get some unsigned bits
stb/stb_image.h:2169
↓ 2 callersFunctionstbi__load_main
stb/stb_image.h:1137
↓ 2 callersFunctionstbi__mad2sizes_valid
returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow
stb/stb_image.h:1024
↓ 2 callersFunctionstbi__mul2shorts_valid
returns 1 if the product of two ints fits in a signed short, 0 on overflow.
stb/stb_image.h:1078
↓ 2 callersFunctionstbi__parse_png_file
stb/stb_image.h:5078
↓ 2 callersFunctionstbi__png_info_raw
stb/stb_image.h:5310
↓ 2 callersFunctionstbi__process_marker
stb/stb_image.h:3099
↓ 2 callersFunctionstbi__refill_buffer
stb/stb_image.h:1597
↓ 2 callersFunctionstbi__setup_jpeg
set up the kernels
stb/stb_image.h:3821
↓ 2 callersFunctionstbi__tga_read_rgb16
read 16bit value and convert to 24bit RGB
stb/stb_image.h:5852
↓ 2 callersFunctionstbi_write_bmp_core
stb/stb_image_write.h:492
↓ 2 callersFunctionstbi_write_hdr_core
stb/stb_image_write.h:761
↓ 2 callersFunctionstbi_write_jpg_core
stb/stb_image_write.h:1398
↓ 2 callersFunctionstbi_write_png_to_mem
stb/stb_image_write.h:1128
↓ 2 callersFunctionstbi_write_tga_core
stb/stb_image_write.h:532
↓ 2 callersFunctionstbiw__fopen
stb/stb_image_write.h:304
↓ 2 callersFunctionstbiw__jpg_DCT
stb/stb_image_write.h:1270
↓ 2 callersFunctionstbiw__jpg_calcBits
stb/stb_image_write.h:1318
↓ 2 callersFunctionstbiw__linear_to_rgbe
stb/stb_image_write.h:639
↓ 2 callersFunctionstbiw__writefv
stb/stb_image_write.h:349
↓ 2 callersFunctionstbiw__zhash
stb/stb_image_write.h:867
↓ 2 callersFunctionstbiw__zlib_countm
stb/stb_image_write.h:859
↓ 2 callersFunctionstrip_extension
examples/benchmark.cpp:99
↓ 2 callersFunctiontensor_cases
tests/test_phase6.cpp:112
↓ 2 callersFunctiontolerance_for
tests/test_phase5.cpp:90
↓ 2 callersFunctiontrim_shape
tests/test_metal_block_stage_compare.cpp:27
← previousnext →301–400 of 893, ranked by callers