Giter Site home page Giter Site logo

hiepgaf / image-enhancement Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dafun/image-enhancement

0.0 2.0 0.0 11.01 MB

Image enhancement by deep learning and tensorflow mobile.

Home Page: http://photo-ai.surge.sh/

Python 55.96% C++ 36.02% C 1.13% CSS 2.18% HTML 2.18% JavaScript 2.53%

image-enhancement's Introduction

Real-time image enhancement DL android App and web App

An deep learning project focusing on deploying pretrained models on mobile device and cloud. It's implemented during 3 weeks Insight AI fellowship program.

The pretrained models give credit to Deep Bilateral Learning for Real-Time Image Enhancement

Setup

Dependencies

To install the Python dependencies, run:

pip install -r requirements.txt

Usage

To download the pretrained models, please refer to Deep Bilateral Learning for Real-Time Image Enhancement

To prepare a model for use on mobile, freeze the graph, and optimize the network:

./scripts/freeze_graph.py <checkpoint_dir>
./scripts/optimize_graph.py <checkpoint_dir>

To test the prepares model for use on web app or mobile:

./scripts/test_pb_graph.py <chechpoint_dir>

Serving the Hdrnet model on cloud

Now this web app 'photoAI' are serving 3 different pretrained models: face brightening, edge enhancing, hdr+

Deloy Hdrnet model on android by Tensorflow mobile

In order to deploy this model on android, I have to implement a custom tensorflow op (CUDA version) by opencl so that the op can run on mobile. Need to clean some code, to be updated.

Inference performance comparison with and without XLA

Some tests with XLA fused operation optimization. Images below shows tests with 1 batch (20) 1500*1000 pictures. Didn't see any improvements by using XLA. I think there are mainly two reasons: bilateralSliceApply is a very heavy computation custom op, and cannot be fused by XLA; XLA is still at early stage.

Inference without XLA JIT

Inference with XLA JIT

Known issues and limitations

  • Tensorflow mobile doesn't support custom op, especially for ops implemented in CUDA. The hdrnet model used a custom op - BilateralSliceApply op - is GPU only.

  • The pre-trained HDR+ model trained on a specially formatted 16-bit linear input. When feeding general images will receive outputs with weird color.

image-enhancement's People

Contributors

dafun avatar

Watchers

James Cloos avatar HiepTran 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.