메뉴
BL
r/singularity 57일 전

넷플릭스, 영상 내 객체와 물리적 상호작용까지 완벽히 삭제하는 비디오 AI 'VOID' 공개

IMP
8/10
핵심 요약

넷플릭스 연구진이 비디오 내 특정 객체를 지울 때 그림자나 반사뿐만 아니라 객체 간의 물리적 상호작용(예: 사람이 사라지면 들고 있던 기타가 자연스럽게 바닥으로 떨어지는 현상)까지 함께 제거하는 'VOID' 모델을 공개했습니다. 이 모델은 CogVideoX를 기반으로 하며, AI가 마스크를 인식하고 비어있는 공간의 배경을 자연스럽게 채우는 비디오 인페인팅(Inpainting) 기술을 적용했습니다. 코드와 모델이 깃허브와 허깅페이스를 통해 공개되어 누구나 테스트해볼 수 있습니다.

번역된 본문

VOID: 비디오 객체 및 상호작용 삭제 (Video Object and Interaction Deletion)

저자: Saman Motamed (Netflix, INSAIT), William Harvey (Netflix), Benjamin Klein (Netflix), Luc Van Gool (INSAIT), Zhuoning Yuan (Netflix), Ta-Ying Cheng (Netflix)

개요 VOID는 비디오에서 객체를 제거할 때, 그 객체가 장면에 미치는 모든 상호작용까지 함께 삭제합니다. 단순한 2차적 효과(그림자, 반사)뿐만 아니라, 사람이 사라짐에 따라 물체가 떨어지는 것과 같은 물리적 상호작용까지 제거합니다. 이는 CogVideoX 모델을 기반으로 구축되었으며, 상호작용을 인지하는 마스크 조절(Interaction-aware mask conditioning) 기법을 적용해 비디오 인페인팅에 맞게 미세 조정(Fine-tuning)되었습니다.

예시: 기타를 들고 있는 사람을 제거하면, VOID는 사람을 지우는 것에 그치지 않고 기타에 가해지던 사람의 물리적 영향까지 삭제하여 기타가 중력을 받아 자연스럽게 바닥으로 떨어지도록 장면을 생성합니다.

🤖 모델 (Models) VOID는 순차적으로 학습된 2개의 트랜스포머(Transformer) 체크포인트를 사용합니다. Pass 1만으로도 추론(Inference)이 가능하지만, 두 단계를 모두 연결하여 실행하면 시간적 일관성(Temporal consistency)이 훨씬 더 높아집니다.

  • VOID Pass 1: 기본 인페인팅 모델 (Base inpainting model) - 허깅페이스에서 다운로드 가능
  • VOID Pass 2: 왜곡 노이즈 정제 모델 (Warped-noise refinement model) - 허깅페이스에서 다운로드 가능

체크포인트는 원하는 곳에 저장한 후, 경로를 통해 불러올 수 있습니다 (--config.video_model.transformer_path 또는 --model_checkpoint 사용).

▶️ 빠른 시작 (Quick Start) VOID를 가장 빠르게 테스트해보는 방법은 제공되는 주피터 노트북(Notebook)을 사용하는 것입니다. 이 노트북은 환경 설정, 모델 다운로드, 샘플 비디오 추론 및 결과 시각화까지 모두 자동으로 처리해 줍니다.

참고: 이 모델을 실행하려면 40GB 이상의 VRAM을 갖춘 GPU(예: NVIDIA A100)가 필요합니다. 파이프라인을 더 세밀하게 제어하고 싶다면(커스텀 비디오 사용, Pass 2 정제 적용, 마스크 직접 생성 등) 아래의 전체 설정 지침을 따르시면 됩니다.

⚙️ 설정 (Setup) 먼저 필요한 패키지를 설치합니다: pip install -r requirements.txt

