CoolFace
Apppublic

Zhixianvsdgdsg/context-aware-attentive-eraser

sourceHugging Faceapache-2.0updated 23d agoView on Hugging Face
0likes
App README

Context-Aware Attentive Eraser

An experimental, visualization-first extension of Attentive Eraser (AAAI 2025 Oral) for mask-guided object removal.

Proposed innovation: CAMS

The paper uses fixed removal guidance (s=9) and similarity suppression (lambda=0.3) and reports two limitations: two U-Net evaluations per denoising step, and degraded reconstruction for very large masks. This project proposes Context-Adaptive Multi-stage Scheduling (CAMS):

  1. 1.measure mask ratio, boundary complexity, and texture in a ring around the mask;
  2. 2.adapt removal guidance, similarity suppression, inpainting strength, and schedule boundaries;
  3. 3.expose a late-step cutoff for future single-branch execution to reduce redundant U-Net work;
  4. 4.warn when the mask leaves too little background context.

CAMS is a research hypothesis. The repository does not claim benchmark gains until the evaluation plan below has been run.

Run

bash
pip install -r requirements.txt
python app.py

Without CUDA the UI runs in analysis mode and visualizes the adaptive schedule. With CUDA it lazily loads the Hugging Face Diffusers community pipeline and enables image generation.

Evaluation plan

  • —Dataset: the same 10,000 OpenImages V5 test pairs used by the paper.
  • —Baselines: fixed s=9, lambda=0.3; CAMS; CAMS without texture adaptation; CAMS without late cutoff.
  • —Metrics: Local-FID, CLIP background score, CLIP consensus across seeds 123/321/777, LPIPS outside the mask, and runtime/peak VRAM.
  • —Stratify results by mask ratio: 0-10%, 10-25%, 25-45%, and >45%.
  • —Report confidence intervals and all failure cases; do not select only favorable examples.

Attribution

Based on the method described in:

Wenhao Sun, Benlei Cui, Xue-Mei Dong, Jingqun Tang. “Attentive Eraser: Unleashing Diffusion Model's Object Removal Potential via Self-Attention Redirection Guidance.” AAAI 2025.

Official implementation: https://github.com/Anonym0u3/AttentiveEraser Paper: https://arxiv.org/abs/2412.12974

This extension is released under Apache-2.0. Model access and use remain subject to the upstream model licenses.