convert_parts.sh 543 B

1234567891011121314151617181920212223242526272829303132
  1. #! /bin/bash
  2. if [ -z "$1" ]
  3. then
  4. echo "No argument supplied"
  5. echo "Need data folder"
  6. exit 1
  7. fi
  8. if [ -z "$2" ]
  9. then
  10. echo "No argument supplied"
  11. echo "Need output folder"
  12. exit 1
  13. fi
  14. prefix="p3d_"
  15. data_folder=$1
  16. output_folder=$2
  17. mkdir -p $output_folder
  18. for folder_path in $(ls -d ${data_folder}*)
  19. do
  20. IFS='/' read -ra ADDR <<< "${folder_path}"
  21. folder=${ADDR[-1]}
  22. if [[ "$folder" == ${prefix}* ]]; then
  23. python utils/extract_parts.py --folder ${folder_path} --output ${output_folder}
  24. fi
  25. done