Skip to content

jaeminSon/segpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Segmentation for pseudolabeling and continal learning

Install

pip install git+https://github.hmckmc.co.kr/airlab/segpack
(github ID, password 입력 필요)

Usage

# training
>>> from segpack import train
>>> train("train_data_name", "val_data_name", "pretrained_network_name", "config_name")

# inference directory structure
root
└── inference
    └── image_file1.jpeg
    └── image_file2.jpeg
    └── ...

# generate png (segmentation map)
>>> from segpack.convert import generate_pseudolabels
>>> generate_pseudolabels("path/to/root", "pretrained_network_name", "segmap", "path/to/output/dir", "segmentation_resize")

# generate labelme readable json
>>> from segpack.convert import generate_pseudolabels
>>> generate_pseudolabels("path/to/root", "pretrained_network_name", "labelme", "path/to/output/dir", "segmentation_resize")

# convert to torchscript model (for faster inference)
>>> from segpack.deploy import generate_jit
>>> generate_jit("bodysealer_test", 2049, 2449, "output/jit")

# run torchscript model (copy codes of Deployer for actual deployment)
>>> from segpack.deploy import Deployer
>>> deployer = Deployer("output/jit/network_jit.pt", (2049,2449), (2048,2448), [0.485, 0.456, 0.406], [0.229, 0.224, 0.225])
>>> result = deployer.inference("samples/img_seg_pairs/image/1.jpg")

# convert format (png -> labelme)
>>> from segpack.convert import convert_format
>>> convert_format("samples/img_seg_pairs", "path/to/output/dir", "segmap", "labelme")

# convert format (labelme -> png)
>>> from segpack.convert import convert_format
>>> convert_format("samples/labelme", "path/to/output/dir", "labelme", "segmap", {"__ignore__": -1, "_background_": 0, "1": 1, "2": 2, "3": 3})

Segmentation data folder structure

스크린샷 2022-08-26 오전 11 39 45

Inference data folder structure

스크린샷 2022-08-26 오전 11 39 49

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages