git clone [email protected]:XuJiacong/PIDNet.git

Download pretrained weights from https://drive.google.com/drive/folders/0BySIOtxxULinfld0LTcxYndTbFpWNjVpWm9nREU1T3hJUW5IS2otOUJDMmtnZERuODFPVU0?resourcekey=0-nauDQNE1efkunvcg89ZlDA and move them to the pretrained_models/cityscapes directory.

PIDNet is trained and exported in its own venv, without mmcv/mmseg: the PIDNet repo ships a top-level models package that collides with SegMAN's (see ../pidnet_model.py). It is replicated from the venv PIDNet was trained in on another machine (frozen in ../requirements-pidnet.txt). The only changes are the PyTorch cu118 index, PerceptionMetrics installed from a local clone instead of git+ssh, and onnx added for torch2onnx.py.

VENVS=/home/dpascualhe/.venvs
GAIA=/home/dpascualhe/proyecto-GAIA

# PIDNet repo + Cityscapes-pretrained checkpoints (from the links in its README), at the path
# the code expects. A clone named PIDNet/ can be symlinked as pidnet/ instead.
git clone https://github.com/XuJiacong/PIDNet $GAIA/local/third_party/pidnet
# -> $GAIA/local/third_party/pidnet/pretrained_models/cityscapes/PIDNet_{S,M,L}_Cityscapes_test.pt

/usr/bin/python3.10 -m venv $VENVS/image-pidnet
$VENVS/image-pidnet/bin/pip install --upgrade pip
$VENVS/image-pidnet/bin/pip install -r $GAIA/Perception/scripts/image/requirements-pidnet.txt
$VENVS/image-pidnet/bin/pip install --no-deps -e /home/dpascualhe/PerceptionMetrics

Tested with Python 3.10.20 and driver 595 (2x RTX 3090). torch 2.1.2+cu118 ships its own CUDA runtime and cuDNN 8.7, so no system CUDA is needed. onnxruntime is the CPU build. Install onnxruntime-gpu instead to benchmark on the GPU (see the image-deploy notes above).