avatar-splitting

Document
Chinese English
Introduction
A portrait extraction method based on a mask layer of a portrait area, which separates the person from the background
Installation
- Can be downloaded directly from GitHub
Javascript
introduction
<script src="https://cdn.jsdelivr.net/npm/avatar-splitting@2.0.4/dist/avatar-splitting.min.js"></script>
npm install --save-dev avatar-splitting
import avatar from 'avatar-splitting'
Usage
- The original picture and the mask are the same

avatar({
image:'http://mtapplet.meitudata.com/5d3594af6d16f939d0.jpg',
exportType: 'base64',
success(res) {
console.log(res);
},
error(req) {
console.log(req);
},
});
- Original image and mask two
The original image can be uploaded on the Mito AI open platform to obtain the mask.

avatar({
image:'https://oss.mtlab.meitu.com/mtopen/2QSdx418G5QLTEqCVAtbKrMGTWPcP8tY/MTU2Mzg3MjQwMA==/6fa1e1c5-27cc-4bc4-97de-64edf40a3996.jpg?1563875002917',
maskImage: 'https://oss.mtlab.meitu.com/mtopen/2QSdx418G5QLTEqCVAtbKrMGTWPcP8tY/MTU2Mzg3MjQwMA==/c8c87d26-8d61-420c-aad0-31356af49aa1.jpg?1563875002794',
exportType: 'canvas',
success(res) {
console.log(res);
},
error(req) {
console.log(req);
},
});
Version
2.0.3 -- Modify README.md
2.0.1 -- Support dual image mode (the original image is separated from the mask)
2.0.0 -- Official release
1.0.0 -- Beta release