generate_all_noise.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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. for noise in {"cauchy","gaussian","laplace","log_normal","mut_white","white"}; do
  7. for identical in {"0","1"}; do
  8. if [ ${identical} == "1" ]; then
  9. python noise_computation.py --noise ${noise} --image ${file} --n 1000 --identical ${identical} --output ${image}_${noise}.png --step 10 --all 1 &
  10. else
  11. python noise_computation.py --noise ${noise} --image ${file} --n 1000 --identical ${identical} --output ${image}_${noise}_color.png --step 10 --all 1 &
  12. fi
  13. done
  14. done
  15. # specific for salt and pepper noise
  16. for identical in {"0","1"}; do
  17. if [ ${identical} == "1" ]; then
  18. python noise_computation.py --noise salt_pepper --image ${file} --n 1000 --identical ${identical} --output ${image}_salt_pepper.png --step 10 --all 1 --p 0.1 &
  19. else
  20. python noise_computation.py --noise salt_pepper --image ${file} --n 1000 --identical ${identical} --output ${image}_salt_pepper_color.png --step 10 --all 1 --p 0.1 &
  21. fi
  22. done
  23. done