Views
No views yet
1from sam3.model_builder import build_sam3_image_model
2from lora_layers import LoRAConfig, apply_lora_to_model, load_lora_weights
3from huggingface_hub import hf_hub_download
4
5# Build base model
6model = build_sam3_image_model(device='cuda', load_from_HF=True)
7
8# Apply LoRA structure
9lora_config = LoRAConfig(rank=16, alpha=32, dropout=0.0)
10model = apply_lora_to_model(model, lora_config)
11
12# Download and load weights
13weights_path = hf_hub_download(repo_id="YOUR_USERNAME/SAM3_carton_detection", filename="lora_weights.pt")
14load_lora_weights(model, weights_path)
15
16model.eval()
17## Training Details
18Rank: 16
19Alpha: 32
20Task: Instance segmentation of cartons