init
This commit is contained in:
30
examples/assets/upscale_resize.sh
Executable file
30
examples/assets/upscale_resize.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/zsh
|
||||
setopt null_glob
|
||||
|
||||
INPUT="./images"
|
||||
OUTPUT="./images_output"
|
||||
MODELPATH="./models"
|
||||
MODELNAME="ultramix-balanced-4x"
|
||||
TARGET_WIDTH="4320"
|
||||
FORMAT="jpg" # 或 webp
|
||||
SCALE=3
|
||||
MAX_SIZE=$((20 * 1024 * 1024)) # 20MB
|
||||
|
||||
|
||||
./bin/mac/upscayl-bin -i "$INPUT" -o "$OUTPUT" -f $FORMAT -m $MODELPATH -n $MODELNAME -w $TARGET_WIDTH -j 4:8:4 -v
|
||||
|
||||
echo "\n===== 输入目录: $INPUT ====="
|
||||
for img in "$INPUT"/*.{png,jpg,jpeg}; do
|
||||
[ -e "$img" ] || continue
|
||||
size=$(stat -f%z "$img")
|
||||
res=$(sips -g pixelWidth -g pixelHeight "$img" 2>/dev/null | awk '/pixelWidth|pixelHeight/ {print $2}' | xargs | sed 's/ /x/')
|
||||
echo "$(basename "$img"): ${size} bytes, ${res}"
|
||||
done
|
||||
|
||||
echo "\n===== 输出目录: $OUTPUT ====="
|
||||
for img in "$OUTPUT"/*.{png,jpg,jpeg}; do
|
||||
[ -e "$img" ] || continue
|
||||
size=$(stat -f%z "$img")
|
||||
res=$(sips -g pixelWidth -g pixelHeight "$img" 2>/dev/null | awk '/pixelWidth|pixelHeight/ {print $2}' | xargs | sed 's/ /x/')
|
||||
echo "$(basename "$img"): ${size} bytes, ${res}"
|
||||
done
|
||||
Reference in New Issue
Block a user