executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
u-2-netRoute U-2-Net salient object detection, human segmentation, portrait generation, architecture, and training-preparation workflows.
Independent GitHub snapshot · Automated classification · Original documentation governs
Use this skill when the task is about U-2-Net/U2NET PyTorch workflows: salient object detection masks, human/person segmentation, portrait drawing, portrait compositing, model architecture/checkpoints, dependency checks, or DUTS-style training preparation.
This generated skill bundles distilled U-2-Net model code and helper scripts. It does not bundle pretrained .pth weights.
Core workflows need Python with torch, torchvision, numpy, Pillow, scikit-image, and usually cv2 for portrait own-image mode.
A typical CPU-oriented install is:
python -m pip install torch torchvision numpy pillow scikit-image opencv-python matplotlib
Choose a CUDA-enabled PyTorch install only when the user explicitly needs GPU acceleration and the host supports it.
Run scripts/check_environment.py when debugging imports or optional CUDA.
Read model weights before choosing a checkpoint.
Read repo provenance when checking staleness against a new checkout.
| User task | Read |
|---|---|
Choose between U2NET, U2NETP, side outputs, checkpoint compatibility, or run a tiny architecture smoke test. | sub-skills/model-architecture/SKILL.md |
Run generic saliency masks with u2net/u2netp, human/person segmentation, or troubleshoot mask outputs. | sub-skills/salient-object-inference/SKILL.md |
| Run portrait drawing, own-photo face-crop portrait inference, Haar cascade handling, or sigma/alpha composites. | sub-skills/portrait-workflows/SKILL.md |
| Validate DUTS-style data layout, inspect preprocessing, or plan bounded retraining. | sub-skills/data-and-training/SKILL.md |
| Optional PaddleHub/Gradio web demo. | references/optional-demos.md |
python scripts/check_environment.py --check-cuda
For architecture-only smoke testing from this skill directory:
python sub-skills/model-architecture/scripts/smoke_architecture.py --model u2netp --height 64 --width 64 --device cpu
For pretrained saliency, supply explicit weights:
python sub-skills/salient-object-inference/scripts/u2net_infer.py \
--task saliency \
--model u2netp \
--weights PATH_TO_WEIGHTS/u2netp.pth \
--input-dir INPUT_IMAGES \
--output-dir OUTPUT_MASKS \
--device cpu
Do not start large downloads, full training, web demos, or checkpoint overwrites without explicit user approval. Use random-weight smoke flags only for dependency and plumbing checks; never present random outputs as U-2-Net predictions.