NVFP4 quantized variant of
facebook/sam3.1.
Quantizes the detector backbone's vision trunk while keeping the language backbone in FP32.
This is currently a storage-size quantization: the NomNomLabel loader dequantizes
weights into the official SAM3 image model before execution; native packed-FP4
execution remains future work.
Validated against source SAM 3.1 on mukbang / food video frames with Sapiens-2 human-part exclusion masking:
Some NVFP4 masks are visually sharper than the source FP32 output due to quantization-induced de-noising.
1# Load the quantized model using the nomnomlabel loader
2from nomnomlabel.quant_loader import load_sam3_nvfp4
3
4model = load_sam3_nvfp4("Reza2kn/sam3.1-nvfp4-detector-no-language")
5
6# Segment food (with language prompt)
7from nomnomlabel.sam3_food_classifier import SAM3FoodClassifier
8
9classifier = SAM3FoodClassifier(model_id="Reza2kn/sam3.1-nvfp4-detector-no-language")
10segments = classifier.segment_and_classify_food(image, conf_threshold=0.35)
11
12for seg in segments:
13 print(f"Food: {seg.food_type} (conf={seg.food_conf:.2f})")
14 print(f" Mask area: {seg.area} pixels")
15 print(f" BBox: {seg.bbox}")