Skip to content

Official Implementation for "ReMOVE: A Reference-free Metric for Object Erasure"

License

Notifications You must be signed in to change notification settings

chandrasekaraditya/ReMOVE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReMOVE

This is the official PyTorch implementation for the CVPRW 24 paper: "ReMOVE: A Reference-free Metric for Object Erasure".

ReMOVE

Requirements

This code was tested with python=3.8.18, pytorch=2.0.1 and torchvision=0.8.2. Please follow the instructions here to install PyTorch and TorchVision dependencies. Installing both PyTorch and TorchVision with CUDA support is strongly recommended.

NOTE: This codebase requires SAM to be installed. To install SAM, please follow the instructions here.

pip install git+https://github.com/facebookresearch/segment-anything.git

Getting Started

Setup

Start by downloading the model at models/url.txt (~2.4GB). Currently, main.py uses the ViT-H model, but other models can be used by modifying L49 of main.py.

wget -i models/url.txt -P models/

Usage

The main.py script takes the following arguments

  • --image_path : Path to the image.
  • --mask_path : Path to the corresponding mask.
  • --crop (optional) : Crops the image using a bounding box around the object mask.
  • --draw (optional) : Draws a bounding box around the object (saved to masked.png) if --crop is used.

A set of sample images with objects removed using various methods are provided in ./examples/.

Bad Inpainting

BAD

python main.py -i 'examples/sdinpaint/823000000001.jpg' -m 'examples/masks/823000000001.jpg'
python main.py -i 'examples/sdinpaint/823000000001.jpg' -m 'examples/masks/823000000001.jpg' --crop

Good Inpainting

GOOD

python main.py -i 'examples/sdinpaint/122000000009.jpg' -m 'examples/masks/122000000009.jpg'
python main.py -i 'examples/sdinpaint/122000000009.jpg' -m 'examples/masks/122000000009.jpg' --crop

Citation

If you use ReMOVE or find this work useful for your research, please use the following BibTeX entry.

@InProceedings{Chandrasekar_2024_CVPR,
    author    = {Chandrasekar$^*$, Aditya and Chakrabarty$^*$, Goirik and Bardhan, Jai and Hebbalaguppe, Ramya and AP, Prathosh},
    title     = {ReMOVE: A Reference-free Metric for Object Erasure},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    month     = {June},
    year      = {2024}
}

About

Official Implementation for "ReMOVE: A Reference-free Metric for Object Erasure"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages