soumik12345 / mirnet Goto Github PK
View Code? Open in Web Editor NEWTensorflow 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
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
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
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
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`
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??
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 ?
Hey i can't download pre-trained weight even yu provide a link of TFLite (mirnet-fixed/dr) but didn't work should have the pretrained model please help me i need this for my studies
hello,
the Pre-trained Weights are not available anymore, pls recheck it!
can you send it to my email: [email protected]
thank you very much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.