Run human segmentation with u2net_human_seg.pth
masterTo perform human segmentation (e.g., for portrait or body segmentation) using the specialized human segmentation model:
- Setup Model: Download
u2net_human_seg.pthand place it in./saved_models/u2net_human_seg/. - Prepare Data: Place your target images in a directory, for example:
./test_data/test_human_images/. - Run Inference: Execute the following command:
python u2net_human_seg_test.py - Results: The output will be saved in a directory such as
./test_data/u2net_test_human_images_results/.
Note: Due to the labeling accuracy of the Supervisely Person Dataset, this model may not provide hair-level accuracy, but it is more robust for general human segmentation tasks than the standard DUTS-TR trained model.
python u2net_human_seg_test.py