# Experiment setup

NUM_FRAMES=16
SAMPLE_RATE=4
TASK="PHASES"
ARCH="MViT"
ONLINE=False

TRAIN_FOLD="train"
TEST_FOLD="test" 
EXP_PREFIX="arch_$ARCH-frames_$NUM_FRAMES-sr_$SAMPLE_RATE-online_$ONLINE"


#-------------------------
DATASET="misaw"
EXPERIMENT_NAME=$EXP_PREFIX"/"$TRAIN_FOLD
CONFIG_PATH="configs/"$DATASET"/"$ARCH"_"$TASK".yaml"
FRAME_DIR="./data/"$DATASET"/frames"
OUTPUT_DIR="outputs/"$DATASET"/"$TASK"/"$EXPERIMENT_NAME
FRAME_LIST="./data/"$DATASET"/frame_lists"
ANNOT_DIR="./data/"$DATASET"/annotations/"$TRAIN_FOLD
COCO_ANN_PATH="./data/"$DATASET"/annotations/"$TRAIN_FOLD"/"$TEST_FOLD"_long-term_anns.json"
CHECKPOINT="./model_weights/pretrained_models/k400_16.pyth"
TYPE="pytorch"

export PYTHONPATH="./must:$PYTHONPATH"
mkdir -p $OUTPUT_DIR

CUDA_VISIBLE_DEVICES=0,2,3 python -B tools/run_net.py \
--cfg $CONFIG_PATH \
NUM_GPUS 3 \
TRAIN.DATASET $DATASET \
TEST.DATASET $DATASET \
TRAIN.CHECKPOINT_FILE_PATH $CHECKPOINT \
TRAIN.CHECKPOINT_EPOCH_RESET True \
TRAIN.CHECKPOINT_TYPE $TYPE \
TEST.ENABLE False \
TRAIN.ENABLE True \
DATA.NUM_FRAMES $NUM_FRAMES \
DATA.SAMPLING_RATE $SAMPLE_RATE \
DATA.ONLINE $ONLINE \
ENDOVIS_DATASET.FRAME_DIR $FRAME_DIR \
ENDOVIS_DATASET.FRAME_LIST_DIR $FRAME_LIST \
ENDOVIS_DATASET.TRAIN_LISTS $TRAIN_FOLD".csv" \
ENDOVIS_DATASET.TEST_LISTS $TEST_FOLD".csv" \
ENDOVIS_DATASET.ANNOTATION_DIR $ANNOT_DIR \
ENDOVIS_DATASET.TEST_COCO_ANNS $COCO_ANN_PATH \
ENDOVIS_DATASET.TRAIN_GT_BOX_JSON "train_long-term_anns.json" \
ENDOVIS_DATASET.TEST_GT_BOX_JSON $TEST_FOLD"_long-term_anns.json" \
TRAIN.BATCH_SIZE 69 \
TEST.BATCH_SIZE 69 \
SOLVER.MAX_EPOCH 20 \
OUTPUT_DIR $OUTPUT_DIR 