Shot-size classifiers · Live demo

What a Shot.

Five versions of a model that reads a film frame's shot size, from extreme long shot to detail. Watch a MobileNetV3 tag movie trailers shot by shot in real time, then pick a frame that people labelled to see what each version predicts and where it looks. Everything runs here in your browser.

7 shot sizes the model tells apart
01 /

Live on movie trailers

Press play: the model runs on every frame it can, live in your browserlive in your browser v5, precomputed every 0.5 s

Real time, in your browser: the tag in the corner comes from v6, a MobileNetV3-L distilled from v5, running on your CPU in WebAssembly at about 50 ms a frame (about 20 frames a second); the speed on your machine is shown under the timeline. The models learned from live-action film stills: the animated trailers and the two game trailers (Halo 3, Gears of War 2) are far from that, and The Matrix Reloaded is one of the films in the training data.

Disclaimer: the trailers are shown for educational and research purposes only, to demonstrate the classifier. I do not own them: all rights belong to their studios and publishers. If you hold the rights to one and want it removed, open a discussion on this Space and it will be taken down.

02 /

Inside a prediction

Test frame
FrameAttention v6 is a convolutional network: it has no attention to show.

The model sees the centre 224 × 224 crop. Bright areas are the patches its CLS token attends to most in the last layer, averaged over six heads.

Model

    Every version on this frame

    03 /

    How the versions compare

    Scores for v4 to v6 are on the 643 test frames none of them trained on: 216 of the 859 human-labelled frames also turned up, as identical stills, in the scraped training rows v4 and v5 learned from (v6 left them out). * v2 and v3 trained on about 80% of the human-labelled frames, so their scores, on all 859, are inflated and not comparable.

    Confusion matrix
    04 /

    Data and training

    Dataset

    Film stills

    The test set is 863 frames labelled by people (859 with one of the seven sizes). Training uses 53,449 labelled rows, about 48,000 distinct stills from roughly 1,000 films: labelled by an earlier model, with low-confidence labels reviewed again. All of it is in types-of-film-shots.

    Versions

    Five tries

    Model

    How it reads a frame

    The frame is resized so its short side is 256 px, centre-cropped to 224 and normalised. A small vision transformer splits it into 16-pixel patches (14 for v2), and a linear layer on its CLS token scores the seven sizes. Every version here is quantised to int8, about 21 MB, and runs on ONNX Runtime Web.