I was asked to check how difficult it will be to make a simple application for face recognition. And this is the PoC of that research.
I'm using tracking.js library for face detection and Microsoft Cognitive-Services Face API for face recognition. To use Face API you have to register and generate API key. It is not a problem because API is free for 30K calls per month :-).
Scala and Spring boot are used as a backend server
Start www frontend application
# Create configuration with ms-face-api key
cat <<EOF > application-prod.yaml
projectOxford:
subscriptionKey: "XXXXXXX"
EOF
# And run application
SPRING_PROFILES_ACTIVE="prod" ./gradlew run
Open http://localhost:8080/ in your favorite web browser
Start www frontend application with local configuration
SPRING_PROFILES_ACTIVE="local" ./gradlew run
Local testing will give you mocked ms-face-api, so you can work even without ms-face-api account. ms-face-api will return ok-fail1-fail2-...
Start watch js files and update them after changes
# run watch using gradle
./gradlew npmWatch
# or you can run watch using npm
npm run watch
Application in production environment will need SSL configuration.