Spaces:
Sleeping
Sleeping
File size: 1,747 Bytes
ce91ea1 |
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
import os
from pathlib import Path
import numpy as np
current_dir = os.path.dirname(os.path.abspath(__file__))
ROOT = os.path.abspath(os.path.join(current_dir, os.path.pardir))
N_CLASSES = 14
CLASS_NAMES = ['Atelectasis', 'Cardiomegaly', 'Effusion', 'Infiltration', 'Mass', 'Nodule', 'Pneumonia',
'Pneumothorax', 'Consolidation', 'Edema', 'Emphysema',
'Fibrosis', 'Pleural Thickening', 'Hernia']
IMAGENET_MEAN = np.array([0.485, 0.456, 0.406])
IMAGENET_STD = np.array([0.229, 0.224, 0.225])
PATH = Path('/home/dattran/data/xray-thesis/chestX-ray14')
ATTENTION_DN = 'tmp/attention'
IMAGE_DN = 'images'
TRAIN_CSV = 'train.csv'
VAL_CSV = 'val.csv'
TEST_CSV = 'test.csv'
"""
Below may not need any more
"""
# EPOCHS = 2# 100
# # BATCHES = 500 # 500
# BATCHSIZE = 32
# VALIDATE_EVERY_N_EPOCHS = 5
SCALE_FACTOR = .875
DATA_DIR = '/mnt/data/xray-thesis/data/chestX-ray14/images/'
PERCENTAGE = 0.01 # percentage of data use for quick run
TEST_AGUMENTED = False
DISEASE_THRESHOLD = 0.5
MODEL_DIR = '/mnt/data/xray-thesis/models'
LOG_DIR = 'mnt/data/xray-thesis/logs'
CSV_DIR = '%s/csv' % ROOT
STAT_DIR = '%s/stats' % ROOT
# chexnet file
CHEXNET_MODEL_NAME = '%s/chexnet_densenet.pth.tar' % MODEL_DIR
CHEXNET_TRAIN_CSV = '%s/chexnet_train_list.csv' % CSV_DIR
CHEXNET_VAL_CSV = '%s/chexnet_val_list.csv' % CSV_DIR
CHEXNET_TEST_CSV = '%s/chexnet_test_list.csv' % CSV_DIR
TRAIN_CSV = '%s/train_list.csv' % CSV_DIR
VAL_CSV = '%s/val_list.csv' % CSV_DIR
TEST_CSV = '%s/test_list.csv' % CSV_DIR
# different model
DENSENET121_DIR = '%s/densenet121' % MODEL_DIR
# stat
TRAIN_STAT = '%s/train.csv' % STAT_DIR
TEST_STAT = '%s/test.csv' % STAT_DIR
PREPROCESS = False
|