Giter VIP home page Giter VIP logo

soumik12345 / mirnet Goto Github PK

View Code? Open in Web Editor NEW
112.0 112.0 36.0 28.58 MB

Tensorflow implementation of MIRNet for Low-light image enhancement

Home Page: https://huggingface.co/spaces/keras-io/Enhance_Low_Light_Image

License: Apache License 2.0

Python 0.11% Jupyter Notebook 99.89% Shell 0.01%
computer-vision deep-learning image-restoration low-light-image-enhancement mirnet streamlit streamlit-webapp tensorflow tensorflow2

mirnet's Introduction

MIRNet

Tensorflow implementation of the MIRNet architecture as proposed by Learning Enriched Features for Real Image Restoration and Enhancement.

Lanuch Notebooks: Binder

Wandb Logs: https://wandb.ai/19soumik-rakshit96/mirnet

Blog Post: https://keras.io/examples/vision/mirnet/

TFLite Variant of MIRNet: https://github.com/sayakpaul/MIRNet-TFLite.

TFLite Models on Tensorflow Hub: https://tfhub.dev/sayakpaul/lite-model/mirnet-fixed/dr/1.

Tensorflow JS Variant of MIRNet: https://github.com/Rishit-dagli/MIRNet-TFJS.

Pre-trained Weights

Citation

@misc{
    2003.06792,
    Author = {Syed Waqas Zamir and Aditya Arora and Salman Khan and Munawar Hayat and Fahad Shahbaz Khan and Ming-Hsuan Yang and Ling Shao},
    Title = {Learning Enriched Features for Real Image Restoration and Enhancement},
    Year = {2020},
    Eprint = {arXiv:2003.06792},
}

mirnet's People

Contributors

soumik12345 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mirnet's Issues

Huge memory needed ?

Hello, I successfully enhanced a part of an image with your tool however even with 32Go of ram I can't use it on a photo, is htere a way to automaticaly process the image in several parts ?

mirnet.inference.Inferer gives error

I have watch the youtube video https://www.youtube.com/watch?v=b5Uz_c0JLMs from Bhavesh Bhatt and copy the notebook.
I only used my own picture (see attachment)

The code

from glob import glob
import tensorflow as tf
import numpy as np
from matplotlib import pyplot as plt
from mirnet.inference import Inferer
from mirnet.utils import download_dataset, plot_result
from PIL import Image

inferer = Inferer()
inferer.download_weights('1sUlRD5MTRKKGxtqyYDpTv7T3jOW6aVAL')
inferer.build_model(
    num_rrg=3, num_mrb=2, channels=64,
    weights_path='low_light_weights_best.h5'
)

#inferer.model.summary()

inferer.model.save('mirnet')

IMAGE_LOC = 'IMG_3598_resize3.jpg'

print("image converteren..")
original_image, output_image = inferer.infer(IMAGE_LOC)
plot_result(original_image, output_image)

But i get an error on the code -> original_image, output_image = inferer.infer(IMAGE_LOC)
I used a jpeg file of 22.8 KB with width=600 and height=337 pixels and I get the following error:

InvalidArgumentError Traceback (most recent call last)

in ()
----> 1 original_image, output_image = inferer.infer(IMAGE_LOC)
2 plot_result(original_image, output_image)

7 frames

/usr/local/lib/python3.6/dist-packages/tensorflow/python/eager/execute.py in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
58 ctx.ensure_initialized()
59 tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 60 inputs, attrs, num_outputs)
61 except core._NotOkStatusException as e:
62 if name is not None:

InvalidArgumentError: Incompatible shapes: [1,337,600,64] vs. [1,336,600,64]
[[node model_1/add_180/add (defined at /content/MIRNet/mirnet/inference.py:39) ]] [Op:__inference_predict_function_126722]

Function call stack:
predict_function

IMG_3598_resize3

I have also try with different sizes but I get similar errors.

I used google colab

Any idea why it is not working..

Thanks sofar.

Henk

Image quality get reduced.

Hi, when I pass my image without resizing, then I get error,
But after doing resizing to (1560, 2080) it's working fine but image quality gets reduced.
How I will solve this issue??

Not able to save the model after training on local dataset.

Tried saving with .h5 as well as the .pb extension.

`---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[21], line 1
----> 1 model.save('mirnet.h5')

File ~\anaconda3\envs\tf\lib\site-packages\keras\utils\traceback_utils.py:70, in filter_traceback.<locals>.error_handler(*args, **kwargs)
     67     filtered_tb = _process_traceback_frames(e.__traceback__)
     68     # To get the full stack trace, call:
     69     # `tf.debugging.disable_traceback_filtering()`
---> 70     raise e.with_traceback(filtered_tb) from None
     71 finally:
     72     del filtered_tb

File ~\anaconda3\envs\tf\lib\site-packages\keras\utils\generic_utils.py:545, in serialize_keras_object(instance)
    543     raise e
    544 serialization_config = {}
--> 545 for key, item in config.items():
    546     if isinstance(item, str):
    547         serialization_config[key] = item

AttributeError: 'NoneType' object has no attribute 'items`

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.