Created
December 15, 2024 19:49
-
-
Save tosiara/f12fc9a0a5fc4f2e375607298710ae50 to your computer and use it in GitHub Desktop.
Exctract faces and make collage out of them
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=0 | |
for file in *.jpg; do | |
echo "$i $file" | |
name=$(basename "$file") | |
facedetect "$file" | while read x y w h; do | |
convert "$file" -crop ${w}x${h}+${x}+${y} -resize 640x640 "face_${i}.${name##*.}" | |
i=$((i+1)) | |
done | |
i=$((i+1)) | |
done | |
ls face_* -l | wc -l | |
montage -geometry +0+0 -tile 5x5 face*.jpg result.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment