All Projects → sujaykhandekar → Automated-objects-removal-inpainter

sujaykhandekar / Automated-objects-removal-inpainter

Licence: other
Automated object remover Inpainter is a project that combines Semantic segmentation and EdgeConnect architectures with minor changes in order to remove specified object/s from list of 20 objects from all the input photos

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Automated-objects-removal-inpainter

LightNet
LightNet: Light-weight Networks for Semantic Image Segmentation (Cityscapes and Mapillary Vistas Dataset)
Stars: ✭ 710 (+706.82%)
Mutual labels:  semantic-segmentation, deeplabv3
TF SemanticSegmentation
Semantic image segmentation network with pyramid atrous convolution and boundary-aware loss for Tensorflow.
Stars: ✭ 26 (-70.45%)
Mutual labels:  semantic-segmentation, deeplabv3
Segmentation models.pytorch
Segmentation models with pretrained backbones. PyTorch.
Stars: ✭ 4,584 (+5109.09%)
Mutual labels:  semantic-segmentation, deeplabv3
night image semantic segmentation
[ICIP 2019] : This is the official github repository for the paper "What's There in The Dark" accepted in IEEE International Conference in Image Processing 2019 (ICIP19) , Taipei, Taiwan.
Stars: ✭ 25 (-71.59%)
Mutual labels:  semantic-segmentation, deeplabv3
Mmsegmentation
OpenMMLab Semantic Segmentation Toolbox and Benchmark.
Stars: ✭ 2,875 (+3167.05%)
Mutual labels:  semantic-segmentation, deeplabv3
SAFNet
[IROS 2021] Implementation of "Similarity-Aware Fusion Network for 3D Semantic Segmentation"
Stars: ✭ 19 (-78.41%)
Mutual labels:  semantic-segmentation
ESANet
ESANet: Efficient RGB-D Semantic Segmentation for Indoor Scene Analysis
Stars: ✭ 154 (+75%)
Mutual labels:  semantic-segmentation
LinkNet tensorflow
TensorFlow implementation of LinkNet
Stars: ✭ 16 (-81.82%)
Mutual labels:  semantic-segmentation
FaPN
[ICCV 2021] FaPN: Feature-aligned Pyramid Network for Dense Image Prediction
Stars: ✭ 173 (+96.59%)
Mutual labels:  semantic-segmentation
AttaNet
AttaNet for real-time semantic segmentation.
Stars: ✭ 37 (-57.95%)
Mutual labels:  semantic-segmentation
GrabCut-Annotation-Tool
OpenCVのGrabCut()を利用したセマンティックセグメンテーション向けアノテーションツール(Annotation tool using GrabCut() of OpenCV. It can be used to create datasets for semantic segmentation.)
Stars: ✭ 27 (-69.32%)
Mutual labels:  semantic-segmentation
external-internal-inpainting
[CVPR 2021] EII: Image Inpainting with External-Internal Learning and Monochromic Bottleneck
Stars: ✭ 95 (+7.95%)
Mutual labels:  inpainting
map-floodwater-satellite-imagery
This repository focuses on training semantic segmentation models to predict the presence of floodwater for disaster prevention. Models were trained using SageMaker and Colab.
Stars: ✭ 21 (-76.14%)
Mutual labels:  semantic-segmentation
CAP augmentation
Cut and paste augmentation for object detection and instance segmentation
Stars: ✭ 93 (+5.68%)
Mutual labels:  semantic-segmentation
awesome-generative-deep-art
A curated list of generative deep learning tools, works, models, etc. for artistic uses
Stars: ✭ 172 (+95.45%)
Mutual labels:  inpainting
hyperseg
HyperSeg - Official PyTorch Implementation
Stars: ✭ 174 (+97.73%)
Mutual labels:  semantic-segmentation
MINet
Multi-scale Interaction for Real-time LiDAR Data Segmentation on an Embedded Platform (RA-L)
Stars: ✭ 28 (-68.18%)
Mutual labels:  semantic-segmentation
semantic-segmentation
SOTA Semantic Segmentation Models in PyTorch
Stars: ✭ 464 (+427.27%)
Mutual labels:  semantic-segmentation
Swin-Transformer-Semantic-Segmentation
This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" on Semantic Segmentation.
Stars: ✭ 856 (+872.73%)
Mutual labels:  semantic-segmentation
unet-pytorch
This is the example implementation of UNet model for semantic segmentations
Stars: ✭ 17 (-80.68%)
Mutual labels:  semantic-segmentation

Automated-Objects-Removal-Inpainter

Demo and Docker image on Replicate

