Spaces:
Runtime error
Runtime error
Harveenchadha
commited on
Commit
•
9c97e85
1
Parent(s):
7dcd070
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from huggingface_hub import from_pretrained_keras
|
|
7 |
|
8 |
|
9 |
model = from_pretrained_keras("Harveenchadha/low-light-image-enhancement", compile=False)
|
10 |
-
|
11 |
|
12 |
def get_enhanced_image(data, output):
|
13 |
r1 = output[:, :, :, :3]
|
@@ -37,17 +37,15 @@ def infer(original_image):
|
|
37 |
output = get_enhanced_image(image, output)
|
38 |
output_image = tf.cast((output[0, :, :, :] * 255), dtype=np.uint8)
|
39 |
output_image = Image.fromarray(output_image.numpy())
|
40 |
-
# output_image = output_image.numpy()
|
41 |
-
# print(output_image.shape())
|
42 |
return output_image
|
43 |
|
44 |
|
45 |
iface = gr.Interface(
|
46 |
fn=infer,
|
47 |
-
title="
|
48 |
-
description = "
|
49 |
inputs=[gr.inputs.Image(label="image", type="pil")],
|
50 |
outputs=[gr.outputs.Image(label="image", type="numpy")],
|
51 |
-
|
52 |
-
article = "Author
|
53 |
).launch(debug=True)
|
|
|
7 |
|
8 |
|
9 |
model = from_pretrained_keras("Harveenchadha/low-light-image-enhancement", compile=False)
|
10 |
+
examples = ['got2.png', 'got1.jpg', 'got_final.png']
|
11 |
|
12 |
def get_enhanced_image(data, output):
|
13 |
r1 = output[:, :, :, :3]
|
|
|
37 |
output = get_enhanced_image(image, output)
|
38 |
output_image = tf.cast((output[0, :, :, :] * 255), dtype=np.uint8)
|
39 |
output_image = Image.fromarray(output_image.numpy())
|
|
|
|
|
40 |
return output_image
|
41 |
|
42 |
|
43 |
iface = gr.Interface(
|
44 |
fn=infer,
|
45 |
+
title="Zero-DCE for low-light image enhancement",
|
46 |
+
description = "Implementing Zero-Reference Deep Curve Estimation for low-light image enhancement.",
|
47 |
inputs=[gr.inputs.Image(label="image", type="pil")],
|
48 |
outputs=[gr.outputs.Image(label="image", type="numpy")],
|
49 |
+
examples=examples,
|
50 |
+
article = "**Original Author**: [Soumik Rakshit](https://github.com/soumik12345) <br>**HF Contribution**: [Harveen Singh Chadha](https://github.com/harveenchadha)<br>",
|
51 |
).launch(debug=True)
|