ryusei-iki
commited on
Commit
•
04d2061
1
Parent(s):
b9fcbbd
example_list
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import ot
|
|
3 |
import numpy as np
|
4 |
import gradio as gr
|
5 |
|
|
|
6 |
def preprocess(content_img,style_img):
|
7 |
|
8 |
content_img = Image.fromarray(content_img.astype("uint8"), "RGB")
|
@@ -34,21 +35,11 @@ def preprocess(content_img,style_img):
|
|
34 |
return transferred_img
|
35 |
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
img1 = Image.open(img1_file)
|
41 |
-
# img2_file = 'huggingface/otd/sea.png'
|
42 |
-
img2_file = 'sea.png'
|
43 |
-
img2 = Image.open(img2_file)
|
44 |
-
|
45 |
|
46 |
-
gr_img = gr.Image(
|
47 |
-
gr_img2 = gr.Image(
|
48 |
-
|
49 |
-
|
50 |
-
# gr_img = gr.inputs.Image()
|
51 |
-
# gr_img2 = gr.inputs.Image()
|
52 |
|
53 |
interface = gr.Interface(
|
54 |
fn=preprocess,
|
@@ -57,6 +48,9 @@ interface = gr.Interface(
|
|
57 |
gr_img2
|
58 |
],
|
59 |
outputs="image",
|
|
|
|
|
|
|
60 |
title="最適輸送距離による色相変換",
|
61 |
description="content画像と,style画像を入力してください",
|
62 |
)
|
|
|
3 |
import numpy as np
|
4 |
import gradio as gr
|
5 |
|
6 |
+
|
7 |
def preprocess(content_img,style_img):
|
8 |
|
9 |
content_img = Image.fromarray(content_img.astype("uint8"), "RGB")
|
|
|
35 |
return transferred_img
|
36 |
|
37 |
|
38 |
+
content_file = 'gohho.png'
|
39 |
+
style_file = 'sea.png'
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
+
gr_img = gr.inputs.Image()
|
42 |
+
gr_img2 = gr.inputs.Image()
|
|
|
|
|
|
|
|
|
43 |
|
44 |
interface = gr.Interface(
|
45 |
fn=preprocess,
|
|
|
48 |
gr_img2
|
49 |
],
|
50 |
outputs="image",
|
51 |
+
examples=[
|
52 |
+
[content_file, style_file],
|
53 |
+
],
|
54 |
title="最適輸送距離による色相変換",
|
55 |
description="content画像と,style画像を入力してください",
|
56 |
)
|