Spaces:
Sleeping
Sleeping
File size: 884 Bytes
576a3f2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# MyFirst Gradio Application
import gradio as gr
import numpy as np
def hello_world(name):
return "Hello ....."+name+"!!!!"
def sepia(input_img):
sepia_filter = np.array([[.393, .769, .189],
[.349, .686, .168],
[.272, .534, .131]])
sepia_img = input_img.dot(sepia_filter.T)
sepia_img /= sepia_img.max()
return sepia_img
hello_world("Lets Create a Sepia Filter for your uploaded image ")
#Interface Option 1 - single line text entry
#interface = gr.Interface(fn = hello_world,inputs = 'text', outputs = 'text')
#Interface Option 2 - multiline text entry
#interface = gr.Interface(fn = hello_world,inputs = gr.inputs.Textbox(lines=5,placeholder="Enter your mission statement here"), outputs = 'text')
#Interface Option 3 - convert image to sepia
interface = gr.Interface(sepia, gr.inputs.Image(shape=(200,200)), "image")
#Launch Interface
interface.launch()
|