back to home

ant-research / CoDeF

[CVPR'24 Highlight] Official PyTorch implementation of CoDeF: Content Deformation Fields for Temporally Consistent Video Processing

4,865 stars
383 forks
30 issues
PythonShell

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing ant-research/CoDeF in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/ant-research/CoDeF)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

CoDeF: Content Deformation Fields for Temporally Consistent Video Processing Hao Ouyang\*, Qiuyu Wang\*, Yuxi Xiao\*, Qingyan Bai, Juntao Zhang, Kecheng Zheng, Xiaowei Zhou, Qifeng Chen†, Yujun Shen† (*equal contribution, †corresponding author) **CVPR 2024 Highlight** Project Page | Paper | High-Res Translation Demo | Colab Requirements The codebase is tested on • Ubuntu 20.04 • Python 3.10 • PyTorch 2.0.0 • PyTorch Lightning 2.0.2 • 1 NVIDIA GPU (RTX A6000) with CUDA version 11.7. (Other GPUs are also suitable, and 10GB GPU memory is sufficient to run our code.) To use video visualizer, please install via For additional Python libraries, please install with Our code also depends on tiny-cuda-nn. See this repository for Pytorch extension install instructions. Data Provided data We have provided some videos here for quick test. Please download and unzip the data and put them in the root directory. More videos can be downloaded here. Customize your own data We segement video sequences using SAM-Track. Once you obtain the mask files, place them in the folder . Next, execute the following command: We extract optical flows of video sequences using RAFT. To get started, please follow the instructions provided here to download their pretrained model. Once downloaded, place the model in the folder. After that, you can execute the following command: Remember to update the sequence name and root directory in both and accordingly. After obtaining the files, please organize your own data as follows: Pretrained checkpoints You can download checkpoints pre-trained on the provided videos via | Sequence Name | Config | Download | OpenXLab | | :-------- | :----: | :----------------------------------------------------------: | :---------:| | beauty_0 | configs/beauty_0/base.yaml | Google drive link | | | beauty_1 | configs/beauty_1/base.yaml | Google drive link | | | white_smoke | configs/white_smoke/base.yaml | Google drive link | | | lemon_hit | configs/lemon_hit/base.yaml | Google drive link | | | scene_0 | configs/scene_0/base.yaml | Google drive link | | And organize files as follows Train a new model where • : Decide which GPU to train on; • : Name of the video sequence; • : Name of the experiment; • : Directory of the input video sequence; • : Path to save the checkpoints; • : Path to save the logs; • : Directory of the preprocessed masks (optional); • : Directory of the preprocessed optical flows (optional); Please check configuration files in configs/ , and you can always add your own model config. Test reconstruction After running the script, the reconstructed videos can be found in , along with the canonical image. Test video translation After obtaining the canonical image through this step, use your preferred text prompts to transfer it using ControlNet. Once you have the transferred canonical image, place it in (i.e. in ). Then run The transferred results can be seen in . *Note*: The option in the configuration file should be set with caution, usually a little larger than , as it determines the field of view of the canonical image. BibTeX Acknowledgements We thank camenduru for providing the colab demo.