Files
FastDeploy/examples/vision/segmentation/paddleseg/semantic_segmentation/web/README_CN.md
DefTruth 5b143219ce [Docs] Pick seg fastdeploy docs from PaddleSeg (#1482)
* [Docs] Pick seg fastdeploy docs from PaddleSeg

* [Docs] update seg docs

* [Docs] Add c&csharp examples for seg

* [Docs] Add c&csharp examples for seg

* [Doc] Update paddleseg README.md

* Update README.md
2023-03-17 11:22:46 +08:00

1.7 KiB
Raw Blame History

English | 简体中文

PP-Humanseg v1模型前端部署

模型版本说明

前端部署PP-Humanseg v1模型

PP-Humanseg v1模型web demo部署及使用参考文档

PP-Humanseg v1 js接口

import * as humanSeg from "@paddle-js-models/humanseg";
# 模型加载与初始化
await humanSeg.load(Config);
# 人像分割
const res = humanSeg.getGrayValue(input)
# 提取人像与背景的二值图
humanSeg.drawMask(res)
# 用于替换背景的可视化函数
humanSeg.drawHumanSeg(res)
# 背景虚化
humanSeg.blurBackground(res)

load()函数参数

getGrayValue()函数参数

  • input(HTMLImageElement | HTMLVideoElement | HTMLCanvasElement): 输入图像参数。

drawMask()函数参数

  • seg_values(number[]): 输入参数一般是getGrayValue函数计算的结果作为输入

blurBackground()函数参数

  • seg_values(number[]): 输入参数一般是getGrayValue函数计算的结果作为输入

drawHumanSeg()函数参数

  • seg_values(number[]): 输入参数一般是getGrayValue函数计算的结果作为输入