[Model] add PFLD model (#433)

* support face alignment PFLD

* add PFLD demo

* fixed FaceAlignmentResult

* fixed bugs

* fixed img size

* fixed readme

* deal with comments

* fixed readme

* add pfld testcase

* update infer.py

* add gflags for example

* update c++ readme

* add gflags in example

* fixed for ci

* fixed gflags.cmake

* deal with comments

* update infer demo

Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
WJJ1995
2022-11-02 11:50:16 +08:00
committed by GitHub
parent 7e64f4088f
commit 9437dec9f5
33 changed files with 1059 additions and 44 deletions

10
python/fastdeploy/vision/visualize/__init__.py Normal file → Executable file
View File

@@ -36,6 +36,10 @@ def vis_face_detection(im_data, face_det_result, line_size=1, font_size=0.5):
font_size)
def vis_face_alignment(im_data, face_align_result, line_size=1):
return C.vision.vis_face_alignment(im_data, face_align_result, line_size)
def vis_segmentation(im_data, seg_result, weight=0.5):
return C.vision.vis_segmentation(im_data, seg_result, weight)
@@ -63,12 +67,14 @@ def swap_background_matting(im_data,
"DEPRECATED: fastdeploy.vision.swap_background_matting is deprecated, please use fastdeploy.vision.swap_background function instead."
)
assert isinstance(
result, C.vision.MattingResult), "The result must be MattingResult type"
result,
C.vision.MattingResult), "The result must be MattingResult type"
return C.vision.Visualize.swap_background_matting(
im_data, background, result, remove_small_connected_area)
def swap_background_segmentation(im_data, background, background_label, result):
def swap_background_segmentation(im_data, background, background_label,
result):
logging.warning(
"DEPRECATED: fastdeploy.vision.swap_background_segmentation is deprecated, please use fastdeploy.vision.swap_background function instead."
)