You can enable (default) or disable data augmentation with the flags --do_aug and --no_do_aug;
You can resume a training with the flag --do_resume (also resume the W&B run by providing the --wandb_id);
More efficient computation of training metrics (MAE and RMSE);
Validation during training, with MAE, RMSE and NAE (Normalized Average Error, i.e., $\frac{MAE}{\text{gt count}}$, as in https://arxiv.org/abs/2308.10468);
Logging of train and val metrics on W&B, plus updated images of the predictions and exemplars used for each image (as you can see in this report https://api.wandb.ai/links/giovanni-ficarra/ilxvm4to and in the images below);
Model saving:
save last model locally at each epoch, overwriting the previous one (finetuning_last);
save locally AND on W&B every save_freq epochs or at the end of the training (finetuning_<epoch>);
save locally AND on W&B if the validation MAE is the lowest (finetuning_minMAE);
More flexibility on the training dataset by using the data_path from the command line argument in FSC147.py as in FSC_finetune_cross.py.
Testing
(FSC_test_cross(few-shot).py)
More flexibility: you can test on the val split with the parameter --split;
Log NAE, loading time and inference time as well as MAE and RMSE;
Fine-tuning
(
FSC_finetune_cross.py
)--do_aug
and--no_do_aug
;--do_resume
(also resume the W&B run by providing the--wandb_id
);finetuning_last
);save_freq
epochs or at the end of the training (finetuning_<epoch>
);finetuning_minMAE
);data_path
from the command line argument inFSC147.py
as inFSC_finetune_cross.py
.Testing
(
FSC_test_cross(few-shot).py
)--split
;util.misc.log_test_results
andmisc.plot_test_results
.Zero-shot demo
demo_zero.py
allows to test CounTR on your own data in an easy manner without providing any exemplar, just an input file or directory;util.misc.frames2vid
, you can make a video from the output of the demo (particularly useful when dealing with video frames).run_minimal.MD
In this file I summarised how to finetune and test CounTR with the new parameters, with examples of commands and input images and configurations.