ETH Zurich, Switzerland
Computational Intelligence Lab • Kaggle Competition
python3 -m venv .venv
source .venv/bin/activatepip install torch torchvision lightning jsonargparse[signatures]pip install -r requirements.txtWhen adding dependencies, run the following command afterwards:
pip list --format=freeze > requirements.txtpre-commit installThis will run isort and black for import sorting and code formatting to ensure consistency. Note that if the check
fails, the commit will be rejected. You can also run isort .; black . prior to committing to bring the code into the
right shape.
And put it inside ./data.
python3 main.py fit -c configs/<config>.yamlThe configs folder contains various configurations of our
model. To run our final best-performing model, use the
configs/best_model.yaml file.
Note that this script will install Dinov2 checkpoints from HuggingFace. This may take a while when running the script for the first time.
Checkpoints and logs will be saved in the logs folder.
Monitor using TensorBoard:
tensorboard --logdir logspython3 main.py test -c configs/<config>.yaml --ckpt_path <path_to_checkpoint>The checkpoint path has to point to a valid checkpoint file (has to have been trained with the same config YAML file)
in the logs folder. The format looks like this: logs/<yyyy-mm-dd>/<hh-mm-ss>/checkpoints/<epoch>.ckpt
This script evaluates the model our own custom holdout test set and prints the respective metrics.
python3 main.py predict -c configs/<config>.yaml --ckpt_path <path_to_checkpoint>
python3 data/create_prediction_csv.pyThese scripts will run the model on the Kaggle test set and create the CSV file.