Skip to content

Latest commit

 

History

History
84 lines (57 loc) · 2.72 KB

README.md

File metadata and controls

84 lines (57 loc) · 2.72 KB

Go Demo

Kairos Go Demo Suite

About

This suite consists of 5 demos:

Detect

The Detect Demo uses Kairos Face Recognition API to detect a human face in an existing photo, or a snapshot from the user's webcam. Documentation

Emotion

The Emotion Demo showcases the Kairos Emotion API by giving the user three methods for analyzing human emotions in a video stream.
Documentation

Face Race

The Face Race Demo showcases the Kairos Face Recognition API by allowing the user to upload a photo and allowing the systme to detect the ethic breakdown of the largest face in the image. Documentation

Recognize

The Recognize Demo uses Kairos Face Recognition API to recognize human faces from previously enrolled faces by the user. Documentation

Verify

Using the Kairos Face Recognition API, the Verify Demo compares two photos, and verifies that the two photos are of the same individual. Documentation

Environment Setup and Installation

The demo app can easily be run locally.

The app is basically a single page application, which is viewed at index.php.

Sign-up for your API key via developer.kairos.com and check your inbox for an activation link. You should now have your APP_ID and APP_KEY

To run your app locally, you can install your personal keys into the getEnvVariables() function in the handler-functions.go file:

func getEnvVariables() envVariables {
  api_url = "https://api.kairos.com"
  app_id = "YOUR_APP_ID"
  app_key = "YOUR_APP_KEY"
  demo1_id = "GENERATE_VIDEO_ID" // see documentation

  envVars := envVariables{api_url, app_id, app_key}
  return envVars
}

  • Download and install Go brew install golang
  • Choose a folder for your Go workspace such as $HOME/go
  • Set your GOPATH and PATH variables in your .bash_profile such as:
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
  • Create a directory for your new project
  • Clone the go-demo repo: git clone https://github.com/kairosinc/go-demo <project_name>

Then, cd to your demo repo, and run:

make build

make install

Then, type bin/app, and the site will render at http://localhost:8080

Miscellaneous

For now, there is 1 framework included (echo). Echo is a beefed up version of mux and includes things like pre and post processing or routes.

The following custom golang files are used:

  • main.go - handles routes and renders HTML pages
  • handler-functions.go - contains handler functions and relevant structures

Make this better

Pull requests accepted!! ...