Created
June 6, 2015 00:58
-
-
Save quantombone/8999b28fab088a01a6c3 to your computer and use it in GitHub Desktop.
Plays Astley when eyes detected. A rick_roll example using VMX and VMXwebcam.
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
#!/bin/sh | |
# Needs VMX with an "eyes" model, jq, and the vmx_detect.sh script | |
# This will open up the rick astley video when a face is detected from the webcam. | |
# vision.ai 2015 | |
./Contents/Macos/VMXwebcam 2 :0 > url 2> log& | |
./Contents/Macos/VMXwebcam 2 :0 > url & | |
sleep 1 | |
URL=http://`cat url` | |
echo URL IS $URL | |
for i in `seq 1 100000`; do | |
./vmx_detect.sh eyes $URL > json.json | |
REALSCORE=`cat json.json | jq '.objects[0].score'` | |
SCORE=`cat json.json | jq '.objects[0].score > 1'` | |
echo "SCORE is " $REALSCORE | |
if [ "$SCORE" == "true" ]; then | |
#say "Rick roll" | |
open https://www.youtube.com/watch?v=dQw4w9WgXcQ | |
exit | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment