File size: 951 Bytes
5a1821b
 
 
 
 
 
 
 
607b168
 
 
5a1821b
 
607b168
4b93ba5
6727da5
 
5a1821b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
Centralized constants for S2F App.
"""
import cv2

# Model & paths
MODEL_INPUT_SIZE = 1024

# Default substrate (used when config lookup fails or manual mode fallback)
DEFAULT_SUBSTRATE = "Fibroblasts_Fibronectin_6KPa"

# UI
CANVAS_SIZE = 320
SAMPLE_THUMBNAIL_LIMIT = 8
BATCH_MAX_IMAGES = 5
# Max images per model forward pass (avoids OOM on Hugging Face free tier)
BATCH_INFERENCE_SIZE = 2
COLORMAP_N_SAMPLES = 64

# Model type labels
MODEL_TYPE_LABELS = {"single_cell": "Single cell", "spheroid": "Spheroid LS174T"}

# Drawing tools
DRAW_TOOLS = ["polygon", "rect", "circle"]
TOOL_LABELS = {"polygon": "Polygon", "rect": "Rectangle", "circle": "Circle"}

# File extensions
SAMPLE_EXTENSIONS = (".tif", ".tiff", ".png", ".jpg", ".jpeg")

# Colormaps (OpenCV)
COLORMAPS = {
    "Jet": cv2.COLORMAP_JET,
    "Viridis": cv2.COLORMAP_VIRIDIS,
    "Plasma": cv2.COLORMAP_PLASMA,
    "Inferno": cv2.COLORMAP_INFERNO,
    "Magma": cv2.COLORMAP_MAGMA,
}