-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
28 lines (23 loc) · 866 Bytes
/
config.py
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
"""Configuration settings for the SegFormer evaluation pipeline."""
from torch import device, float32
from torch.cuda import is_available
from os import environ
# Global configuration
wandb_tag_mode = "eval"
wandb_tag_runmode = "multiple-runs"
dataset_name = "scene_parse_150"
ds_num_shards = 100
ds_shards_mod = ds_num_shards / 10
model_name_short = "b2"
model_name = f"nvidia/segformer-{model_name_short}-finetuned-ade-512-512"
metric_name = 'mean_iou'
# Paths
dataset_save_path = f"./datasets/{dataset_name}"
model_save_path = f"./models/{model_name}"
tokenizer_save_path = f"./tokenizers/{model_name}"
# WandB configuration
environ['WANDB_PROJECT'] = f'segformer-{dataset_name}-{wandb_tag_mode}-{wandb_tag_runmode}'
environ['WANDB_ENTITY'] = 'ba-segformer'
# Device configuration
compute_dtype = float32
device = device("cuda" if is_available() else "cpu")