GithubHelp home page GithubHelp logo

csq20081052 / camerablur Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gauravv97/camerablur

0.0 0.0 0.0 63.63 MB

Android app for blurring image background using machine learning

License: Apache License 2.0

Java 100.00%

camerablur's Introduction

CameraBlur:Portrait mode using DeeplabV3+ Semantic Image Segmentation

A simple android app to implement Portrait mode using a single sensor like in Pixel 2 (well not exactly exactly like Pixel 2's). This app allows you to either click image from your phone or select an image from storage and apply the blur. This app can run on ARM32 bit ARM v7A as well as ARM64 ARMv8-A.

Downloads

Download apk from here

Demo

Demo

Some Samples



Features

  • Select image from storage or click them using camera
  • Blur a variety of subjects (most centered subject will be selected rest will be background).
  • SoftBlur around edges

For developers

I have 3 pre-trained models of different crop sizes Default 1025 px. You can use any one of them but with increased crop size the processing time also increases (by a lot), so use them as per your requirement. Crop size is the size of the image that the input image will be resized to and sent for processing. The output dimensions are always less than crop size.

For using 1536 px: Copy InputSize 1536px\frozen_inference_graph.pband paste it in CameraBlur\app\src\main\assets\.

Then change CameraBlur\app\src\main\java\com\anondev\gaurav\camerablur\DeeplabProcessor.javaline 28

From

public final static int INPUT_SIZE = 1025;

to

public final static int INPUT_SIZE = 1536; 

Todo

  • Use Android RenderScript for blurring images(Soon).
  • Will add feature to edit the depth of feild in the gallery by the end of this year ( don't know how ๐Ÿ˜‚ but will definitely do it).
  • Implement tensorflow lite (not possible until tensorflow can quantize deeplabv3 plus model).

Attributions/Thanks/External code

This application wouldn't have been possible without the great material produced by the community. I would like to give special thanks to the authors of essential parts I've got on the internet and used in the code.:

  • DeepLabv3+:
@article{deeplabv3plus2018,
  title={Encoder-Decoder with Atrous Separable Convolution for Semantic Image Segmentation},
  author={Liang-Chieh Chen and Yukun Zhu and George Papandreou and Florian Schroff and Hartwig Adam},
  journal={arXiv:1802.02611},
  year={2018}
}
  • MobileNetv2:
@inproceedings{mobilenetv22018,
  title={Inverted Residuals and Linear Bottlenecks: Mobile Networks for Classification, Detection and Segmentation},
  author={Mark Sandler and Andrew Howard and Menglong Zhu and Andrey Zhmoginov and Liang-Chieh Chen},
  booktitle={CVPR},
  year={2018}
}

Photo Credits

About

Copyright 2018 Gaurav Chaudhari, and licensed under the Apache License, Version 2.0. No attribution is necessary but it's very much appreciated. Star this project if you like it!

camerablur's People

Contributors

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