Spaces:
Sleeping
Sleeping
import gradio as gr | |
import numpy as np | |
def gray(image): | |
grayed_image = np.mean(image, 2) | |
image_max = np.max(grayed_image) | |
if image_max > 1: | |
grayed_image = grayed_image / image_max | |
return grayed_image | |
app = gr.Interface( | |
gray, | |
'image', | |
gr.Image(format='png'), | |
live=True | |
) | |
app.launch() |