마스크 파이프라인의 1단계에서는 Google AI API를 통해 Gemini 모델을 사용합니다. 아래와 같이 API 키를 설정하세요: export GEMINI_API_KEY=your_key_here

또한 마스크 생성을 위해 SAM2를 별도로 설치해야 합니다: git clone https://github.com/facebookresearch/sam2.git cd sam2 && pip install -e .

사전 학습된 기본 인페인팅 모델은 허깅페이스에서 다운로드합니다: hf download alibaba-pai/CogVideoX-Fun-V1.5-5b-InP --local-dir ./CogVideoX-Fun-V1.5-5b-InP

추론 및 학습 스크립트는 기본적으로 저장소 루트 경로 기준 ./CogVideoX-Fun-V1.5-5b-InP에 모델이 있다고 가정합니다.

시스템에 ffmpeg가 설치되어 있지 않다면, imageio-ffmpeg에 내장된 바이너리를 심볼릭 링크로 연결하여 사용할 수 있습니다.

📁 예상 디렉토리 구조 저장소를 복제하고 모든 파일을 다운로드한 후, 디렉토리 구조는 다음과 같아야 합니다:

VOID/ ├── config/ ├── datasets/ │ └── void_train_data.json ├── inference/ ├── sample/ (추론용 샘플 시퀀스 포함) ├── scripts/ ├── videox_fun/ ├── VLM-MASK-REASONER/ ├── README.md ├── requirements.txt ├── CogVideoX-Fun-V1.5-5b-InP/ (허깅페이스 다운로드) ├── void_pass1.safetensors (허깅페이스 void-model에서 다운로드) ├── void_pass2.safetensors (허깅페이스 void-model에서 다운로드) ├── training_data/ (data_generation 파이프라인을 통해 생성) └── data_generation/ (데이터 생성 코드: HUMOTO + Kubric 파이프라인)

📂 입력 형식 (Input Format) 각 비디오 시퀀스는 최상위 데이터 디렉토리 아래의 자체 폴더에 위치합니다: data_rootdir/ └── my-video/ ├── input_video.mp4 (원본 비디오) ├── quadmask_0.mp4 (4값 마스크 비디오, 하단 설명 참조) └── prompt.json ({"bg": "배경 설명"})

prompt.json에는 객체가 제거된 후의 장면, 즉 배경이 어떻게 보여야 하는지 설명하는 하나의 "bg" 키가 포함되어야 합니다. 지워지는 객체 자체를 설명하지 말고, 남아있는 배경을 설명하세요.

예시: {"bg": "탁자 위에 컵이 하나 놓여 있다."} // ✅ 깔끔한 배경을 올바르게 설명함 {"bg": "장면에서 사람이 제거되고 있다."} // ❌ 제거 과정을 설명하면 안 됨

포함된 샘플의 몇 가지 예시:

  • Sequence: lime / Removed object: the glass / bg prompt: "라임이 탁자 위로 떨어진다."
  • Sequence: moving_ball / Removed object: the rubber duckie / bg prompt: "공이 탁자에서 굴러 떨어진다."
  • Sequence: pillow / Removed object: the kettlebell being placed on the pillow / bg prompt: "탁자 위에 두 개의 베개가 있다."

쿼드 마스크(Quadmask)는 픽셀당 4개의 의미론적 영역(Semantic regions)을 인코딩합니다:

  • 값 0: 제거할 기본 객체 (Primary object to remove)
  • 값 63: 겹침 (Overlap)
