File size: 1,657 Bytes
ca86d9d
ad4956a
 
225738c
ad4956a
 
 
 
 
 
 
 
225738c
ad4956a
 
 
 
 
 
 
 
 
 
 
ca86d9d
 
 
 
 
 
 
 
 
 
 
 
 
 
ad4956a
ca86d9d
 
974a42a
 
 
 
 
 
 
 
 
 
8dc4699
 
 
 
 
 
974a42a
d89f3e5
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

# import sys
# sys.path.append("/home/wcx/wcx/EasyDetect/pipeline")

# from run import *
# '''
# 把一些文件移动到此文件路径下
# '''
# text = "A person is cutting a birthday cake with two red candles that spell out \"21\". The surface of the cake is round, and there is a balloon in the room. The person is using a silver knife to cut the cake."
# image_path = "/newdisk3/wcx/val2014/COCO_val2014_000000297425.jpg"
# pipeline = Pipeline()
# res = pipeline.run(text=text, image_path=image_path)

# def greet(name, cnt):
#     return "Hello " * cnt + name + "!"

# demo = gr.Interface(
#     fn=greet,
#     inputs=["text", "slider"],
#     outputs=["text"],
# )

# demo.launch()

# def generate_mutimodal(title, context, img):
#     return f"Title:{title}\nContext:{context}\n...{img}"

# server = gr.Interface(
#     fn=generate_mutimodal, 
#     inputs=[
#         gr.Textbox(lines=1, placeholder="请输入标题"),
#         gr.Textbox(lines=2, placeholder="请输入正文"),
#         gr.Image(shape=(200, 200),  label="请上传图片(可选)")
#     ], 
#     outputs="text"
# )

# server.launch()

import numpy as np
import gradio as gr
# 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
# #shape设置输入图像大小
# demo = gr.Interface(sepia, gr.Image(), "image")
# demo.launch()

# Download human-readable labels for ImageNet.

gr.Interface(fn=sepia,inputs=gr.Image(type="pil")).launch()