"""
Configuration file containing information about project directory tree structure and model hyperparameters.
"""
import sys
import os


class WLASLHyperparams:
    """WLASL models hyperparameters
    """
    # training sequence length and batch size
    SEQUENCE_LEN = 50
    BATCH_SIZE = 64
    # training learning rate and number of iterations
    LEARNING_RATE = 1e-3
    EPOCHS = 2000


class Config:
    """Main configuration object, contains project's directory tree structure and trained models hyperparameters
    """
    BASE_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..')
    PARENT_PATH = os.path.join(BASE_PATH, '..')
    # weights and tfrecord root dirs
    WEIGHTS_PATH = os.path.join(BASE_PATH, 'weights')
    TFRECORDS_PATH = os.path.join(BASE_PATH, 'data', 'tfrecords')
    # wlasl annotation paths
    WLASL_DATASET_PATH = os.path.join(BASE_PATH, 'data', 'WLASL')
    WLASL_DATASET_PATHS = {
        'videos': os.path.join(WLASL_DATASET_PATH, 'videos'),
        'orig_annotations': os.path.join(WLASL_DATASET_PATH, 'WLASL_v0.3.json'),
        'orig_pose_annotations': os.path.join(WLASL_DATASET_PATH, 'pose_annotations'),
        'keypoints_annotations': os.path.join(WLASL_DATASET_PATH, 'annotations'),
        'class_map': os.path.join(WLASL_DATASET_PATH, 'class_map.json'),
        'vocabulary': os.path.join(WLASL_DATASET_PATH, 'vocabulary.json'),
    }
    # wlasl tfrecord files
    WLASL_TFRECORDS_PATH = {
        100: {
            'train': os.path.join(TFRECORDS_PATH, 'wlasl100_train.tfrecord'),
            'val': os.path.join(TFRECORDS_PATH, 'wlasl100_val.tfrecord'),
            'test': os.path.join(TFRECORDS_PATH, 'wlasl100_test.tfrecord'),
        },
        300: {
            'train': os.path.join(TFRECORDS_PATH, 'wlasl300_train.tfrecord'),
            'val': os.path.join(TFRECORDS_PATH, 'wlasl300_val.tfrecord'),
            'test': os.path.join(TFRECORDS_PATH, 'wlasl300_test.tfrecord'),
        },
        1000: {
            'train': os.path.join(TFRECORDS_PATH, 'wlasl1000_train.tfrecord'),
            'val': os.path.join(TFRECORDS_PATH, 'wlasl1000_val.tfrecord'),
            'test': os.path.join(TFRECORDS_PATH, 'wlasl1000_test.tfrecord'),
        },
        2000: {
            'train': os.path.join(TFRECORDS_PATH, 'wlasl2000_train.tfrecord'),
            'val': os.path.join(TFRECORDS_PATH, 'wlasl2000_val.tfrecord'),
            'test': os.path.join(TFRECORDS_PATH, 'wlasl2000_test.tfrecord'),
        }
    }
    # wlasl trained weights
    WLASL_WEIGHTS = {
        100: os.path.join(WEIGHTS_PATH, 'wlasl100.tf'),
        300: os.path.join(WEIGHTS_PATH, 'wlasl300.tf'),
        1000: os.path.join(WEIGHTS_PATH, 'wlasl1000.tf'),
        2000: os.path.join(WEIGHTS_PATH, 'wlasl2000.tf'),
    }
    # wlasl evaluation files
    WLASL_EVAL_METRICS_PATH = os.path.join(BASE_PATH, 'data', 'WLASL', 'eval_metrics.csv')
    WLASL_EVAL_WEIGHTS_PATH = os.path.join(BASE_PATH, 'data', 'WLASL', 'eval_weights.csv')
    # wlasl hyperparameters
    WLASL_PARAMS = WLASLHyperparams()


CFG = Config()
