GenSeg-Baselines / code /scripts /nnunet_eval_only_seggen.sh
MaybeRichard's picture
Upload folder using huggingface_hub
057ec4b verified
Raw
History Blame Contribute Delete
1.34 kB
#!/bin/bash
# Re-score ALL 10 nnU-Net datasets (fold 0/1/2) from cached test predictions,
# running in the *seggen* env (which has MONAI+medpy) so HD95/ASSD are real, not
# NaN. Idempotent: overwrites results/baselines/<ds>/nnunet/seed<f>/metrics.json.
set -u
cd /home/wzhang/LSC/Code/NPJ
source /opt/anaconda3/etc/profile.d/conda.sh
conda activate seggen
DATA_ROOT=/home/wzhang/LSC/Dataset/Segmentation/processed_unified
RAW=/home/wzhang/LSC/Code/NPJ/nnunet_workspace/raw
PRED=/home/wzhang/LSC/Code/NPJ/nnunet_workspace/predTs
SPECS=(
"1:cvc_clinicdb:official"
"2:kvasir_seg:official"
"3:fives:official"
"4:refuge2:official"
"5:busi:fold01"
"6:idridd_segmentation:fold01"
"7:acdc_png:official"
"8:pannuke_semantic:fold01"
"9:medsegdb_isic2018:holdout"
"10:medsegdb_kits19:fold01"
)
for spec in "${SPECS[@]}"; do
IFS=: read -r id ds proto <<< "$spec"
for f in 0 1 2; do
outdir=$PRED/d${id}_f${f}
if [ ! -d "$outdir" ] || [ -z "$(ls -A "$outdir"/*.png 2>/dev/null)" ]; then
echo "[skip] $ds fold$f: no predictions in $outdir"; continue
fi
python framework/nnunet_eval.py --data_root "$DATA_ROOT" \
--dataset "$ds" --protocol "$proto" --raw "$RAW" \
--dataset_id "$id" --fold "$f" --pred_dir "$outdir" \
--arch nnunet --exp_name baselines
done
done
echo EVAL_ONLY_ALL_DONE