Views
No views yet
detective_sam_v2 checkpoint.checkpoints/sam2configs/demo/cocoglide/, demo/flux_test/, and demo/qwen_test/demo/user_image/demo_input.pngdetective_sam_v2detective_sam_v2 alias expects checkpoints/detective_sam_v2.pth and the bundled YAML sidecar.detectivesam_inference/models/adapters.py.model or ema keys.dsamv2_best6info_10ep_20260623_060047/best_model.pth. Previous Detective SAM values are measured on the same validation setup. The MagicBrush row uses the MagicBrush test split, not the higher full_magicbrush_val artifact.| Dataset | DetectiveSAMv2 | Previous Detective SAM | Delta |
|---|---|---|---|
| MagicBrush test | 48.83 / 61.01 | 43.98 / 56.46 | +4.85 / +4.55 |
| SIDA test | 54.95 / 65.24 | 50.22 / 60.49 | +4.73 / +4.76 |
| FLUX-Bench | 44.26 / 56.17 | 18.61 / 25.77 | +25.65 / +30.39 |
| QWEN-Bench | 45.40 / 56.95 | 19.62 / 27.15 | +25.78 / +29.80 |
| CoCoGLIDE | 46.63 / 58.33 | 42.79 / 53.43 | +3.84 / +4.90 |
| AutoSplice | 57.49 / 70.53 | 47.85 / 60.32 | +9.64 / +10.21 |
| NanoBanana | 33.04 / 45.97 | 25.89 / 35.74 | +7.15 / +10.23 |
| Overall | 49.55 / 61.39 | 38.77 / 49.14 | +10.78 / +12.26 |
1python -m venv .venv
2source .venv/bin/activate
3pip install -r requirements.txt1pip install -U huggingface_hub
2hf download Gertlek/DetectiveSAMv2 \
3 checkpoints/detective_sam_v2.pth \
4 sam2configs/sam2.1_hiera_base_plus.pt \
5 --local-dir .checkpoints/README.md and sam2configs/README.md.1git lfs install
2git clone https://huggingface.co/Gertlek/DetectiveSAMv2
3cd DetectiveSAMv2
4python -m venv .venv
5source .venv/bin/activate
6pip install -r requirements.txt
7python -m detectivesam_inference.predict \
8 --output-dir outputs/poster_baselinedemo/user_image/demo_input.png, then run:1python -m detectivesam_inference.predict \
2 --output-dir outputs/poster_user_imagedemo/user_image/demo_input.png is absent, the default predict command falls back to the bundled CocoGlide sample banana_28809.1python -m detectivesam_inference.predict \
2 --output-dir outputs/poster_baseline1python -m detectivesam_inference.predict \
2 --checkpoint detective_sam_v2 \
3 --source demo/flux_test/source/548.png \
4 --target demo/flux_test/target/548.png \
5 --mask demo/flux_test/mask/548.png \
6 --output-dir outputs/poster_flux1python -m detectivesam_inference.predict \
2 --checkpoint detective_sam_v2 \
3 --source demo/qwen_test/source/166.png \
4 --target demo/qwen_test/target/166.png \
5 --mask demo/qwen_test/mask/166.png \
6 --output-dir outputs/poster_qwen1python -m detectivesam_inference.evaluate \
2 --checkpoint detective_sam_v2 \
3 --dataset-root demo/cocoglide \
4 --output-dir outputs/poster_eval_cocoglide \
5 --num-visualizations 2predict run writes a compact set of visual artifacts plus a JSON summary:<name>_comparison.png<name>_probability.png<name>_pred_mask.png<name>_pred_overlay.png<name>_summary.json<name>_gt_mask.png<name>_gt_overlay.pngevaluate command writes summary.json plus a few visualization examples under visualizations/.cuda automatically when available and otherwise runs on CPU.checkpoints/; you only need the alias or checkpoint path..pth checkpoint and SAM2 .pt weight file.