TonyAssi / Segment-Body

9 stars 1 forks source link

Segment Body

Segment body (with or without face) Segment torso

Takes in a PIL image and outputs the segmented body and mask. Built on top of 🤗 Tranformers using the mattmdjaga/segformer_b2_clothes image segmentation model.

Installation

pip install -r requirements.txt

Usage

Import module

from SegBody import segment_body

Import PIL and open image

from PIL import Image
image = Image.open('image.jpg')

Body

Segment body with face

Segment body without face

Torso

Import module

from SegBody import segment_torso

Segment torso