Automated object remover Inpainter is a project that combines Semantic segmentation and EdgeConnect architectures with minor changes in order to remove specified objects from photos. For Semantic Segmentation, the code from pytorch has been adapted, whereas for EdgeConnect, the code has been adapted from https://github.com/knazeri/edge-connect.

This project is capable of removing objects from list of 20 different ones.It can be use as photo editing tool as well as for Data augmentation.

Python 3.8.5 and pytorch 1.5.1 have been used in this project.

How does it work?

Semantic segmenator model of deeplabv3/fcn resnet 101 has been combined with EdgeConnect. A pre-trained segmentation network has been used for object segmentation (generating a mask around detected object), and its output is fed to a EdgeConnect network along with input image with portion of mask removed. EdgeConnect uses two stage adversarial architecture where first stage is edge generator followed by image completion network. EdgeConnect paper can be found here and code in this repo

Prerequisite

  • python 3
  • pytorch 1.0.1 <
  • NVIDIA GPU + CUDA cuDNN (optional)

Installation

  • clone this repo
git clone https://github.com/sujaykhandekar/Automated-objects-removal-inpainter.git
cd Automated-objects-removal-inpainter

or alternately download zip file.

  • install pytorch with this command
conda install pytorch==1.5.1 torchvision==0.6.1 -c pytorch
  • install other python requirements using this command
pip install -r requirements.txt
  • Install one of the three pretrained Edgeconnect model and copy them in ./checkpoints directory
    Plcaes2 (option 1) CelebA (option 2) Paris-street-view (option 3)

or alternately you can use this command:

bash ./scripts/download_model.sh

Prediction/Test

For quick prediction you can run this command. If you don't have cuda/gpu please run the second command.

python test.py --input ./examples/my_small_data --output ./checkpoints/resultsfinal --remove 3 15

It will take sample images in the ./examples/my_small_data directory and will create and produce result in directory ./checkpoints/resultsfinal. You can replace these input /output directories with your desired ones. numbers after --remove specifies objects to be removed in the images. ABove command will remove 3(bird) and 15(people) from the images. Check segmentation-classes.txt for all removal options along with it's number.

Output images will all be 256x256. It takes around 10 minutes for 1000 images on NVIDIA GeForce GTX 1650

for better quality but slower runtime you can use this command

python test.py --input ./examples/my_small_data --output ./checkpoints/resultsfinal --remove 3 15 --cpu yes

It will run the segmentation model on cpu. It will be 5 times slower than on gpu (default) For other options inclduing different segmentation model and EdgeConnect parameters to change please make corresponding modifications in .checkpoints/config.yml file

training

For trainig your own segmentation model you can refer to this repo and replace .src/segmentor_fcn.py with your model.

For training Edgeconnect model plaese refer to orignal EdgeConnect repo after training you can copy your model weights in .checkpoints/

some results

Next Steps

  • pretrained EdgeConnect models used in this project are trained on 256 x256 images. To make output images of the same size as input two approaches can be used. You can train your own Edgeconnect model on bigger images.Or you can create subimages of 256x256 for every object detected in the image and then merge them back together after passing through edgeconnect to reconstruct orignal sized image.Similar approach has been used in this repo
  • To detect object not present in segmentation classes , you can train your own segmentation model or you can use pretrained segmentation models from this repo, which has 150 different categories available.
  • It is also possible to combine opnecv's feature matching and edge prediction from EdgeConnect to highlight and create mask for relvant objects based on single mask created by user. I may try this part myself.

License

Licensed under a Creative Commons Attribution-NonCommercial 4.0 International.

Except where otherwise noted, this content is published under a CC BY-NC license, which means that you can copy, remix, transform and build upon the content as long as you do not use the material for commercial purposes and give appropriate credit and provide a link to the license.

Citation

@inproceedings{nazeri2019edgeconnect,
  title={EdgeConnect: Generative Image Inpainting with Adversarial Edge Learning},
  author={Nazeri, Kamyar and Ng, Eric and Joseph, Tony and Qureshi, Faisal and Ebrahimi, Mehran},
  journal={arXiv preprint},
  year={2019},
}

@InProceedings{Nazeri_2019_ICCV,
  title = {EdgeConnect: Structure Guided Image Inpainting using Edge Prediction},
  author = {Nazeri, Kamyar and Ng, Eric and Joseph, Tony and Qureshi, Faisal and Ebrahimi, Mehran},
  booktitle = {The IEEE International Conference on Computer Vision (ICCV) Workshops},
  month = {Oct},
  year = {2019}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].