MCPcopy Index your code
hub / github.com/UVA-Computer-Vision-Lab/OmniShotCut

github.com/UVA-Computer-Vision-Lab/OmniShotCut @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
111 symbols 374 edges 18 files 18 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img src="https://github.com/UVA-Computer-Vision-Lab/OmniShotCut/raw/main/__assets__/logo.png" height="100">

OmniShotCut: Holistic Relational Shot Boundary Detection with Shot-Query Transformer

OmniShotCut is a sensitive and more informative SoTA for Shot Boundary Detection. \ OmniShotCut can detect shot changes of the video in diverse sources (anime, vlog, game, shorts, sports, screen recording, etc.), and recognize Sudden Jump and Transitions (dissolve, fade, wipe, etc.) by proposing a Shot-Query-based Video Transformer.

Paper Website

🔥 Update | 👀 Visualization | 🔧 Installation | 🐍 Quick Start |Inference | 💻 OmniShotCut Benchmark

Update 🔥🔥🔥

  • [x] Release ArXiv paper
  • [x] Release the inference weights
  • [x] Release Gradio demo (with online)
  • [x] Release 'pip install omnishotcut' version
  • [ ] Release the benchmark
  • [ ] Release the training code and curation

:star: If you like OmniShotCut, please help ⭐⭐star⭐⭐ this repo. Thanks! :hugs:

<img src="https://github.com/UVA-Computer-Vision-Lab/OmniShotCut/raw/main/__assets__/teaser.png" style="border-radius: 15px">







<img src="https://github.com/UVA-Computer-Vision-Lab/OmniShotCut/raw/main/__assets__/model_architecture.png" style="border-radius: 15px">

Quick Start 🐍

First install PyTorch with CUDA support. Then install OmniShotCut:

pip install git+https://github.com/UVA-Computer-Vision-Lab/OmniShotCut.git

Once installed, running shot boundary detection is just a few lines:

import omnishotcut

# Load model — accepts a local checkpoint path or HuggingFace repo
cut_model = omnishotcut.load("uva-cv-lab/OmniShotCut", filename = "OmniShotCut_ckpt.pth")

# Run on a video file
ranges = cut_model.inference("video.mp4", mode="clean_shot")

ranges is a list of [start_frame, end_frame] pairs for each detected shot. By default mode="clean_shot" returns only clean cuts (no transitions). Use mode="default" to also get dissolves, wipes, and fades with their labels:

ranges, intra_labels, inter_labels = cut_model.inference("video.mp4", mode="default")

Besides video file paths, inference() also accepts numpy arrays and torch tensors directly — both should be (T, H, W, 3) uint8 RGB:

Full Local Installation 🔧

conda create -n OmniShotCut python=3.10
conda activate OmniShotCut
pip install -r requirements.txt
pip install -e .

Gradio Demo ⚡⚡⚡

Local Gradio can be created by simply running the following:

python app.py 

Click "Running on public URL".

Inference ⚡

This section presents more formal fun and controllable setting in running.

First, let us download the checkpoint

mkdir checkpoints
cd checkpoints
wget https://huggingface.co/uva-cv-lab/OmniShotCut/resolve/main/OmniShotCut_ckpt.pth

We provide some modes for the inference. 'default' mode will shot the intra and inter label we define. However, we believe that most users might want the most direct results, which is the general shots without any transitions. To this end, please use '--mode clean_shot'.

Execute the inference by:

python inference.py  --checkpoint_path checkpoints/OmniShotCut_ckpt.pth  --input_video_path __assets__/demo_video1.mp4  --overlap_window_length 20  --mode default

Results are saved to results.json. Visualization is saved to demo_video_results/, where vertical bars with the same color indicate the same shot.

📚 Citation

@article{wang2026omnishotcut,
  title={OmniShotCut: Holistic Relational Shot Boundary Detection with Shot-Query Transformer},
  author={Wang, Boyang and Xu, Guangyi and Tang, Zhipeng and Zhang, Jiahui and Cheng, Zezhou},
  journal={arXiv preprint arXiv:2604.24762},
  year={2026}
}

Core symbols most depended-on inside this repo

print
called by 18
omnishotcut/util/misc.py
to
called by 7
omnishotcut/util/misc.py
with_pos_embed
called by 6
omnishotcut/architecture/transformer.py
load_model
called by 3
omnishotcut/engine.py
escape_html
called by 2
app.py
split_videos
called by 2
omnishotcut/engine.py
merge_predictions
called by 2
omnishotcut/engine.py
single_video_inference
called by 2
omnishotcut/engine.py

Shape

Method 48
Function 47
Class 16

Languages

Python100%

Modules by API surface

omnishotcut/architecture/transformer.py25 symbols
omnishotcut/architecture/backbone.py13 symbols
omnishotcut/util/misc.py12 symbols
omnishotcut/datasets/transforms.py9 symbols
omnishotcut/architecture/model.py8 symbols
omnishotcut/datasets/dataloader.py7 symbols
omnishotcut/util/visualization.py6 symbols
app.py6 symbols
omnishotcut/engine.py5 symbols
omnishotcut/datasets/compression_utils.py4 symbols
omnishotcut/architecture/position_encoding.py4 symbols
omnishotcut/__init__.py4 symbols

For agents

$ claude mcp add OmniShotCut \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact