Spaces:
Runtime error
Runtime error
upload models
Browse files- README.md +1 -1
- app.py +25 -0
- examples/179.png +0 -0
- examples/493.png +0 -0
- examples/780.png +0 -0
- model.h5 +3 -0
- requirements.txt +2 -0
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
emoji: 🦀
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: pink
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Enhance Low Light Image
|
| 3 |
emoji: 🦀
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: pink
|
app.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import gradio as gr
|
| 3 |
+
from huggingface_hub import from_pretrained_keras
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
model = from_pretrained_keras("keras-io/lowlight-enhance-mirnet", compile=False)
|
| 7 |
+
examples = ['examples/179.png', 'examples/493.png', 'examples/780.png']
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
def infer(image):
|
| 11 |
+
image = np.expand_dims(image, axis=0)
|
| 12 |
+
output = model.predict(image)
|
| 13 |
+
output_image = output[0] * 255.0
|
| 14 |
+
output_image = output_image.clip(0, 255)
|
| 15 |
+
output_image = output_image.reshape(
|
| 16 |
+
(np.shape(output_image)[0], np.shape(output_image)[1], 3)
|
| 17 |
+
)
|
| 18 |
+
return output_image
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
iface = gr.Interface(
|
| 22 |
+
fn=infer,
|
| 23 |
+
inputs=[gr.inputs.Image(label="image", type="pil", shape=(128, 128))],
|
| 24 |
+
outputs="image",
|
| 25 |
+
examples=examples).launch(debug=True)
|
examples/179.png
ADDED
|
examples/493.png
ADDED
|
examples/780.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
|