make api
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ def tensor_to_ndarray(tensor, nrow=1, padding=0, normalize=True):
|
|
25 |
return grid.mul(255).add_(0.5).clamp_(0, 255).permute(1, 2, 0).to("cpu", torch.uint8).numpy()
|
26 |
|
27 |
|
28 |
-
def
|
29 |
image = (np.asarray(image) / 255.0)
|
30 |
image = torch.from_numpy(image).float()
|
31 |
image = image.permute(2, 0, 1)
|
@@ -57,7 +57,7 @@ This demo is running on a CPU, if you like this project please make us a donatio
|
|
57 |
"""
|
58 |
|
59 |
demo = gr.Interface(
|
60 |
-
|
61 |
gr.Image(type="pil", label="Image low light"),
|
62 |
], [
|
63 |
gr.Image(type="numpy", label="Image enhanced")
|
|
|
25 |
return grid.mul(255).add_(0.5).clamp_(0, 255).permute(1, 2, 0).to("cpu", torch.uint8).numpy()
|
26 |
|
27 |
|
28 |
+
def predict(image):
|
29 |
image = (np.asarray(image) / 255.0)
|
30 |
image = torch.from_numpy(image).float()
|
31 |
image = image.permute(2, 0, 1)
|
|
|
57 |
"""
|
58 |
|
59 |
demo = gr.Interface(
|
60 |
+
predict, [
|
61 |
gr.Image(type="pil", label="Image low light"),
|
62 |
], [
|
63 |
gr.Image(type="numpy", label="Image enhanced")
|