Spaces:
Runtime error
Runtime error
add n to quantize
Browse files
app.py
CHANGED
|
@@ -2,15 +2,15 @@ import numpy as np
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
def quantize(val):
|
| 6 |
-
return (np.round(val / 255) * 255).astype(np.uint8)
|
| 7 |
|
| 8 |
|
| 9 |
-
def sepia(input_img):
|
| 10 |
-
output_img =
|
| 11 |
return output_img
|
| 12 |
|
| 13 |
|
| 14 |
-
iface = gr.Interface(sepia, "image", "pil")
|
| 15 |
|
| 16 |
iface.launch()
|
|
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
+
def quantize(val, n):
|
| 6 |
+
return (np.round(n * val / 255) * 255).astype(np.uint8)
|
| 7 |
|
| 8 |
|
| 9 |
+
def sepia(n, input_img):
|
| 10 |
+
output_img = [quantize(val, n) for val in input_img]
|
| 11 |
return output_img
|
| 12 |
|
| 13 |
|
| 14 |
+
iface = gr.Interface(sepia, ["number", "image"], "pil")
|
| 15 |
|
| 16 |
iface.launch()
|