Spaces:
Runtime error
Runtime error
srini
Browse files- README.md +7 -6
- app.py +33 -0
- demo.ipynb +0 -0
- examples/179.png +0 -0
- examples/493.png +0 -0
- examples/780.png +0 -0
- examples/download (1).jpeg +0 -0
- examples/download.jpeg +0 -0
- examples/images.jpeg +0 -0
- examples/maxresdefault-5.jpg +0 -0
- flagged/image/00c0b6fae2795359e4034106d24549524c20bb73/tmp6vbkl584.jpg +0 -0
- flagged/log.csv +2 -0
- flagged/output/dfcc422fa1fa79820b754c53b6e09005bf18670e/tmpdobzgmka.png +0 -0
- gradio_cached_examples/14/log.csv +4 -0
- gradio_cached_examples/14/output/0babb09c817eb7b98bf8f50bf49a44ad2bd9f7ed/tmpsnf4flud.png +0 -0
- gradio_cached_examples/14/output/56f2184e2380260185bcf447443ffedc95b0b4d6/tmpnfpf3uup.png +0 -0
- gradio_cached_examples/14/output/db430b92035825a72ee6bd423ad33cf8730c9cf9/tmpiynf6d01.png +0 -0
- model.h5 +3 -0
- requirements.txt +2 -0
README.md
CHANGED
@@ -1,12 +1,13 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
|
|
10 |
---
|
11 |
|
12 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces
|
|
|
1 |
---
|
2 |
+
title: Enhance Low Light Image with MIRNet
|
3 |
+
emoji: π
|
4 |
+
colorFrom: indigo
|
5 |
+
colorTo: pink
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.9
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
+
duplicated_from: keras-io/Enhance_Low_Light_Image
|
11 |
---
|
12 |
|
13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
app.py
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import numpy as np
|
2 |
+
import gradio as gr
|
3 |
+
from PIL import Image
|
4 |
+
import keras
|
5 |
+
from huggingface_hub import from_pretrained_keras
|
6 |
+
|
7 |
+
|
8 |
+
model = from_pretrained_keras("keras-io/lowlight-enhance-mirnet", compile=False)
|
9 |
+
examples = ['examples/179.png', 'examples/493.png', 'examples/780.png']
|
10 |
+
|
11 |
+
|
12 |
+
def infer(original_image):
|
13 |
+
image = keras.utils.img_to_array(original_image)
|
14 |
+
image = image.astype("float32") / 255.0
|
15 |
+
image = np.expand_dims(image, axis=0)
|
16 |
+
output = model.predict(image)
|
17 |
+
output_image = output[0] * 255.0
|
18 |
+
output_image = output_image.clip(0, 255)
|
19 |
+
output_image = output_image.reshape(
|
20 |
+
(np.shape(output_image)[0], np.shape(output_image)[1], 3)
|
21 |
+
)
|
22 |
+
output_image = np.uint32(output_image)
|
23 |
+
return output_image
|
24 |
+
|
25 |
+
iface = gr.Interface(
|
26 |
+
fn=infer,
|
27 |
+
title="Low Light Image Enhancement",
|
28 |
+
description = "Keras Implementation of MIRNet model for light up the dark image ππ",
|
29 |
+
inputs=[gr.inputs.Image(label="image", type="pil", shape=(960, 640))],
|
30 |
+
outputs="image",
|
31 |
+
examples=examples,
|
32 |
+
cache_examples=True,
|
33 |
+
article = "Author: <a href=\"https://huggingface.co/vumichien\">Vu Minh Chien</a>. Based on the keras example from <a href=\"https://keras.io/examples/vision/mirnet/\">Soumik Rakshit</a>").launch(enable_queue=True)
|
demo.ipynb
ADDED
File without changes
|
examples/179.png
ADDED
examples/493.png
ADDED
examples/780.png
ADDED
examples/download (1).jpeg
ADDED
examples/download.jpeg
ADDED
examples/images.jpeg
ADDED
examples/maxresdefault-5.jpg
ADDED
flagged/image/00c0b6fae2795359e4034106d24549524c20bb73/tmp6vbkl584.jpg
ADDED
flagged/log.csv
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
image,output,flag,username,timestamp
|
2 |
+
/Users/cheencheen/Desktop/SRM/survellliance bot/low light/Enhance_Low_Light_Image/flagged/image/00c0b6fae2795359e4034106d24549524c20bb73/tmp6vbkl584.jpg,/Users/cheencheen/Desktop/SRM/survellliance bot/low light/Enhance_Low_Light_Image/flagged/output/dfcc422fa1fa79820b754c53b6e09005bf18670e/tmpdobzgmka.png,,,2023-09-19 11:04:47.063809
|
flagged/output/dfcc422fa1fa79820b754c53b6e09005bf18670e/tmpdobzgmka.png
ADDED
gradio_cached_examples/14/log.csv
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
output,flag,username,timestamp
|
2 |
+
/Users/cheencheen/Desktop/SRM/survellliance bot/low light/Enhance_Low_Light_Image/gradio_cached_examples/14/output/db430b92035825a72ee6bd423ad33cf8730c9cf9/tmpiynf6d01.png,,,2023-09-19 11:02:09.884768
|
3 |
+
/Users/cheencheen/Desktop/SRM/survellliance bot/low light/Enhance_Low_Light_Image/gradio_cached_examples/14/output/56f2184e2380260185bcf447443ffedc95b0b4d6/tmpnfpf3uup.png,,,2023-09-19 11:02:33.319519
|
4 |
+
/Users/cheencheen/Desktop/SRM/survellliance bot/low light/Enhance_Low_Light_Image/gradio_cached_examples/14/output/0babb09c817eb7b98bf8f50bf49a44ad2bd9f7ed/tmpsnf4flud.png,,,2023-09-19 11:02:57.400161
|
gradio_cached_examples/14/output/0babb09c817eb7b98bf8f50bf49a44ad2bd9f7ed/tmpsnf4flud.png
ADDED
gradio_cached_examples/14/output/56f2184e2380260185bcf447443ffedc95b0b4d6/tmpnfpf3uup.png
ADDED
gradio_cached_examples/14/output/db430b92035825a72ee6bd423ad33cf8730c9cf9/tmpiynf6d01.png
ADDED
model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7e0bd457aa184c3a8fde411375b292e4f7776aaf7cfc9c29661f577309be451c
|
3 |
+
size 441222364
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
tensorflow
|
2 |
+
keras
|