deepinsight / deepinsight/insightface

mask_renderer.py Why is the face data made with masks not real at all?

Open
#1,878 2 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
29.7k
Forks
6.1k
PR merge metrics
No merged PRs in 30d

Description

import os, sys, datetime
import numpy as np
import os.path as osp
import cv2
import insightface
from insightface.app import MaskRenderer
from insightface.data import get_image as ins_get_image

if __name__ == "__main__":
#make sure that you have download correct insightface model pack.
#make sure that BFM.mat and BFM_UV.mat have been generated
tool = MaskRenderer()
tool.prepare(ctx_id=0, det_size=(128,128))
image = ins_get_image('Tom_Hanks_54745')
mask_image = "mask_black"
params = tool.build_params(image)
mask_out = tool.render_mask(image, mask_image, params)

cv2.imwrite('output_mask.jpg', mask_out)

![output_mask](https://user-images.githubusercontent.com/49524647/148673773-f891e8a7-0764-4deb-a9cf-11c8ba5b65a5.jpg)
@nttstar

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.