Skip to content

Latest commit

 

History

History
 
 

christmas

人像圣诞特效自动生成工具

通过SOLOv2实例分割模型分割人像,并通过BlazeFace关键点模型检测人脸关键点,然后根据两个模型输出结果更换圣诞风格背景并为人脸加上圣诞老人胡子、圣诞眼镜及圣诞帽等特效。本项目通过PaddleHub可直接发布Server服务,供本地调试与前端直接调用接口。您可通过以下二维码中微信小程序直接体验:

环境搭建

环境依赖

  • paddlepaddle >= 2.0.0rc0

  • paddlehub >= 2.0.0b1

模型准备

hub安装blazeface和solov2模型

hub install solov2
hub install blazeface

hub安装solov2_blazeface圣诞特效自动生成串联模型

$ hub install solov2_blazeface

开始测试

本地测试

python test_main.py

运行成功后,预测结果会保存到chrismas_final.png

serving测试

  • step1: 启动服务
export CUDA_VISIBLE_DEVICES=0
hub serving start -m solov2_blazeface -p 8880
  • step2: 在服务端发送预测请求
python test_server.py

运行成功后,预测结果会保存到chrismas_final.png

效果展示