https://github.com/ternaus/people_segmentation
Code for the model to segment people at the image
https://github.com/ternaus/people_segmentation
computer-vision deep-learning image-segmentation people-segmentation python semantic-segmentation
Last synced: about 1 year ago
JSON representation
Code for the model to segment people at the image
- Host: GitHub
- URL: https://github.com/ternaus/people_segmentation
- Owner: ternaus
- License: mit
- Created: 2020-09-22T03:43:05.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T15:03:17.000Z (over 3 years ago)
- Last Synced: 2025-04-03T00:08:36.139Z (about 1 year ago)
- Topics: computer-vision, deep-learning, image-segmentation, people-segmentation, python, semantic-segmentation
- Language: Python
- Homepage: https://peoplesegmentation.herokuapp.com/
- Size: 33.2 KB
- Stars: 132
- Watchers: 6
- Forks: 22
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# Binary segmentation of people

## Installation
`pip install -U people_segmentation`
### Example inference
Jupyter notebook with the example: [](https://colab.research.google.com/drive/1ZHQ3beJP-7Pbq4I5Jsc8Co2dIkK31ALi?usp=sharing)
## Data
### Train set:
* Mapillary Vistas Commercial 1.2 (train)
* COCO (train)
* Pascal VOC (train)
* [Human Matting](https://www.kaggle.com/laurentmih/aisegmentcom-matting-human-datasets/)
### Validation set:
* Mapillary Vistas Commercial 1.2 (val)
* COCO (val)
* Pascal VOC (val)
* Supervisely
To convert datasets to the format:
```
training
coco
matting_humans
pascal_voc
vistas
validation
coco
pascal_voc
supervisely
vistas
```
use this set of [scipts](https://github.com/ternaus/iglovikov_helper_functions/tree/master/iglovikov_helper_functions/data_processing/prepare_people_segmentation).
## Training
### Define the config.
Example at [people_segmentation/configs](people_segmentation/configs)
You can enable / disable datasets that are used for training and validation.
### Define the environmental variable `TRAIN_PATH` that points to the folder with train dataset.
Example:
```bash
export TRAIN_PATH=
```
### Define the environmental variable `VAL_PATH` that points to the folder with validation dataset.
Example:
```bash
export VAL_PATH=
```
### Training
```
python -m people_segmentation.train -c
```
You can check the loss and validation curves for the configs from [people_segmentation/configs](people_segmentation/configs)
at [W&B dashboard](https://wandb.ai/ternaus/people_segmentation-people_segmentation)
### Inference
```bash
python -m torch.distributed.launch --nproc_per_node= people_segmentation/inference.py \
-i \
-c \
-w \
-o \
--fp16
```
## Web App
https://peoplesegmentation.herokuapp.com/
Code for the web app: https://github.com/ternaus/people_segmentation_demo