All Projects → javirk → Person_remover

javirk / Person_remover

Licence: apache-2.0
People removal in images using Pix2Pix and YOLO.

Projects that are alternatives of or similar to Person remover

Tensorflow2.0 Examples
🙄 Difficult algorithm, Simple code.
Stars: ✭ 1,397 (+1355.21%)
Mutual labels:  jupyter-notebook, yolov3, pix2pix
Machine Learning From Scratch
Succinct Machine Learning algorithm implementations from scratch in Python, solving real-world problems (Notebooks and Book). Examples of Logistic Regression, Linear Regression, Decision Trees, K-means clustering, Sentiment Analysis, Recommender Systems, Neural Networks and Reinforcement Learning.
Stars: ✭ 42 (-56.25%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Coursera Natural Language Processing Specialization
Programming assignments from all courses in the Coursera Natural Language Processing Specialization offered by deeplearning.ai.
Stars: ✭ 39 (-59.37%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Brihaspati
Collection of various implementations and Codes in Machine Learning, Deep Learning and Computer Vision ✨💥
Stars: ✭ 53 (-44.79%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Particle Filter Prototype
Particle Filter Implementations in Python and C++, with lecture notes and visualizations
Stars: ✭ 29 (-69.79%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Gaze Estimation
A deep learning based gaze estimation framework implemented with PyTorch
Stars: ✭ 33 (-65.62%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Onnx tflite yolov3
A Conversion tool to convert YOLO v3 Darknet weights to TF Lite model (YOLO v3 PyTorch > ONNX > TensorFlow > TF Lite), and to TensorRT (YOLO v3 Pytorch > ONNX > TensorRT).
Stars: ✭ 52 (-45.83%)
Mutual labels:  jupyter-notebook, yolov3
Machine Learning Experiments
🤖 Interactive Machine Learning experiments: 🏋️models training + 🎨models demo
Stars: ✭ 841 (+776.04%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Imagenet
Trial on kaggle imagenet object localization by yolo v3 in google cloud
Stars: ✭ 56 (-41.67%)
Mutual labels:  jupyter-notebook, yolov3
Mit Deep Learning
Tutorials, assignments, and competitions for MIT Deep Learning related courses.
Stars: ✭ 8,912 (+9183.33%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Phormatics
Using A.I. and computer vision to build a virtual personal fitness trainer. (Most Startup-Viable Hack - HackNYU2018)
Stars: ✭ 79 (-17.71%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Deep Learning Experiments
Notes and experiments to understand deep learning concepts
Stars: ✭ 883 (+819.79%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Pandas Profiling
Create HTML profiling reports from pandas DataFrame objects
Stars: ✭ 8,329 (+8576.04%)
Mutual labels:  artificial-intelligence, jupyter-notebook
True artificial intelligence
真AI人工智能
Stars: ✭ 38 (-60.42%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Awesome Ai Books
Some awesome AI related books and pdfs for learning and downloading, also apply some playground models for learning
Stars: ✭ 855 (+790.63%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Computervision Recipes
Best Practices, code samples, and documentation for Computer Vision.
Stars: ✭ 8,214 (+8456.25%)
Mutual labels:  artificial-intelligence, jupyter-notebook
60 days rl challenge
60_Days_RL_Challenge中文版
Stars: ✭ 92 (-4.17%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Daily Neural Network Practice 2
Daily Dose of Neural Network that Everyone Needs
Stars: ✭ 18 (-81.25%)
Mutual labels:  artificial-intelligence, jupyter-notebook
All Classifiers 2019
A collection of computer vision projects for Acute Lymphoblastic Leukemia classification/early detection.
Stars: ✭ 22 (-77.08%)
Mutual labels:  artificial-intelligence, jupyter-notebook
Notebooks
Some notebooks
Stars: ✭ 53 (-44.79%)
Mutual labels:  artificial-intelligence, jupyter-notebook

Person Remover

Versión en español disponible aquí.

Would you like to travel to a touristic spot and yet appear alone in the photos?

Person remover is a project that combines Pix2Pix and YOLO arhitectures in order to remove people or other objects from photos. For Pix2Pix, the code from Tensorflow has been adapted, whereas for YOLO, the code has been adapted from https://github.com/zzh8829/yolov3-tf2.

This project is capable of removing objects in images and video.

Python 3.7 and Tensorflow 2.0-beta have been used in this project.

Try it in Google Colab.

How does it work?

YOLO has been combined with Pix2Pix. A pre-trained YOLO network has been used for object detection (generating a bounding box around them), and its output is fed to a Pix2Pix's generator that has learned how to fill holes in the center of images, using the images without holes as a reference:

  1. YOLO detects the objects
  2. A subimage of every object is taken, adding the pixels around it
  3. Out of every subimage, the center pixels are removed (replaced by ones) and the result is sent to the generator, whose task is to fill it with the surrounding pixels.

In order to illustrate the training process of Pix2Pix, the following images can be observed. A hole has been drilled and the generator has learnt how to fill it.

p2p_fill_1 p2p_fill_2

These instructions will you train a model in your local machine. However, the training dataset that has been used for Pix2Pix are not publicly available. This dataset consists of 14900, 256x256x3 images. The code handles the creation of a hole in the center of the images and learns how to fill it with the surrounding data.

Requisites

In order to use the program Python 3.7 and the libraries specified in requirements.txt should be installed.

Installation

Clone the repository

git clone https://github.com/javirk/Person_remover.git

Download and save the YOLO weights in the folder ./yolo, convert them and move them to ./yolo/data

wget https://pjreddie.com/media/files/yolov3.weights -O data/yolov3.weights
python convert.py

Download the weights for Pix2Pix from Google Drive and put them in ./pix2pix/checkpoint/.

To get results of images, run person_remover.py:

python person_remover.py -i /dir/of/input/images

In a video, in contrast:

python person_remover.py -v /dir/of/video

It is also possible to specify the type of object to remove (people, bags and handbags are chosen by default):

python person_remover.py -i /dir/to/input/images -ob 1 2 3

Which will remove the objects specified as 1, 2 and 3 (starting from 0) that appear in the file yolo/data/coco.names. In this case bikes, cars and motorbikes.

Training

YOLO network is taken pretrained. For Pix2Pix networks, the training has spanned 23 epochs in a dataset of 14900 training and 100 test images using the default parameters. It is worth noticing that the training process is extremely sensitive, so the best results might not come in the first run.

Training with the default parameters is performed as follows:

python image_inpainting.py -train /dir/of/training/images -test /dir/of/test/images -mode /train

Image removal

p2p_fill_3 p2p_fill_4 p2p_fill_5 p2p_fill_6 p2p_fill_7 p2p_fill_8 p2p_fill_9 p2p_fill_10

Video removal

A walking tour of Paris video has been used.

p2p_fill_11

Next steps

Results can be improved replacing the object detector network (YOLO) by a semantic segmentator. In this way, the generator will have to fill just the part relative to the person, not the whole bounding box. Due to a matter of time and processing capacity, this improvement could not be developed yet.

Modification of Pix2Pix by a more advanced architecture, such as Pix2PixHD.

Author

License

This project is under Apache license. See LICENSE.md for more details.

Acknowledgments

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].