SAM3 面具示例: 在论文中声称,在发布版本中无法使用
作者: marcolomele创建于 2026年7月5日更新于 2026年8月17日
1. Config never instantiates the mask encoder model_builder.py:_create_geometry_encoder() (L235–288) is the only geometry-encoder builder (used at both L616 and L688). It constructs SequenceGeometryEncoder with points and boxes projections only: input_geometry_encoder = SequenceGeometryEncoder( ... points_direct_project=True, points_pool=True, points_pos_enc=True, boxes_direct_project=True, boxes_pool=True, boxes_pos_enc=True, ... ) # no mask_encoder=, no add_mask_label= mask_encoder and add_mask_label therefore fall to their defaults None / False (geometry_encoders.py:507-508). In any instantiated model self.mask_encoder is None, so the mask branches at geometry_encoders.py:800 and :834 are skipped, and Prompt.append_masks (:366) feeds nothing downstream. ### 2. The checkpoint has no mask-encoder weights Dumping sam3.pt (1465 params), detector.geometry_encoder.* contains only: - points_* (direct_project, pool_project, pos_enc_project) - boxes_* (direct_project, pool_project, pos_enc_project) - cls_embed, label_embed, encode.{0,1,2}.*, encode_norm, final_proj, norm, img_pre_norm There is no detector.geometry_encoder.mask_encoder.* and no mask_label_embed. The only mask_downsampler anywhere in the checkpoint is tracker.maskmem_backbone.mask_downsampler.* — the SAM2-lineage video-memory encoder, a different module on the tracker, not the detector. exemplar and visual_prompt appear zero times in the weights. Consequence: even if you wired a FusedMaskEncoder into the config, it would be randomly initialized. The capability cannot be recovered from the released weights without training. ### 3. The public API has no mask entry point Sam3Processor (sam3_image_processor.py) exposes only: - set_text_prompt (L113) - add_geometric_prompt (L128–150) — box-only, via append_boxes There is no method to add a mask exemplar, despite Prompt.append_masks (geometry_encoders.py:366) and _encode_masks (:683) being fully …
内容来源: facebookresearch/sam3