본문 바로가기

논문 리뷰/Vision Transformer

ProPainter: Improving Propagation and Transformer for Video Inpainting

Flow-guided video inpainting 방법론 총집합 + dual-domain propagation + mask-guided sparse transformer
 
[Project Page]
[Github]
[arXiv]

Abstract

Video Inpainting 프레임워크 Propainter

  • Dual-domain propagation
  • Mask-guided sparse video Transformer

 
 

Introduction

이미지 기반 전파와 feature 기반 전파의 장점을 결합하기 위한 dual-domain propagation

  • CPU가 아닌 GPU에서 전역 이미지 전파 수행
  • Flow-based deformable alignment를 활용한 향상된 feature 전파
  • 효율적인 네트워크를 통해 SOTA보다 40배 빠른 작업 속도

 
Video inpainting(VI)에 transformer를 활용한 이전 연구들은 고차원적인 프레임 간 연산으로 인해 너무 과도한 메모리를 요구한다.
하지만 실제로 누락되지 않은 대부분의 영역에서는 attention이 불필요하고, 인접한 프레임에는 매우 중복된 texture가 포함되어 있다.
 
따라서 상기한 문제들을 개선한 mask-guided sparse video Transformer 설계.

 
 
 

Methodology

가장 먼저 비디오 시퀀스에서 양방향 optical flow 추출.
 
Propainter의 구성:

  • RFC(Recurrent Flow Completion)
  • DDP(Dual-Domain Propagation)
  • MSVT(Mask-guided Sparse Video Transformer)

Recurrent Flow Completion

먼저 flow를 downsampling 한 다음 deformable convolution을 기반으로 한 deformable alignment를 이용해 flow 정보를 양방향 전파.
 
역방향 전파에 대한 예시.

Convolutoin layer로 mask와 offset을 계산하고 deformable convolution을 통해 전파. 
최종적으로 decoder를 통해 upsampling 하여 완성된 flow 얻음.


Dual-domain Propagation

양방향 전파에 모두 적용하지만 마찬가지로 역방향 전파를 예시로 설명함.
 

Image propagation

몇 가지 조건을 만족하는 픽셀 위치에 대해 이미지 전파 수행.

  • 일관성 검사 통과 : flow를 기반으로 순방향, 역방향 진행을 했을 때 픽셀이 원래 위치로 돌아와야 함(임계값 이하)
  • 픽셀이 마스크 된 영역 안에 있어야 함
  • 해당 픽셀이 전파 전 프레임에서는 마스크 되지 않은 영역에 있어야 함

 
전파가 완료된 픽셀 위치에 대해 알려진 픽셀로 마스크를 업데이트하여 지속적인 전파가 가능하도록 함.
 

Feature propagation

E2FGVI와 같은 방법으로 feature propagation을 진행하지만 추가적인 flow valid map V를 제공한다는 점이 다르다.

Valid map은 원래 마스크 M과 이미지 전파 후 업데이트 된 M̂을 사용하여 계산됨.


Mask-Guided Sparse Video Transformer

입력된 비디오 시퀀스 feature를 soft split 하고 window로 분할하여 feature Z 생성.
Z 내에서 Q, K, V를 얻는다. 
 
Global token에서 K, V를 가져오는 FGT의 전략과 FuseFormer의 F3N block 사용.
 

Sparse Query Space

마스크를 Z와 같은 크기로 downsampling 하고 마스킹된 부분이 포함된 window 만을 포함한 sparse mask를 얻음.

 

Sparse Key/Value Space

인접 프레임 간에는 매우 중복되는 texture가 많으므로 temporal stride를 2로 하여 K, V 수집.

 
 
 

Loss Functions

Loss Functions of RFC network

누락된 영역과 알려진 영역에 대한 재구성 손실:

매끄러운 flow field를 위한 smoothness loss:

Total loss:


Loss Functions of ProPainter

생성된 비디오 시퀀스에 대한 L1 loss:

T-PatchGAN의 판별자를 기반으로 한 적대적 손실:

Total loss:

 
 
 

Experiments

https://www.youtube.com/watch?v=92EHfgCO5-Q