MCPcopy Index your code
hub / github.com/MaureenZOU/TSAM

github.com/MaureenZOU/TSAM @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
851 symbols 2,340 edges 102 files 81 documented · 10%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Progressive Temporal Feature Alignment Network for Video Inpainting

This work is accepted in CVPR2021 as Poster. It proposed a new video inpainting approach that combines temporal convolution as well as optical flow approach.

Noted: This code is currently a beta version. Not gurantee to be fully correct.

Update

Optical Flow Davis | Optical Flow FVI | Mask Davis | Mask FVI | Checkpoint

Installation

torch==1.7.0
torchvision==0.8.1

Dataset

For FVI dataset, please refer to https://github.com/amjltc295/Free-Form-Video-Inpainting. For DAVIS dataset, please refer to https://davischallenge.org/.

File Structure

TSAM
└── data
    ├── checkpoints
    ├── model_weights
    ├── results
    ├── FVI
    ├── DAVIS    
    └── runs
└── code
    └── master
        └── TSAM
            └── ...

Prepare pretrained weights for training

Pretrained weights: download all the pretrained weights and put it under TSAM/data/model_weights | Model Name | | |----------------------------------|------------| | TSM_imagenet_resent50_gated.pth | weight | | TSM_imagenet_resent50.pth | weight |

Training

FVI TSM moving object/curve masks:

CUDA_VISIBLE_DEVICES=0,1,2,3 python3 train.py --config config/config_pretrain.json --dataset_config dataset_configs/FVI_all_masks.json
CUDA_VISIBLE_DEVICES=0,1,2,3 python3 train.py --config config/config_finetune.json --dataset_config dataset_configs/FVI_all_masks.json

Testing

Change the train.py in training scripts to test.py, and add -p /pth/to/ckpt to the end.

DAVIS TSAM object removal:

CUDA_VISIBLE_DEVICES=0 python3 test.py --config config/config_finetune_davis.json --dataset_config dataset_configs/DAVIS_removal.json -p /pth/to/ckpt

Citation

@inproceedings{zou2020progressive,
  title={Progressive Temporal Feature Alignment Network for Video Inpainting},
  author={Xueyan Zou and Linjie Yang and Ding Liu and Yong Jae Lee},
  booktitle={CVPR},
  year={2021}
}

Acknowledgement

Part of the code is borrow from https://github.com/amjltc295/Free-Form-Video-Inpainting and https://github.com/researchmm/STTN. Thanks for their great works!

Core symbols most depended-on inside this repo

append
called by 216
src/utils/readers.py
save
called by 26
libs/PerceptualSimilarity/util/html.py
get_everything_under
called by 22
src/utils/util.py
make_dirs
called by 14
src/utils/util.py
_resnet
called by 9
src/model/tsm/resnet.py
get_instance
called by 8
src/train.py
worker
called by 8
src/data_loader/transform_flow.py
make_block_temporal
called by 8
src/model/tsm/temporal_shift.py

Shape

Method 471
Function 222
Class 158

Languages

Python100%

Modules by API surface

src/utils/readers.py64 symbols
src/data_loader/dataset.py50 symbols
src/model/loss_module.py47 symbols
src/model/loss.py44 symbols
src/data_loader/transform_flow.py40 symbols
libs/PerceptualSimilarity/util/util.py40 symbols
src/model/blocks.py38 symbols
src/data_loader/transform.py35 symbols
src/model/tsm/resnet.py23 symbols
src/model/tsm/temporal_shift.py22 symbols
libs/PerceptualSimilarity/models/networks_basic.py21 symbols
src/utils/util.py18 symbols

For agents

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

⬇ download graph artifact