-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconstants.py
More file actions
35 lines (28 loc) · 993 Bytes
/
constants.py
File metadata and controls
35 lines (28 loc) · 993 Bytes
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
"""Constants and configuration for CABiNet models."""
from typing import Any, Dict
# MobileNetV3 backbone configuration
MOBILENET_LARGE_FEATURES = 960
MOBILENET_SMALL_FEATURES = 576
# Model output channel configuration
MODEL_CONFIG: Dict[str, Dict[str, Any]] = {
"large": {
"attention_planes": MOBILENET_LARGE_FEATURES,
"output_channel": 1280,
},
"small": {
"attention_planes": MOBILENET_SMALL_FEATURES,
"output_channel": 1024,
},
}
# Training constants
OHEM_DIVISOR = 16 # Divisor for computing n_min in OHEM loss
DEFAULT_SCORE_THRESHOLD = 0.7 # Default threshold for OHEM loss
# Evaluation constants
EVAL_STRIDE_RATE = 5 / 6.0 # Stride rate for sliding window evaluation
DEFAULT_EVAL_SCALES = [0.5, 0.75, 1.0, 1.25, 1.5, 1.75]
# Dataset-specific constants
CITYSCAPES_NUM_CLASSES = 19
UAVID_NUM_CLASSES = 8
DEFAULT_IGNORE_LABEL = 255
# Visualization constants
VISUALIZATION_SAMPLE_LIMIT = 50 # Maximum number of samples to visualize