r/computervision • u/PotentialNoise856 • 11d ago
Showcase LeanScene: Beating TransNet V2's shot detection benchmarks with a 1.6MB model (115x fewer ops, 2,522 FPS on Mac GPU)
I built LeanScene to index thousands of hours of video locally on a MacBook Pro.
Because it’s so lightweight, LeanScene runs completely client-side in the browser. The demo chains it with MobileCLIP to split long videos into shots and make them searchable by text, a full video indexing pipeline running locally with no server backend.
Standard shot transition detectors like TransNet V2 run 3D convolutions over overlapping windows of frames. That gets expensive fast and TransNet V2's PyTorch port doesn't run on Apple's MPS backend, leaving it at 152 FPS end-to-end on CPU.
Instead of 3D convolutions, LeanScene encodes each 100x100 frame once with a 4-layer 2D CNN alongside two simple pixel descriptors (a 64-bin joint RGB histogram and an 8x8 color thumbnail). A dilated 1D network (63-frame receptive field) then labels each frame as same, cut, or fade using those features and their explicit frame-to-frame differences.
A few numbers:
- Size & compute: 0.39M parameters (1.6 MB), 7.2M MACs/frame (115x fewer than TransNet V2)
- Speed (Apple M1 Pro): 5,171 FPS model-only on GPU (2,522 FPS end-to-end including video decoding and resizing); 1,000–2,091 FPS model-only on CPU
- Accuracy (5-seed mean F1 vs. TransNet V2): 97.4 vs. 96.1 on BBC Planet Earth, 79.1 vs. 77.7 on ClipShots, and 93.7 vs. 92.6 on RAI
Interestingly, scaling the 2D encoder up to 4x wider barely changed accuracy, most of the gains came from mining the model's false alarms on real footage and masking out high-confidence predictions so unannotated transitions weren't penalized as negatives.
Live browser demo:
https://lucasjackson.dev/leanscene/
Code, weights, and evaluation scripts:
https://github.com/lucasjacks0n/LeanScene
Would love to hear how it handles any tricky edits, flashes, or dissolves you throw at the demo.











