import numpy as np import torch APP_TITLE = "Laboratoire de segmentation multispectrale" SEED = 42 DEFAULT_PATCH_SIZE = 128 NUM_CHANNELS = 7 NUM_CLASSES = 4 IGNORE_INDEX = 255 MAX_EXPERIMENTS = 3 BAND_NAMES = ["H_1", "H_2", "H_3", "H_4", "H_5", "H_6", "H_7"] BAND_DESCRIPTIONS = ["H_1", "H_2", "H_3", "H_4", "H_5", "H_6", "H_7"] CLASS_NAMES = ["Water", "Urban", "Agriculture", "Forest"] CLASS_COLORS = np.array( [ [30, 144, 255], # Water - blue [220, 50, 50], # Urban - red [255, 215, 0], # Agriculture - yellow [34, 139, 34], # Forest - green ], dtype=np.uint8, ) # (R-band-index, G-band-index, B-band-index) for composite presets COMPOSITE_PRESETS = { "H4 / H3 / H2": (3, 2, 1), "H5 / H4 / H3": (4, 3, 2), "H7 / H5 / H4": (6, 4, 3), } DEVICE = "cuda" if torch.cuda.is_available() else "cpu" def set_seed(seed: int = SEED): np.random.seed(seed) torch.manual_seed(seed) torch.cuda.manual_seed_all(seed)