Repository navigation
Expand file tree
/
Copy pathconfig.py
More file actions
39 lines (32 loc) · 1.44 KB
/
Copy pathconfig.py
File metadata and controls
39 lines (32 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from pathlib import Path
from typing import Set
# -----------------------------------------------------------------------------
# File & folder configuration
# -----------------------------------------------------------------------------
# Base directory (folder where this project lives)
BASE_DIR = Path(__file__).resolve().parent
# Where uploaded images and annotation JSON live.
DATA_DIR = BASE_DIR / "data"
DATA_DIR.mkdir(parents=True, exist_ok=True)
ALLOWED_EXTENSIONS: Set[str] = {".jpg", ".jpeg", ".png", ".bmp", ".gif"}
# -----------------------------------------------------------------------------
# Grounding DINO configuration
# -----------------------------------------------------------------------------
# Update these to match your local GroundingDINO installation
DINO_CONFIG_PATH = Path(
r"C:\yuxuan\GroundingDINO\groundingdino\config\GroundingDINO_SwinT_OGC.py"
)
DINO_CHECKPOINT_PATH = Path(
r"C:\yuxuan\GroundingDINO\groundingdino_swint_ogc.pth"
)
# -----------------------------------------------------------------------------
# SAM 2 configuration
# -----------------------------------------------------------------------------
# Use the smaller SAM 2 "hiera_s" model to reduce VRAM usage.
# Make sure these paths exist on your machine.
SAM2_CONFIG_PATH = Path(
r"C:\yuxuan\GroundingDINO\sam2_repo\sam2\configs\sam2\sam2_hiera_s.yaml"
)
SAM2_CHECKPOINT_PATH = Path(
r"C:\yuxuan\GroundingDINO\checkpoints\sam2_hiera_small.pt"
)