Code Monkey home page Code Monkey logo

Comments (12)

xingmimfl avatar xingmimfl commented on July 4, 2024

seems input is 224x224, and the ouput is not very good

from nonlinear_face_3dmm.

ibrahimqreet avatar ibrahimqreet commented on July 4, 2024

@yuellong Thank you can you help me turn it on? I am trying to run it on Google Collab? Please can you please guide me with the required steps

from nonlinear_face_3dmm.

cassiePython avatar cassiePython commented on July 4, 2024

I run the pre-trained model but get unreasonable outputs. The shape can not be visualized with 3DMesh

from nonlinear_face_3dmm.

ibrahimqreet avatar ibrahimqreet commented on July 4, 2024

Can you tell me how you were able to run the pre-trained model, and what steps you took, please @cassiePython

from nonlinear_face_3dmm.

HOMGH avatar HOMGH commented on July 4, 2024

I run the pre-trained model but get unreasonable outputs. The shape can not be visualized with 3DMesh

Same issue! The reconstructed texture (rendered image) is not correct as well!

from nonlinear_face_3dmm.

huyanfei-cqupt avatar huyanfei-cqupt commented on July 4, 2024

I run the pre-trained model but get unreasonable outputs. The shape can not be visualized with 3DMesh

Same issue! The reconstructed texture (rendered image) is not correct as well!

Hi,@HOMGH Can you tell me how to write the G_loss_frecon code? Thank you

from nonlinear_face_3dmm.

HOMGH avatar HOMGH commented on July 4, 2024

I run the pre-trained model but get unreasonable outputs. The shape can not be visualized with 3DMesh

Same issue! The reconstructed texture (rendered image) is not correct as well!

Hi,@HOMGH Can you tell me how to write the G_loss_frecon code? Thank you

Hi, this is the part of the code which compute G_loss_frecon:

        if self.is_using_frecon:
            print('is calculating frecon.....')
            from vgg_face import vgg_face


            #G_images_300W_vgg = (tf.multiply(G_images_300W, G_images_300W_mask)+ 1.0)*127.5
            G_images_mix_s1a0_300W_vgg = (G_images_mix_s1a0_300W + 1.0)*127.5
            G_images_mix_s0a1_300W_vgg = (G_images_mix_s0a1_300W + 1.0)*127.5
            input_images_300W_vgg      = (input_images_300W      + 1.0)*127.5
            
            
            input_features, _, _  = vgg_face('vgg-face.mat', input_images_300W_vgg)
            recon_mix_s1a0_features, _, _  = vgg_face('vgg-face.mat', G_images_mix_s1a0_300W_vgg)
            recon_mix_s0a1_features, _, _  = vgg_face('vgg-face.mat', G_images_mix_s0a1_300W_vgg)
            
            layer_names = ['conv1_1', 'conv2_1',  'conv3_1',  'conv4_1', 'conv5_1'] #['conv1_2', 'conv2_2',  'conv3_3',  'conv4_3', 'conv5_3']
            layer_weights = [50, 500, 2000, 3000, 250]

            for i in range(len(layer_names)):
                layer_name = layer_names[i]
                layer_weight = layer_weights[i]
                G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s1a0_features[layer_name], loss_type='l2') / (layer_weight*layer_weight * len(layer_names))*2
                G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s0a1_features[layer_name], loss_type='l2') / (layer_weight*layer_weight * len(layer_names))*2
                #############################################################################################3
        g_loss = g_loss + G_loss_frecon

You can find it here:

if self.is_using_frecon:

from nonlinear_face_3dmm.

huyanfei-cqupt avatar huyanfei-cqupt commented on July 4, 2024

I run the pre-trained model but get unreasonable outputs. The shape can not be visualized with 3DMesh

Same issue! The reconstructed texture (rendered image) is not correct as well!

Hi,@HOMGH Can you tell me how to write the G_loss_frecon code? Thank you

