Coder Social home page Coder Social logo

thembamah / mirnet-tfjs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rishit-dagli/mirnet-tfjs

0.0 1.0 0.0 15.29 MB

TensorFlow JS models for MIRNet for low-lightπŸ’‘ image enhancement

Home Page: https://rishit-dagli.github.io/MIRNet-TFJS/

License: Apache License 2.0

JavaScript 0.07% CSS 0.01% HTML 0.02% Jupyter Notebook 99.90%

mirnet-tfjs's Introduction

MIRNet-TFJS Twitter URL

Deploy Node.js app Open TF Hub Binder Open In Colab

GitHub license GitHub followers GitHub stars GitHub forks Twitter Follow

Featured on TensorFlow.JS Show And Tell

This repository shows the TFJS model conversion and inference processes for the for the MIRNet model as proposed by Learning Enriched Features for Real Image Restoration and Enhancement by Zamir et al. This model is capable of enhancing low-light images upto a great extent.

Examples

Model training code and pre-trained weights are provided by Soumik through this repository.

Table of contents

A bit about the architecture

The MIRNet presents a novel architecture with the collective goals of maintaining high-resolution representations through the entire network, and receiving strong contextual information from the low-resolution representations.

The core of this approach is a multi-scale residual block containing the following key elements:

  • parallel multi-resolution convolution streams for extracting multi-scale features
  • information exchange across the multi-resolution streams
  • spatial and channel attention mechanisms for capturing contextual information
  • attention based multi-scale feature aggregation.

Framework of MIRNet

The figure above shows the framework of the proposed network MIRNet that learns enriched feature representations for image restoration and enhancement.

About the notebooks

Binder Open In Colab

This notebook shows the the process of downloading pre-trained weights for the MIRNet model and saving it as a SavedModel.

Binder Open In Colab

This notebook shows the the process of converting the SavedModel to the TFJS format we built in the prequel notebook for the MIRNet model. It also shows performing optimizations on this.

Binder Open In Colab

This notebook shows the the process of inferencing for the MIRNet model on a couple of low light photos.

Running the TFJS Model, An example

The code for the example can be found under the example folder in this repo. As of now this example is a very minimalistic one as you can see in the below image. The example website is deployed on the free tier of Azure App Services so inferences could take quite some time (90 seconds or so) when a lot of folks might be using it at the same time. Since this project deploys on the free tier of Azure App Services, the hosted website couldd go down when a lot of users might be trying it out and the easiest way would be to follow the instructions to do so on a GitHub Codespace or on your own machine where inferences would be a lot more faster.

Getting Started

To get up and running with this example, run the following commands, make sure you have Node.js installed.

git clone [email protected]:Rishit-dagli/MIRNet-TFJS.git # or clone your own fork
cd MIRNet-TFJS

After cloning the repository you would need to download the model variables file Download and place it at example/model/variables/variables.data-00000-of-00001, this step has been covered in the below commands however you can also do this through GUI. Run these commands after doing so:

wget -O ./example/model/variables/variables.data-00000-of-00001 https://github.com/Rishit-dagli/MIRNet-TFJS/releases/download/v0.1.0/variables.data-00000-of-00001
cd example # switch to the example folder
npm install
npm start

Your app should now be running on localhost:3000 πŸš€.

Run online on Repl.it

Alternatively you could also get up and running with this example with the free to use online service Repl.it. Get started by clicking on this button Run on Repl.it after which you would click the Run button on the top or run npm start and voila your app is now running πŸš€.

Troubleshooting

The example folder has a standalone modeltest.js file, which tries to run the model on a specified file and then save the output to test the model. You can test the model with this file through:

git clone [email protected]:Rishit-dagli/MIRNet-TFJS.git # or clone your own fork
cd MIRNet-TFJS
cd example # switch to the example folder
npm install
node modeltest.js

The modeltest.js uses the input.PNG image file in the root directory and outputs a output.Png image file.

Want to Contribute πŸ™‹β€β™‚οΈ?

Awesome! If you want to contribute to this project, you're always welcome! See Contributing Guidelines. You can also take a look at MIRNet-TFJS' Project Status Tracker for getting more information about current or upcoming tasks.

Want to discuss? πŸ’¬

Have any questions, doubts or want to present your opinions, views? You're always welcome. You can start discussions.

Contributors

License

Copyright 2020 Rishit Dagli

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

mirnet-tfjs's People

Contributors

rishit-dagli avatar

Watchers

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