#!/usr/bin/env bash # SUM Parts - make the extracted dataset match what the loader globs for # # pcl.zip ships splits named train / validate / test. The dataset class asks for # split='val': # # if split == "train" or split == 'val': # self.data_list = glob.glob(os.path.join(data_root, split, "*.ply")) # # so `validate/` is never found and validation silently runs on 0 samples -- # the same quiet failure mode as a wrong data_root. Symlink val -> validate. # # Track layout after extraction: # face_labeling/{face_cen,possion,random,texsp}_pcl/ -> 13-class triangle # pixel_labeling/{possion,random,texsp}_pcl/ -> 20-class texture # # cfgs/sumv2_triangle uses data_root ../../data/sumv2_tri_texpcl, i.e. the # triangle track sampled with the texture-superpixel sampler: # face_labeling/texsp_pcl set -euo pipefail DATA="$HOME/sum-parts/data" echo "=== linking val -> validate in every track ===" for track in "$DATA"/face_labeling/*_pcl "$DATA"/pixel_labeling/*_pcl; do [ -d "$track" ] || continue if [ -d "$track/validate" ] && [ ! -e "$track/val" ]; then ln -sfn validate "$track/val" echo " linked $(basename "$(dirname "$track")")/$(basename "$track")/val -> validate" fi done echo echo "=== split sizes ===" printf '%-40s %6s %6s %6s\n' "track" "train" "val" "test" for track in "$DATA"/face_labeling/*_pcl "$DATA"/pixel_labeling/*_pcl; do [ -d "$track" ] || continue rel="$(basename "$(dirname "$track")")/$(basename "$track")" # -L so the val symlink is followed; plain find would report 0 and look # like the link did not work tr=$(find -L "$track/train" -name '*.ply' 2>/dev/null | wc -l) va=$(find -L "$track/val" -name '*.ply' 2>/dev/null | wc -l) te=$(find -L "$track/test" -name '*.ply' 2>/dev/null | wc -l) printf '%-40s %6s %6s %6s\n' "$rel" "$tr" "$va" "$te" done echo echo "=== recommended data_root ===" echo " triangle (13 classes) : $DATA/face_labeling/texsp_pcl" echo " texture (20 classes) : $DATA/pixel_labeling/texsp_pcl" echo "SPLIT DONE"