Hi, this is the part of the code which compute G_loss_frecon:

        if self.is_using_frecon:
            print('is calculating frecon.....')
            from vgg_face import vgg_face


            #G_images_300W_vgg = (tf.multiply(G_images_300W, G_images_300W_mask)+ 1.0)*127.5
            G_images_mix_s1a0_300W_vgg = (G_images_mix_s1a0_300W + 1.0)*127.5
            G_images_mix_s0a1_300W_vgg = (G_images_mix_s0a1_300W + 1.0)*127.5
            input_images_300W_vgg      = (input_images_300W      + 1.0)*127.5
            
            
            input_features, _, _  = vgg_face('vgg-face.mat', input_images_300W_vgg)
            recon_mix_s1a0_features, _, _  = vgg_face('vgg-face.mat', G_images_mix_s1a0_300W_vgg)
            recon_mix_s0a1_features, _, _  = vgg_face('vgg-face.mat', G_images_mix_s0a1_300W_vgg)
            
            layer_names = ['conv1_1', 'conv2_1',  'conv3_1',  'conv4_1', 'conv5_1'] #['conv1_2', 'conv2_2',  'conv3_3',  'conv4_3', 'conv5_3']
            layer_weights = [50, 500, 2000, 3000, 250]

            for i in range(len(layer_names)):
                layer_name = layer_names[i]
                layer_weight = layer_weights[i]
                G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s1a0_features[layer_name], loss_type='l2') / (layer_weight*layer_weight * len(layer_names))*2
                G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s0a1_features[layer_name], loss_type='l2') / (layer_weight*layer_weight * len(layer_names))*2
                #############################################################################################3
        g_loss = g_loss + G_loss_frecon

You can find it here:

if self.is_using_frecon:

@HOMGH Thank you very much!
I have another question. Do I need to modify the variables G_images_mix_s1a0_300W_vgg and G_images_mix_s0a1_300W_vgg in this code?
I once tried to imitate the model_non_linear_proxy.py file to write the G_loss_frecon code, but when I ran it, the system reported an error.

from nonlinear_face_3dmm.

HOMGH avatar HOMGH commented on July 4, 2024

I run the pre-trained model but get unreasonable outputs. The shape can not be visualized with 3DMesh

Same issue! The reconstructed texture (rendered image) is not correct as well!

Hi,@HOMGH Can you tell me how to write the G_loss_frecon code? Thank you

Hi, this is the part of the code which compute G_loss_frecon:

        if self.is_using_frecon:
            print('is calculating frecon.....')
            from vgg_face import vgg_face


            #G_images_300W_vgg = (tf.multiply(G_images_300W, G_images_300W_mask)+ 1.0)*127.5
            G_images_mix_s1a0_300W_vgg = (G_images_mix_s1a0_300W + 1.0)*127.5
            G_images_mix_s0a1_300W_vgg = (G_images_mix_s0a1_300W + 1.0)*127.5
            input_images_300W_vgg      = (input_images_300W      + 1.0)*127.5
            
            
            input_features, _, _  = vgg_face('vgg-face.mat', input_images_300W_vgg)
            recon_mix_s1a0_features, _, _  = vgg_face('vgg-face.mat', G_images_mix_s1a0_300W_vgg)
            recon_mix_s0a1_features, _, _  = vgg_face('vgg-face.mat', G_images_mix_s0a1_300W_vgg)
            
            layer_names = ['conv1_1', 'conv2_1',  'conv3_1',  'conv4_1', 'conv5_1'] #['conv1_2', 'conv2_2',  'conv3_3',  'conv4_3', 'conv5_3']
            layer_weights = [50, 500, 2000, 3000, 250]

            for i in range(len(layer_names)):
                layer_name = layer_names[i]
                layer_weight = layer_weights[i]
                G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s1a0_features[layer_name], loss_type='l2') / (layer_weight*layer_weight * len(layer_names))*2
                G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s0a1_features[layer_name], loss_type='l2') / (layer_weight*layer_weight * len(layer_names))*2
                #############################################################################################3
        g_loss = g_loss + G_loss_frecon

You can find it here:

if self.is_using_frecon:

@HOMGH Thank you very much!
I have another question. Do I need to modify the variables G_images_mix_s1a0_300W_vgg and G_images_mix_s0a1_300W_vgg in this code?

No, I don't think so. Actually I didn't get good results after training for 40 epochs which took me around 20 days! So I'm not sure whether this code works or not!

from nonlinear_face_3dmm.

huyanfei-cqupt avatar huyanfei-cqupt commented on July 4, 2024

I run the pre-trained model but get unreasonable outputs. The shape can not be visualized with 3DMesh

Same issue! The reconstructed texture (rendered image) is not correct as well!

Hi,@HOMGH Can you tell me how to write the G_loss_frecon code? Thank you

