cookchar

Automatic Waifu2X Upscaler Script

Dec 11th, 2019
110
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. while :
  4. do
  5.     files=`\ls`
  6.     for f in $files
  7.     do
  8.         exten=`echo $f | cut -d '.' -f 2`
  9.         if [ $exten = "png" ] || [ $exten = "jpg" ]
  10.         then
  11.             #Get new name
  12.             namew2x=`echo $f | cut -d '.' -f 1`
  13.             namew2x+="W2X.png"
  14.             #Upscale
  15.             waifu2x-converter-cpp -i $f --noise-level 1 -o converted/$namew2x          
  16.             #Move original
  17.             mv $f originals/.
  18.         fi
  19.     done
  20.     sleep 30
  21. done
RAW Paste Data