File size: 975 Bytes
5a39fd2 f7b54b4 5a39fd2 f7b54b4 5a39fd2 |
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 30 31 32 33 34 |
import gradio as gr
import numpy as np
from pathlib import Path
EXAMPLES_PATH = Path('./examples')
title = "Ethiopian Foods"
description = """
The bot was trained to answer questions based on Rick and Morty dialogues. Ask Rick anything!
"""
article = "Check out [the original Rick and Morty Bot](https://huggingface.co/spaces/kingabzpro/Rick_and_Morty_Bot) that this demo is based off of."
def sepia(input_img):
sepia_filter = np.array(
[[0.393, 0.769, 0.189], [0.349, 0.686, 0.168], [0.272, 0.534, 0.131]]
)
sepia_img = input_img.dot(sepia_filter.T)
sepia_img /= sepia_img.max()
return sepia_img
examples = [f'{EXAMPLES_PATH}/{f.name}' for f in EXAMPLES_PATH.iterdir()]
demo = gr.Interface(sepia,
"image",
"image",
examples= examples,
title=title,
description=description,
article=article)
demo.launch() |