This code detects abrupt (cut) shot transitions in a given input video by, hierarchical temporal partitioning of video frames, using block-color histogram of the consequitive frames, and thresholding. This code is written based on the cut transition detection method that is introduced in these papers: paper1, paper2.
- Ubuntu 18.04
- CUDA 10.0
- CuDNN 10.0
- Python 3.8
- Anaconda 3: Use "requirement.txt" to create a conda environment with all required packages
conda create --name <env> --file requirements.txt
-
Step 1: Put the input video files (<video_name>.mp4) in "videos" folder.
-
Step 2: Run shot_transition_detection.py
-
Outputs: A folder will be created, i.e. "./videos/<video_name>" , that will include:
- All video shots, ".mp4".
- A “.csv” file with information about all of the generated video shots.
Please cite the following papers if you are using this code
@inproceedings{yazdi2016shot,
title={Shot boundary detection with effective prediction of transitions' positions and spans by use of classifiers and adaptive thresholds},
author={Yazdi, Mehran and Fani, Mehrnaz},
booktitle={2016 24th Iranian Conference on Electrical Engineering (ICEE)},
pages={167--172},
year={2016},
organization={IEEE}
}
@article{fani2021localization,
title={Localization of Ice-Rink for Broadcast Hockey Videos},
author={Fani, Mehrnaz and Walters, Pascale Berunelle and Clausi, David A and Zelek, John and Wong, Alexander},
journal={arXiv preprint arXiv:2104.10847},
year={2021}
}