Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions sam3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 0 additions & 2 deletions sam3.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ using sam3_tracker_ptr = std::unique_ptr<sam3_tracker, sam3_tracker_deleter>;

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)
};
Expand Down Expand Up @@ -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
};

Expand Down
Loading