Coder Social home page Coder Social logo

deep-in-painting's Introduction

DeMAT: Diffusion-enhanced Mask Aware Transformer for Deep Generative In-painting

Overview

DeMAT (Diffusion-enhanced Mask Aware Transformer) is a novel approach to deep generative in-painting. This project addresses the challenge of filling in missing regions in images, which is crucial for image editing, re-targeting, restoration, and object removal.

Background

Our approach leverages the latest advancements in transformer architecture and deep learning to model non-local relationships, effectively overcoming the limitations of traditional CNNs in complex in-painting tasks. By integrating techniques from the Mask Aware Transformer (MAT) and Variational Autoencoder, DeMAT excels in reconstructing high-resolution images where masked areas are seamlessly reconstructed or transformed.

Setup and Installation

Prerequisites

  • Anaconda or Miniconda
  • Python 3.7

Set up the environment

Before proceeding with the setup, ensure you have a working Conda environment with Python 3.7. To create a new environment, run:

conda create -n demat-env python=3.7
conda activate demat-env

After this, you need to install the requirements from the root directory and the requirements under MAT directory. To do that, run:

cd MAT
pip install -r requirements.txt
cd ..
pip install -r requirements.txt

Next, you have to install pytorch from this website

Usage

MAT

To run MAT training and inference, follow the instruction from README.md from MAT directory.

VAE

The code for running VAE encoder and decoder is available under transformation.py script. You need to download the pre-trained VAE from huggingface. Download the vae directory and put it inside MAT directory.

Note

The MAT directory contains the cloned repository of the implementation of the original MAT: Mask-Aware Transformer for Large Hole Image Inpainting paper. The train_test_split.py and encode_vae.py are not from the original repository. Those are a helper scripts to do training using our dataset.

deep-in-painting's People

Contributors

kelvinc123 avatar jaisalkothari avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.