Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
+
from PIL import Image
|
4 |
+
|
5 |
+
def invert_image(image):
|
6 |
+
image = Image.open(image)
|
7 |
+
inverted_image = Image.fromarray(np.array(image)[::-1])
|
8 |
+
return inverted_image
|
9 |
+
|
10 |
+
iface = gr.Interface(invert_image, "image", "image", live=True)
|
11 |
+
iface.launch()
|