honlan / beautygan Goto Github PK
View Code? Open in Web Editor NEWtransfer the makeup style of a reference face image to a non-makeup face
transfer the makeup style of a reference face image to a non-makeup face
Good job!
Do you plan open source training code?
这个产品瞬间就需要8GB的显示卡内存,需求真的是蛮高的.
segs,这个是什么文件??
Does anyone know where to find the face parsing code? I need this code for another dataset
When i use img_size = 512 i have error
ValueError: Cannot feed value of shape (1, 512, 512, 3) for Tensor 'X:0', which has shape '(?, 256, 256, 3)'
on the line:
Xs_ = sess.run(Xs, feed_dict={X: X_img, Y: Y_img})
may be need other model.meta?
can you give an example of the HM in makeup loss ?
as the title
Seen from your network graph, there is no conv bias before instance normalization?
Thank you for showing interesting papers and models.
By the way, I didn't see any code that used face_align in main.py, but I used that code and felt the model improved. Do you know it?
您好,能分享一下训练的代码吗?万分感谢
RT
我把img_size 改为512,程序运行报错,256时正确,请问如何解决?
def preprocess(img):
return (img / 511. - 0.5) * 2
batch_size = 1
img_size = 512
报错:
Traceback (most recent call last):
File "D:\steelsoft\makeup_artist\main.py", line 58, in
Xs_ = sess.run(Xs, feed_dict={X: X_img, Y: Y_img})
File "D:\steelsoft\makeup_artist\venv\lib\site-packages\tensorflow\python\client\session.py", line 968, in run
result = self._run(None, fetches, feed_dict, options_ptr,
File "D:\steelsoft\makeup_artist\venv\lib\site-packages\tensorflow\python\client\session.py", line 1165, in _run
raise ValueError(
ValueError: Cannot feed value of shape (1, 512, 512, 3) for Tensor X:0, which has shape (None, 256, 256, 3)
我的代码如下:
tf.compat.v1.disable_eager_execution()
parser = argparse.ArgumentParser()
parser.add_argument('--no_makeup', type=str, default=os.path.join('imgs', 'no_makeup', 'yuan_2.jpg'),
help='path to the no_makeup image')
args = parser.parse_args()
def preprocess(img):
return (img / 511. - 0.5) * 2
def deprocess(img):
return (img + 1) / 2
batch_size = 1
img_size = 512
no_makeup = cv2.resize(imread(args.no_makeup), (img_size, img_size))
print(args.no_makeup)
X_img = np.expand_dims(preprocess(no_makeup), 0)
makeups = glob.glob(os.path.join('imgs', 'makeup', '.'))
tf.compat.v1.reset_default_graph()
sess = tf.compat.v1.Session()
sess.run(tf.compat.v1.global_variables_initializer())
saver = tf.compat.v1.train.import_meta_graph(os.path.join('model', 'model.meta'))
saver.restore(sess, tf.train.latest_checkpoint('model'))
graph = tf.compat.v1.get_default_graph()
X = graph.get_tensor_by_name('X:0')
Y = graph.get_tensor_by_name('Y:0')
Xs = graph.get_tensor_by_name('generator/xs:0')
for i in range(len(makeups)):
makeup = cv2.resize(imread(makeups[i]), (img_size, img_size))
Y_img = np.expand_dims(preprocess(makeup), 0)
Xs_ = sess.run(Xs, feed_dict={X: X_img, Y: Y_img})
Xs_ = deprocess(Xs_)
result = Xs_[0]
imsave('result.jpg', result)
This project seems to be very helpful to me. I have cloned the project but cannot download the model from baidu because it requires a Chinese account to do this task.
Can you please upload the model to Google Drive. I would very appreciate it!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.