Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- src/sam_backend.py +1 -1
- src/sam_card_detection.py +2 -2
src/sam_backend.py
CHANGED
|
@@ -16,7 +16,7 @@ from typing import Tuple
|
|
| 16 |
# even when the weights are already cached locally.
|
| 17 |
os.environ.setdefault("HF_HUB_DOWNLOAD_TIMEOUT", "60")
|
| 18 |
|
| 19 |
-
SAM2_MODEL_ID = "facebook/sam2.1-hiera-
|
| 20 |
|
| 21 |
# SAM resizes internally to 1024 — feeding >1024 wastes CPU on image encoding.
|
| 22 |
INFERENCE_MAX_SIDE = 1024
|
|
|
|
| 16 |
# even when the weights are already cached locally.
|
| 17 |
os.environ.setdefault("HF_HUB_DOWNLOAD_TIMEOUT", "60")
|
| 18 |
|
| 19 |
+
SAM2_MODEL_ID = "facebook/sam2.1-hiera-small"
|
| 20 |
|
| 21 |
# SAM resizes internally to 1024 — feeding >1024 wastes CPU on image encoding.
|
| 22 |
INFERENCE_MAX_SIDE = 1024
|
src/sam_card_detection.py
CHANGED
|
@@ -28,8 +28,8 @@ from .card_detection import (
|
|
| 28 |
)
|
| 29 |
from .sam_backend import INFERENCE_MAX_SIDE as PROMPT_INFERENCE_MAX_SIDE, get_sam2
|
| 30 |
|
| 31 |
-
# HF Hub model id — small,
|
| 32 |
-
SAM2_MODEL_ID = "facebook/sam2.1-hiera-
|
| 33 |
|
| 34 |
# Downscale large images before inference to keep CPU runtime tractable.
|
| 35 |
# SAM 2.1 internally resizes to 1024, so feeding >1024 is pure overhead.
|
|
|
|
| 28 |
)
|
| 29 |
from .sam_backend import INFERENCE_MAX_SIDE as PROMPT_INFERENCE_MAX_SIDE, get_sam2
|
| 30 |
|
| 31 |
+
# HF Hub model id — tiny, small, base-plus, large
|
| 32 |
+
SAM2_MODEL_ID = "facebook/sam2.1-hiera-small"
|
| 33 |
|
| 34 |
# Downscale large images before inference to keep CPU runtime tractable.
|
| 35 |
# SAM 2.1 internally resizes to 1024, so feeding >1024 is pure overhead.
|