Code Monkey home page Code Monkey logo

Comments (9)

Phi-C avatar Phi-C commented on September 23, 2024 1

@AlonZolfi The pseudo code is as follows


def get_mask_texture(src_image_path, seg_image_path):
    seg_image = imread(seg_image_path)
    src_image = imread(src_image_path)

    # use src_image to get pos and vertices with the help of PRN model
    lms_info = read_info.read_landmark_106_array(src_face_lms)
    pos = prn_model.process(src_image, lms_info)
    vertices = prn_model.get_vertices(pos)

    # map mask texture to UV texture map
    mask_image = mask_image/255.
    mask_UV = cv2.remap(mask_image, pos[:, :, :2].astype(np.float32), None, interpolation=cv2.INTER_NEAREST, boarderMode=cv2.BORDER_CONSTANT, borderValue=(0))
    mask_UV = mask_UV.astype(np.float32)
    mask_UV = cv2.cvtColor(mask_UV, cv2.COLOR_RGB2RGBA)
    mask_UV[background_pos, 3]  = 0
    return mask_UV

from facex-zoo.

wang21jun avatar wang21jun commented on September 23, 2024

Thanks for your interest in our project. Please refer to our tech-report, In short, given a masked face image R, we first compute the uv position map P by PRNet. Then we obtain the 'uv_mask.png' by map the segmentation map of R into uv space with the uv position map P.

from facex-zoo.

fengshikun avatar fengshikun commented on September 23, 2024

@wang21jun , thanks for your explanation, still i have some questions, i notice that the mask texture file under path Data/mask-data(called 0.png, 1.png...) is a 4-channel matrix.
1.Is that 0-3 channel of this matrix(ref_texture_src) is the uv_texture generated by PRNet by keeping the mask part of original image using the mask segmentation?
2.What' s the meaning of 4th channel of this 4-channel matrix(uv_mask_src), how to generate this channel?

from facex-zoo.

lucia123 avatar lucia123 commented on September 23, 2024

@wang21jun , thanks for your explanation, still i have some questions, i notice that the mask texture file under path Data/mask-data(called 0.png, 1.png...) is a 4-channel matrix.
1.Is that 0-3 channel of this matrix(ref_texture_src) is the uv_texture generated by PRNet by keeping the mask part of original image using the mask segmentation?
2.What' s the meaning of 4th channel of this 4-channel matrix(uv_mask_src), how to generate this channel?

The 4th channel is the alpha channel of RGBA image. It can be obtained by the segmentation model or Photoshop tool. The values in this channel mean the probability that pixels belong to mask region.

from facex-zoo.

AlonZolfi avatar AlonZolfi commented on September 23, 2024

Thanks for your interest in our project. Please refer to our tech-report, In short, given a masked face image R, we first compute the uv position map P by PRNet. Then we obtain the 'uv_mask.png' by map the segmentation map of R into uv space with the uv position map P.

Could you please elaborate more on how did you do the 3d reconstruction on the mask only (step (b) -> (c))?
image

from facex-zoo.

liujia761 avatar liujia761 commented on September 23, 2024

感谢您对我们项目的关注。请参考我们的技术报告,简而言之,给定一个蒙版面部图像R,我们首先通过PRNet计算UV位置图P。然后,我们将R的分割图映射到UV空间,并使用UV位置图P获得“uv_mask.png”。

您能否详细说明您是如何仅在面具上进行 3D 重建的(步骤 (b) -> (c))? 图像

好喽 您这个问题解决了吗,我在用这个的时候也遇到了这个问题

from facex-zoo.

liujia761 avatar liujia761 commented on September 23, 2024

@AlonZolfi伪代码如下


def get_mask_texture(src_image_path, seg_image_path):
    seg_image = imread(seg_image_path)
    src_image = imread(src_image_path)

    # use src_image to get pos and vertices with the help of PRN model
    lms_info = read_info.read_landmark_106_array(src_face_lms)
    pos = prn_model.process(src_image, lms_info)
    vertices = prn_model.get_vertices(pos)

    # map mask texture to UV texture map
    mask_image = mask_image/255.
    mask_UV = cv2.remap(mask_image, pos[:, :, :2].astype(np.float32), None, interpolation=cv2.INTER_NEAREST, boarderMode=cv2.BORDER_CONSTANT, borderValue=(0))
    mask_UV = mask_UV.astype(np.float32)
    mask_UV = cv2.cvtColor(mask_UV, cv2.COLOR_RGB2RGBA)
    mask_UV[background_pos, 3]  = 0
    return mask_UV

您好,请问这个函数返回值是从(a)上取下口罩返回的(c)吗 另外这个函数的输入是什么呢

from facex-zoo.

liujia761 avatar liujia761 commented on September 23, 2024

感谢您的出色项目,3d 面罩非常坚固。 但是,我想为面罩生成添加更多种类的面罩纹理,但找不到有关如何执行此操作的任何文档。你能提供一些信息吗?
好喽,大佬请问您这个问题解决了吗,我也遇到了这个问题

from facex-zoo.

liujia761 avatar liujia761 commented on September 23, 2024

感谢您的出色项目,3d 面罩非常坚固。 但是,我想为面罩生成添加更多种类的面罩纹理,但找不到有关如何执行此操作的任何文档。你能提供一些信息吗?

您好。大佬您这个问题就解决了吗,我也遇到了这个问题

from facex-zoo.

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.