• Stars
    star
    112
  • Rank 312,240 (Top 7 %)
  • Language
    Jupyter Notebook
  • Created over 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A comparison of ffmpeg, Shotdetect and PySceneDetect for shot transition detection

Shot Detection Benchmarks

This is a comparison of the shot transition detection performance of FFmpeg (in particular, the ffprobe tool), Shotdetect and PySceneDetect (in content mode).

Data

The test data consists of three youtube videos which were chosen to represent the various kinds of footage that might require shot detection:

The gameshow clip is filmed in a reasonably well-lit environment with crisp shot transitions. The sports clip contains slower shot transitions and a great deal of movement from the players, but fairly constrained camera movements. The movie clip is an action scene with vibrant colors and rapid camera movement. Each video was annotated manually for shot transitions.

Results

For each dataset, the tools are first evaluated with their suggested defaults, then with parameters found through hand tuning. This tuning is done with the intention of maximizing the area under the precision-recall curve, typically by reducing the detection thresholds (see notebooks for chosen parameters).

NOTE: Depending on your application, you might prefer to keep a high precision at the expense of lower recall, in which case the default settings for each tool are reasonable.

TV Gameshow

gameshow results gameshow results - tuned

On the TV gameshow clip (a UK Deal Or No Deal episode), all shot detectors achieve almost perfect precision and recall with their default settings (the ffprobe and PySceneDetect curves lie beneath the Shotdetect curve). The only error they make is caused by some jank in the original footage (visible around 1:02 seconds on the youtube video). The default thresholds were left unchanged.

Sports

sports results sports results - tuned

The sports footage (an international football match) proved considerably more challenging for the shot detectors. With the default settings, the recall for every tool is fairly poor with PySceneDetect slightly outperforming the other tools. With tuning, recall could be increased at the expense of precision.

NOTE: This video was more challenging than the first for a couple of reasons. First, the detectors struggled with the fades between shots which are difficult to detect when statistics are computed between consecutive frames. Second, much of the background was green (the football pitch) so that even when shots changed, the background was still dominated by a single color.

Movie

movie results movie results - tuned

The movie footage (a beach-based battle scene from Troy) was considerably easier than the sports but still more challenging than the TV gameshow. All detectors performed reasonably well, although PySceneDetect struggled with recall. Overall, Shotdetect performed best on this video.

Speed

There are significant differences in the speed of each tool. The following timing benchmarks should be considered approximate since they include minor time costs external to the tools (parsing the output string for the results). Despite this, they give a reasonable indicator of the relative speed of each tool. Note that the videos have the same frame rate (25 fps), but different resolutions (this affects the speed of the tools to different degrees).

Tool Gameshow clip Football clip Movie clip
ffprobe 2.46s 6.9s 4.21s
Shotdetect 21.3s 45.5 20.6s
PySceneDetect 5min 27s 1min 57s 56.8s

Details:

  • The time recorded was the best from 3 runs (see notebooks for details)
  • Hardware: mid 2014-Macbook Pro, 3 GHz Intel Core i7
  • ffprobe is written in C, Shotdetect is written (mostly) in C++ and PySceneDetect is written in Python.
  • Both ffprobe and shotdetect were wrapped in Python calls (adding a marginal time cost)
  • Each run includes the time spent parsing the results from console outputs (should be similar for each tool)
  • The benchmark code was written/run using Python 2.7.10.

Notes

In the cases of both PySceneDetect and ShotDetect, the code was modified slightly to expose the confidence of each shot boundary prediction and print to screen rather save to file to make the speed benchmarks fairer (see here and here for the mods).

More Repositories

1

convnet-burden

Memory consumption and FLOP count estimates for convnets
MATLAB
915
star
2

collaborative-experts

Video embeddings for retrieval with natural language queries
Python
331
star
3

SIGBOVIK17-GUNs

Supporting public code for SIGBOVIK17 submission
Python
193
star
4

mcnCrossModalEmotions

Supporting code for "Emotion Recognition in Speech using Cross-Modal Transfer in the Wild"
MATLAB
100
star
5

slurm_gpustat

A simple command line tool to show GPU usage on a SLURM cluster
Python
99
star
6

pytorch-mcn

Convert models from MatConvNet to PyTorch
Python
93
star
7

mcnPyTorch

Model converter (PyTorch -> MatConvNet)
Python
61
star
8

mcnGroupNorm

Small scale experiments with group normalization
MATLAB
58
star
9

algorithms-and-data-structures

Video descriptions and minimalist Python implementations of algorithms and data structures.
Python
56
star
10

