Spaces:
Running
Running
rashid996958
commited on
Commit
·
f69473d
1
Parent(s):
1319d42
add example images
Browse files- app.py +12 -4
- faces/makeup/XMY-014.png +0 -0
- faces/makeup/XMY-074.png +0 -0
- faces/makeup/XMY-136.png +0 -0
- faces/makeup/XMY-266.png +0 -0
- faces/makeup/vFG112.png +0 -0
- faces/makeup/vFG137.png +0 -0
- faces/makeup/vFG56.png +0 -0
- faces/makeup/vFG756.png +0 -0
- faces/makeup/vRX916.png +0 -0
- faces/no_makeup/XYUH-006.png +0 -0
- faces/no_makeup/vSYYZ306.png +0 -0
- faces/no_makeup/vSYYZ429.png +0 -0
- faces/no_makeup/vSYYZ639.png +0 -0
- faces/no_makeup/xfsy_0055.png +0 -0
- faces/no_makeup/xfsy_0068.png +0 -0
- faces/no_makeup/xfsy_0226.png +0 -0
- faces/no_makeup/xfsy_0401.png +0 -0
- faces/no_makeup/xfsy_0405.png +0 -0
- faces/no_makeup/xfsy_0503.png +0 -0
- faces/no_makeup/xfsy_0521.png +0 -0
app.py
CHANGED
@@ -37,11 +37,9 @@ def inference(A,B):
|
|
37 |
Xs = graph.get_tensor_by_name('decoder_1/g:0')
|
38 |
X = graph.get_tensor_by_name('X:0')
|
39 |
Y = graph.get_tensor_by_name('Y:0')
|
40 |
-
print("1")
|
41 |
A_img, A_img_ = load_image(A)
|
42 |
B_img, B_img_ = load_image(B)
|
43 |
Xs_ = sess.run(Xs, feed_dict={X: A_img_, Y: B_img_})
|
44 |
-
print("2")
|
45 |
output = deprocess(Xs_)[0]
|
46 |
output = np.array(np.array(output)*255,dtype=np.uint8)
|
47 |
# output = cv2.cvtColor(output, cv2.COLOR_RGB2BGR)
|
@@ -66,11 +64,21 @@ def makeupTransfer(arr1,arr2):
|
|
66 |
makeup = "input/ref.png"
|
67 |
inference(no_makeup, makeup)
|
68 |
return cv2.cvtColor(cv2.imread("output/scaled_2x.png"), cv2.COLOR_BGR2RGB)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
|
70 |
app = gr.Interface(fn=makeupTransfer,
|
71 |
inputs=[gr.Image(label="Reference Image",type='numpy'),
|
72 |
gr.Image(label="Makeup Image",type='numpy')],
|
73 |
outputs=gr.Image(label="Makeup Transfer Image",type='numpy'),
|
74 |
-
title="MakeUp Transfer APP"
|
|
|
|
|
75 |
|
76 |
-
app.launch(
|
|
|
37 |
Xs = graph.get_tensor_by_name('decoder_1/g:0')
|
38 |
X = graph.get_tensor_by_name('X:0')
|
39 |
Y = graph.get_tensor_by_name('Y:0')
|
|
|
40 |
A_img, A_img_ = load_image(A)
|
41 |
B_img, B_img_ = load_image(B)
|
42 |
Xs_ = sess.run(Xs, feed_dict={X: A_img_, Y: B_img_})
|
|
|
43 |
output = deprocess(Xs_)[0]
|
44 |
output = np.array(np.array(output)*255,dtype=np.uint8)
|
45 |
# output = cv2.cvtColor(output, cv2.COLOR_RGB2BGR)
|
|
|
64 |
makeup = "input/ref.png"
|
65 |
inference(no_makeup, makeup)
|
66 |
return cv2.cvtColor(cv2.imread("output/scaled_2x.png"), cv2.COLOR_BGR2RGB)
|
67 |
+
examples = [
|
68 |
+
[,
|
69 |
+
'faces/no_makeup/xfsy_0521.png',
|
70 |
+
'faces/makeup/vFG756.png'],
|
71 |
+
[,
|
72 |
+
'faces/no_makeup/xfsy_0068.png',
|
73 |
+
'faces/makeup/XMY-136.png']
|
74 |
+
]
|
75 |
|
76 |
app = gr.Interface(fn=makeupTransfer,
|
77 |
inputs=[gr.Image(label="Reference Image",type='numpy'),
|
78 |
gr.Image(label="Makeup Image",type='numpy')],
|
79 |
outputs=gr.Image(label="Makeup Transfer Image",type='numpy'),
|
80 |
+
title="MakeUp Transfer APP",
|
81 |
+
examples=examples
|
82 |
+
)
|
83 |
|
84 |
+
app.launch()
|
faces/makeup/XMY-014.png
ADDED
faces/makeup/XMY-074.png
ADDED
faces/makeup/XMY-136.png
ADDED
faces/makeup/XMY-266.png
ADDED
faces/makeup/vFG112.png
ADDED
faces/makeup/vFG137.png
ADDED
faces/makeup/vFG56.png
ADDED
faces/makeup/vFG756.png
ADDED
faces/makeup/vRX916.png
ADDED
faces/no_makeup/XYUH-006.png
ADDED
faces/no_makeup/vSYYZ306.png
ADDED
faces/no_makeup/vSYYZ429.png
ADDED
faces/no_makeup/vSYYZ639.png
ADDED
faces/no_makeup/xfsy_0055.png
ADDED
faces/no_makeup/xfsy_0068.png
ADDED
faces/no_makeup/xfsy_0226.png
ADDED
faces/no_makeup/xfsy_0401.png
ADDED
faces/no_makeup/xfsy_0405.png
ADDED
faces/no_makeup/xfsy_0503.png
ADDED
faces/no_makeup/xfsy_0521.png
ADDED