From 6b653a537f7b45ddb28abcfd08a63b2f8ce741e8 Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Bannier Date: Wed, 16 Sep 2026 21:08:10 +0200 Subject: [PATCH] chore: remove unused sam3_bbox_mlp, sam3_params::seed, SAM3_VISUAL enum - sam3_bbox_mlp: static, never called. - sam3_params::seed: never read. - SAM3_MODEL_SAM3_VISUAL: never assigned, so sam3_get_model_type can't return it. Visual-only SAM3 still reports SAM3_MODEL_SAM3 + sam3_is_visual_only(). Remaining enum values keep their numbers. sam3_state_set_orig_dims is kept: tests/test_sam2_pvs_compare.cpp calls it through an extern declaration. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq --- sam3.cpp | 13 ------------- sam3.h | 2 -- 2 files changed, 15 deletions(-) diff --git a/sam3.cpp b/sam3.cpp index 8adc8b2..9b90bf4 100644 --- a/sam3.cpp +++ b/sam3.cpp @@ -8111,19 +8111,6 @@ static struct ggml_tensor* sam3_inverse_sigmoid(struct ggml_context* ctx, struct return ggml_sub(ctx, log_x, log_1mx); } -// Box refinement MLP (3 layers: D→D→D→4 with ReLU) -static struct ggml_tensor* sam3_bbox_mlp(struct ggml_context* ctx, - struct ggml_tensor* x, - struct ggml_tensor* w[3], - struct ggml_tensor* b[3]) { - for (int j = 0; j < 3; ++j) { - x = ggml_mul_mat(ctx, w[j], x); - x = ggml_add(ctx, x, b[j]); - if (j < 2) x = ggml_relu(ctx, x); - } - return x; -} - // Build sinusoidal positional embedding for 4D reference points in the ggml graph. // ref_boxes: [4, NQ, B] — (cx, cy, w, h) after sigmoid, B=1 // sine_dim_t: [1, 64] — pre-computed angle multipliers (2π / 10000^(2i/128)) diff --git a/sam3.h b/sam3.h index 204e487..4473b8e 100644 --- a/sam3.h +++ b/sam3.h @@ -35,7 +35,6 @@ using sam3_tracker_ptr = std::unique_ptr; enum sam3_model_type { SAM3_MODEL_SAM3 = 0, // Full SAM3 (ViT + detector + tracker) - SAM3_MODEL_SAM3_VISUAL = 1, // SAM3 visual-only (ViT + tracker, no text) SAM3_MODEL_SAM2 = 2, // SAM2 (Hiera + tracker, no text/detector) SAM3_MODEL_EDGETAM = 3, // EdgeTAM (RepViT + Perceiver, no text/detector) }; @@ -97,7 +96,6 @@ struct sam3_params { std::string model_path; int n_threads = 4; bool use_gpu = true; - int seed = 42; int encode_img_size = 0; // 0 = model default; override input resolution };