PhenoCamSnow is a Python package for quickly building deep learning models to classify PhenoCam images.
PhenoCamSnow supports Python 3.7+ and can be installed via pip:
pip install phenocam-snow
Optional dependencies for development and documentation purposes can be installed by specifying the extras [dev]
and [docs]
, repsectively.
The following code snippets show how to train and evaluate a model on classifying images from the canadaojp site into "snow", "no snow", and "too dark".
python -m phenocam_snow.train \
canadaojp \
--model resnet18 \
--learning_rate 5e-4 \
--weight_decay 0.01 \
--new \
--n_train 120 \
--n_test 30 \
--classes snow no_snow too_dark
This will print out the file path of the best model, which can be substituted into the next command.
python -m phenocam_snow.predict \
canadaojp \
[path/to/best_model.ckpt] \
resnet18 \
--categories snow no_snow too_dark
--url https://phenocam.nau.edu/data/latest/canadaojp.jpg
Advanced usage details can be found in the documentation.
If you use PhenoCamSnow for your work, please see CITATION.cff
or use the citation prompt provided by GitHub in the sidebar.