Hi, this is the part of the code which compute G_loss_frecon:

        if self.is_using_frecon:
            print('is calculating frecon.....')
            from vgg_face import vgg_face


            #G_images_300W_vgg = (tf.multiply(G_images_300W, G_images_300W_mask)+ 1.0)*127.5
            G_images_mix_s1a0_300W_vgg = (G_images_mix_s1a0_300W + 1.0)*127.5
            G_images_mix_s0a1_300W_vgg = (G_images_mix_s0a1_300W + 1.0)*127.5
            input_images_300W_vgg      = (input_images_300W      + 1.0)*127.5
            
            
            input_features, _, _  = vgg_face('vgg-face.mat', input_images_300W_vgg)
            recon_mix_s1a0_features, _, _  = vgg_face('vgg-face.mat', G_images_mix_s1a0_300W_vgg)
            recon_mix_s0a1_features, _, _  = vgg_face('vgg-face.mat', G_images_mix_s0a1_300W_vgg)
            
            layer_names = ['conv1_1', 'conv2_1',  'conv3_1',  'conv4_1', 'conv5_1'] #['conv1_2', 'conv2_2',  'conv3_3',  'conv4_3', 'conv5_3']
            layer_weights = [50, 500, 2000, 3000, 250]

            for i in range(len(layer_names)):
                layer_name = layer_names[i]
                layer_weight = layer_weights[i]
                G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s1a0_features[layer_name], loss_type='l2') / (layer_weight*layer_weight * len(layer_names))*2
                G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s0a1_features[layer_name], loss_type='l2') / (layer_weight*layer_weight * len(layer_names))*2
                #############################################################################################3
        g_loss = g_loss + G_loss_frecon

You can find it here:

if self.is_using_frecon:

@HOMGH Thank you very much!
I have another question. Do I need to modify the variables G_images_mix_s1a0_300W_vgg and G_images_mix_s0a1_300W_vgg in this code?

No, I don't think so. Actually I didn't get good results after training for 40 epochs which took me around 20 days! So I'm not sure whether this code works or not!

Hi, I would like to ask if the file you are running is model_non_linear.py or model_non_linear_proxy.py?
I am now going to try to run the model_non_linear.py file,so I want to ask whether other variables in the file proxy.py need to be modified or discarded. The following is the code I wrote:
`G_loss_frecon = tf.zeros(1)
if self.is_using_frecon:
from vgg_face import vgg_face

            G_images_300W_vgg = (tf.multiply(G_images_300W, G_images_300W_mask) + 1.0)*127.5
            # G_images_mix_s1a0_300W_vgg = (G_images_mix_s1a0_300W + 1.0) * 127.5
            # G_images_mix_s0a1_300W_vgg = (G_images_mix_s0a1_300W + 1.0) * 127.5
            input_images_300W_vgg = (input_images_300W + 1.0) * 127.5

            input_features, _, _ = vgg_face('vgg-face.mat', input_images_300W_vgg)
            recon_features, _, _ = vgg_face('vgg-face.mat', G_images_300W_vgg)
            # recon_mix_s1a0_features, _, _ = vgg_face('vgg-face.mat', G_images_mix_s1a0_300W_vgg)
            # recon_mix_s0a1_features, _, _ = vgg_face('vgg-face.mat', G_images_mix_s0a1_300W_vgg)

            layer_names = ['conv1_1', 'conv2_1', 'conv3_1', 'conv4_1',
                           'conv5_1']  # ['conv1_2', 'conv2_2',  'conv3_3',  'conv4_3', 'conv5_3']
            layer_weights = [50, 500, 2000, 3000, 250]

            for i in range(len(layer_names)):
                layer_name = layer_names[i]
                layer_weight = layer_weights[i]
                G_loss_frecon += norm_loss(input_features[layer_name], recon_features[layer_name],
                                           loss_type='l2') / (layer_weight * layer_weight * len(layer_names)) * 2
                # G_loss_frecon += norm_loss(input_features[layer_name], recon_mix_s0a1_features[layer_name],
                #                            loss_type='l2') / (layer_weight * layer_weight * len(layer_names)) * 2

        g_loss = g_loss + G_loss_frecon`

I am not sure if it is correct, but when I run it, the system prompts an error. Can you help me? thank you!

from nonlinear_face_3dmm.

HOMGH avatar HOMGH commented on July 4, 2024

model_non_linear_proxy.py

I ran model_non_linear_proxy.py!

from nonlinear_face_3dmm.

huyanfei-cqupt avatar huyanfei-cqupt commented on July 4, 2024

model_non_linear_proxy.py

I ran model_non_linear_proxy.py!

Have you not tried to run the model_non_linear.py file before?

from nonlinear_face_3dmm.

Related Issues (20)

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.