generate_noise_all_curves.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. for file in "images"/*; do
  2. IFS='/' # space is set as delimiter
  3. read -ra ADDR <<< "$file" # str is read into an array as tokens separated by IFS
  4. IFS=' '
  5. image=${ADDR[1]%".png"}
  6. echo $image
  7. if [ "$image" != "calibration" ] || [ "$image" != *"min_max_values"* ]; then
  8. #for metric in {"lab","mscn_revisited","low_bits_2","low_bits_3","low_bits_4","low_bits_5","low_bits_6","low_bits_4_shifted_2"}; do
  9. for metric in {"lab","low_bits_5","low_bits_4_shifted_2"}; do
  10. for noise in {"cauchy","gaussian","laplace","log_normal","mut_white","white","salt_pepper"}; do
  11. for mode in {"svdn","svdne"}; do
  12. for error in {"MAE","MSE"}; do
  13. filename_prefix="${image}_${noise}_1_to_1000_B30_E800_${metric}_S30_norm"
  14. filename_suffix="_${mode}_${error}"
  15. if [ ! -f "curves_pictures/${filename_prefix}0${filename_suffix}.png" ]; then
  16. python noise_svd_tend_visualization.py --prefix generated/${image}/${noise} --metric ${metric} --n 1000 --mode ${mode} --interval "30, 800" --step 30 --norm 0 --ylim "0, 0.05" --error ${error}
  17. else
  18. echo "Already generated.."
  19. fi
  20. if [ ! -f "curves_pictures/${filename_prefix}1${filename_suffix}.png" ]; then
  21. python noise_svd_tend_visualization.py --prefix generated/${image}/${noise} --metric ${metric} --n 1000 --mode ${mode} --interval "30, 800" --step 30 --norm 1 --ylim "0, 0.1" --error ${error}
  22. else
  23. echo "Already generated.."
  24. fi
  25. if [ ! -f "curves_pictures/${filename_prefix}0${filename_suffix}_color.png" ]; then
  26. python noise_svd_tend_visualization.py --prefix generated/${image}/${noise} --metric ${metric} --n 1000 --mode ${mode} --interval "30, 800" --step 30 --norm 0 --color 1 --ylim "0, 0.05" --error ${error}
  27. else
  28. echo "Already generated.."
  29. fi
  30. if [ ! -f "curves_pictures/${filename_prefix}1${filename_suffix}_color.png" ]; then
  31. python noise_svd_tend_visualization.py --prefix generated/${image}/${noise} --metric ${metric} --n 1000 --mode ${mode} --interval "30, 800" --step 30 --norm 1 --color 1 --ylim "0, 0.1" --error ${error}
  32. else
  33. echo "Already generated.."
  34. fi
  35. done
  36. done
  37. done
  38. done
  39. fi
  40. done