yaspi

yaspi - Yet Another Slurm Python Interface
Python
41
star
11

mcnExtraLayers

Extra layers and utilities for matconvnet
MATLAB
38
star
12

mcnSENets

Squeeze-and-Excitation Networks
MATLAB
38
star
13

mcnSSD

A matconvnet implementation of the Single Shot Detector
MATLAB
36
star
14

foundation-models

Video descriptions of research papers relating to foundation models and scaling
27
star
15

pytorch-benchmarks

convenience utilities for model validation
Python
23
star
16

wider2pascal

A simple script for generating Pascal VOC devkit-style annotations for the WIDER faces dataset
MATLAB
21
star
17

mcnRobustLoss

robust regression loss functions
MATLAB
17
star
18

LearningGrimacesByWatchingTV

Code to accompany the paper "Learning Grimaces By Watching TV" and FaceValue dataset
MATLAB
12
star
19

mcnFasterRCNN

Training code for the Faster-RCNN detector
MATLAB
11
star
20

CReLU

simple experiments to reproduce the CReLU paper
MATLAB
11
star
21

matconvnet-ResNet

Deep Residual Networks for MatConvNet
MATLAB
10
star
22

pts_loader

A simple python function to load point cloud data from .pts files
Python
10
star
23

watchlogs

A simple utility for watching multiple logs
Python
7
star
24

large-language-models-are-few-shot-publication-scoopers

7
star
25

mcnToyOptim

Toy dataset examples for solvers
MATLAB
7
star
26

A-23MW-data-centre-is-all-you-need

Paper: https://arxiv.org/abs/2203.17265, Video: https://www.youtube.com/watch?v=VUKvgsLu9yo
7
star
27

mcnDeepLab

support for DeepLab segmentation
MATLAB
6
star
28

mcnBReNorm

batch renomalization
MATLAB
6
star
29

samuel-api

samuel-api is a biological competitor to GPT-4
5
star
30

mcnDatasets

imdb constructors/utils for some common datasets
MATLAB
5
star
31

mcnMaxout

Maxout networks for MatConvNet
MATLAB
5
star
32

zsvision

A small collection of python utilities for computer vision tasks
Python
4
star
33

mcnRFCN

Matconvnet implementation of R-FCN detector [no longer maintained]
MATLAB
4
star
34

scientists-on-youtube

a small collection of interviews and lectures
4
star
35

mcnDistilledTransfer

MATLAB
4
star
36

blockchainSimulation

A simple script to reproduce the simulations described in the bitcoin paper
MATLAB
3
star
37

matlab-zsvision

a few python/MATLAB scripts for computer vision
MATLAB
3
star
38

derivations

TeX
3
star
39

mcnIm2row

MATLAB interface for im2row function
Cuda
3
star
40

mcnNMS

Non-maximum suppression for MatConvNet
Cuda
3
star
41

Learning_C

C
2
star
42

mcnMovingStats

Online Estimation of feature statistics
MATLAB
2
star
43

mcnResNeXt

ResNeXt for matconvnet
MATLAB
2
star
44

atrous-benchmark

rough GPU benchmark for atrous vgg-vd-16 model in matconvnet
MATLAB
2
star
45

K-and-R

Notes/scripts for the programming exercises in "The C Programming Language", by Kernighan and Ritchie
C
2
star
46

mcnUtils

some utilities for matconvnet
MATLAB
1
star
47

tf-models

Python
1
star
48

ZR-face-detector

Some minor modifications to the Zhu-Ramanan face detector
C++
1
star
49

SIGBOVIK18-STNs

Supporting public code for SIGBOVIK18 submission
Python
1
star
50

sarcasm_detector

A project for detecting sarcastic content in tweets
JavaScript
1
star
51

mcnTensorflow

project to to import tensorflow models for matconvnet
Python
1
star
52

AI-news

1
star
53

prompt_formatting_in_latex

Python
1
star
54

generator_tutorial

Python
1
star
55

albanie

1
star
56

mcnQRelu

A simple, efficient matconvnet CUDA implementation of the leaky ReLU function
Cuda
1
star
57

caffe-utils

C++
1
star
58

grimaces

CNN training code for Tour project
MATLAB
1
star
59

robot_challenge

code base for AIMS robot challenge
MATLAB
1
star
60

mcnColors

Color transformation kernels
Cuda
1
star
61

building-matconvnet-modules

a short demonstration of how to build matconvnet modules
MATLAB
1
star
62

typst2mathjax

A minimalist tool to convert from typst to mathjax
Python
1
star