GithubHelp home page GithubHelp logo

beautygan's People

Contributors

honlan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beautygan's Issues

trian

Good job!
Do you plan open source training code?

Histogram matching Layer

Screen Shot 2019-06-29 at 7 24 33 AM

The paper mentions this portion here. I have 2 questions.

  1. Which layer are you extracting the full face from the eyes, and hair to get the face like the results above without eyes and hair.
  2. Which layer are you performing histogram matching from Y I^ref to I^src

How use bigger size images? 512, 1024... and more

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?

Improve model accuracy

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?

如何获得512大小的图像?

我把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.reset_default_graph()

tf.compat.v1.reset_default_graph()

sess = tf.Session()

sess = tf.compat.v1.Session()

sess.run(tf.global_variables_initializer())

sess.run(tf.compat.v1.global_variables_initializer())

saver = tf.train.import_meta_graph(os.path.join('model', 'model.meta'))

saver = tf.compat.v1.train.import_meta_graph(os.path.join('model', 'model.meta'))
saver.restore(sess, tf.train.latest_checkpoint('model'))

graph = tf.get_default_graph()

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)

can't download the model

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.