원문 보기
원문 보기 (영어)
VOID: Video Object and Interaction Deletion Saman Motamed 1,2 , William Harvey 1 , Benjamin Klein 1 , Luc Van Gool 2 , Zhuoning Yuan 1 , Ta-Ying Cheng 1 1 Netflix 2 INSAIT, Sofia University "St. Kliment Ohridski" VOID removes objects from videos along with all interactions they induce on the scene — not just secondary effects like shadows and reflections, but physical interactions like objects falling when a person is removed. It is built on top of CogVideoX and fine-tuned for video inpainting with interaction-aware mask conditioning. Example: If a person holding a guitar is removed, VOID also removes the person's effect on the guitar — causing it to fall naturally. teaser-with-name.mp4 🤖 Models VOID uses two transformer checkpoints, trained sequentially. You can run inference with Pass 1 alone or chain both passes for higher temporal consistency. Model Description HuggingFace VOID Pass 1 Base inpainting model Download VOID Pass 2 Warped-noise refinement model Download Place checkpoints anywhere and pass the path via --config.video_model.transformer_path (Pass 1) or --model_checkpoint (Pass 2). ▶️ Quick Start The fastest way to try VOID is the included notebook — it handles setup, downloads the models, runs inference on a sample video, and displays the result: Note: Requires a GPU with 40GB+ VRAM (e.g., A100). For more control over the pipeline (custom videos, Pass 2 refinement, mask generation), see the full setup and instructions below. ⚙️ Setup pip install -r requirements.txt Stage 1 of the mask pipeline uses Gemini via the Google AI API. Set your API key: export GEMINI_API_KEY=your_key_here Also install SAM2 separately (required for mask generation): git clone https://github.com/facebookresearch/sam2.git cd sam2 && pip install -e . Download the pretrained base inpainting model from HuggingFace: hf download alibaba-pai/CogVideoX-Fun-V1.5-5b-InP \ --local-dir ./CogVideoX-Fun-V1.5-5b-InP The inference and training scripts expect it at ./CogVideoX-Fun-V1.5-5b-InP relative to the repo root by default. If ffmpeg is not available on your system, you can use the binary bundled with imageio-ffmpeg : ln -sf $( python -c " import imageio_ffmpeg; print(imageio_ffmpeg.get_ffmpeg_exe()) " ) ~ /.local/bin/ffmpeg 📁 Expected directory structure After cloning the repo and downloading all assets, your directory should look like this: VOID/ ├── config/ ├── datasets/ │ └── void_train_data.json ├── inference/ ├── sample/ # included sample sequences for inference ├── scripts/ ├── videox_fun/ ├── VLM-MASK-REASONER/ ├── README.md ├── requirements.txt │ ├── CogVideoX-Fun-V1.5-5b-InP/ # hf download alibaba-pai/CogVideoX-Fun-V1.5-5b-InP ├── void_pass1.safetensors # download from huggingface.co/void-model (see Models above) ├── void_pass2.safetensors # download from huggingface.co/void-model (see Models above) ├── training_data/ # generated via data_generation/ pipeline (see Training section) └── data_generation/ # data generation code (HUMOTO + Kubric pipelines) 📂 Input Format Each video sequence lives in its own folder under a root data directory: data_rootdir/ └── my-video/ ├── input_video.mp4 # source video ├── quadmask_0.mp4 # quadmask (4-value mask video, see below) └── prompt.json # {"bg": "background description"} The prompt.json contains a single "bg" key describing the scene after the object has been removed — i.e. what you want the background to look like. Do not describe the object being removed; describe what remains. { "bg" : " A table with a cup on it. " } // ✅ describes the clean background { "bg" : " A person being removed from scene. " } // ❌ don't describe the removal A few examples from the included samples: Sequence Removed object bg prompt lime the glass "A lime falls on the table." moving_ball the rubber duckie "A ball rolls off the table." pillow the kettlebell being placed on the pillow "Two pillows are on the table." The quadmask encodes four semantic regions per pixel: Value Meaning 0 Primary object to remove 63 Overlap of primary + affected regions 127 Affected region (interactions: falling objects, displaced items, etc.) 255 Background (keep) 🚀 Pipeline 🎭 Stage 1 — Generate Masks The VLM-MASK-REASONER/ pipeline generates quadmasks from raw videos using SAM2 segmentation and a VLM (Gemini) for reasoning about interaction-affected regions. 🖱️ Step 0 — Select points (GUI) python VLM-MASK-REASONER/point_selector_gui.py Load a JSON config listing your videos and instructions, then click on the objects to remove. Saves a *_points.json with the selected points. Config format: { "videos" : [ { "video_path" : " path/to/video.mp4 " , "output_dir" : " path/to/output/folder " , "instruction" : " remove the person " } ] } ⚡ Steps 1–4 — Run the full pipeline After saving the points config, run all remaining stages automatically: bash VLM-MASK-REASONER/run_pipeline.sh my_config_points.json Optional flags: bash VLM-MASK-REASONER/run_pipeline.sh my_config_points.json \ --sam2-checkpoint path/to/sam2_hiera_large.pt \ --device cuda This runs the following stages in order: Stage Script Output 1 — SAM2 segmentation stage1_sam2_segmentation.py black_mask.mp4 2 — VLM analysis stage2_vlm_analysis.py vlm_analysis.json 3 — Grey mask generation stage3a_generate_grey_masks_v2.py grey_mask.mp4 4 — Combine into quadmask stage4_combine_masks.py quadmask_0.mp4 The final quadmask_0.mp4 in each video's output_dir is ready to use for inference. 🎬 Stage 2 — Inference VOID inference runs in two passes. Pass 1 is sufficient for most videos; Pass 2 adds a warped-noise refinement step for better temporal consistency on longer clips. ✨ Pass 1 — Base inference python inference/cogvideox_fun/predict_v2v.py \ --config config/quadmask_cogvideox.py \ --config.data.data_rootdir= " path/to/data_rootdir " \ --config.experiment.run_seqs= " my-video " \ --config.experiment.save_path= " path/to/output " \ --config.video_model.model_name= " path/to/CogVideoX-Fun-V1.5-5b-InP " \ --config.video_model.transformer_path= " path/to/void_pass1.safetensors " To run multiple sequences at once, pass a comma-separated list: --config.experiment.run_seqs= " video1,video2,video3 " Key config options: Flag Default Description --config.data.sample_size 384x672 Output resolution (HxW) --config.data.max_video_length 197 Max frames to process --config.video_model.temporal_window_size 85 Temporal window for multidiffusion --config.video_model.num_inference_steps 50 Denoising steps --config.video_model.guidance_scale 1.0 Classifier-free guidance scale --config.system.gpu_memory_mode model_cpu_offload_and_qfloat8 Memory mode ( model_full_load , model_cpu_offload , sequential_cpu_offload ) The output is saved as <save_path>/<sequence_name>.mp4 , along with a *_tuple.mp4 side-by-side comparison. 🔁 Pass 2 — Warped noise refinement Uses optical flow-warped latents from the Pass 1 output to initialize a second inference pass, improving temporal consistency. Single video: python inference/cogvideox_fun/inference_with_pass1_warped_noise.py \ --video_name my-video \ --data_rootdir path/to/data_rootdir \ --pass1_dir path/to/pass1_outputs \ --output_dir path/to/pass2_outputs \ --model_checkpoint path/to/void_pass2.safetensors \ --model_name path/to/CogVideoX-Fun-V1.5-5b-InP Batch: Edit the video list and paths in inference/pass_2_refine.sh , then run: bash inference/pass_2_refine.sh Key arguments: Argument Default Description --pass1_dir — Directory containing Pass 1 output videos --output_dir ./inference_with_warped_noise Where to save Pass 2 results --warped_noise_cache_dir ./pass1_warped_noise_cache Cache for precomputed warped latents --temporal_window_size 85 Temporal window size --height / --width 384 / 672 Output resolution --guidance_scale 6.0 CFG scale --num_inference_steps 50 Denoising steps --use_quadmask True Use quadmask conditioning ✏️ Stage 3 — Manual Mask Refinement (Optional) If the auto-generated quadmask does not accurately capture the object or its interaction region, use the included GUI editor to r