Repository

movie-shot-categorizer

Fine-tune of Florence-2 for shot categorization.

README

Shot Categorizer 🎬

<br>

Contains fine-tuning and inference code for a shot categorizer model. We fine-tuned the model on
the microsoft/Florence-2-large and the
diffusers/ShotDEAD-v0 dataset.

The model can be used to curate video datasets amongst other use cases.

Getting started

Install PyTorch and make sure you're on a CUDA-enabled GPU. The scripts were tested on 8xH100s.

Then install the dependencies pip install requirements.txt.

You can then launch training:

accelerate launch \
    --config_file=configs/accelerate-configs/ds.yaml train.py \
    --config=configs/training-configs/config.yaml

We provide a SLURM configuration in the run.slurm file.

Inference

python inference.py --image_path=<PATH_TO_AN_IMAGE>

Additionally, you can run the accuracy.py script to compute aggregate metrics on the indvidual sgot categories on your dataset.

Acknowledgement

Thanks to this blog post on fine-tuning Florence-2.