Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.
/ b1-smile Public archive

Analyzes selfies using AWS Rekognition and posts results to Qualtrics survey.

License

Notifications You must be signed in to change notification settings

SAP-archive/b1-smile

Repository files navigation

Deprecation Notice

This public repository is read-only and no longer maintained.


License: Apache2 REUSE status

Smile Survey - Face recognition and Qualtrics APIs

Read full blog post here

Description

This application feeds a Qualtrics survey with the user's rating given a selfie analysed by the Amazon Rekognition API. It also merges the selfie with stickers (other smaller pictures) in case user wants to save it and share to social network.

Requirements

  • A free trial account on SAP Business Technology Platform with Cloud Foundry Trial initialized;
  • The Cloud Foundry Command Line Interface (CLI) on your machine;
  • A Qualtrics Survey with API access

Notes

Deployment

Clone this repository

$ git clone https://github.com/mendesthi/smilesurvey.git

Give a name to your app on the manifest.yml

From the root directory, using the Cloud Foundry CLI push your app to the SAP CP Cloud Foundry

$ cf push

It requires the Qualtrics Tenant, Qualtrics API Survey ID and API Token so you can get programmatic access to the required resources.

The Qualtrics tenant is part of the URL of the tenant your Qualtrics Survey. Suppose the URL for your tenant is https://sapinsights.eu.qualtrics.com/ then you need to set the value "sapinsights.eu" to your QUALTRICS_TENANT variable;

See here how to retrieve Qualtrics API Token and Survey ID, and set them to the environment variables QUALTRICS_TOKEN and QUALTRICS_SURVEYID;

It also requires to configure credentials for AWS SDK. Check the instructions on this post to configure them properly.

Then you finally configure your app as an app client into your user pool. Follow the instructions on this Amazon Cognito Developer Guide to do so.

The AWS s3 is used to temporarly store the picture so the user can download and save it. Create a new bucket on aws s3 and note the bucket name.

Now you have all the AWS and Qualtrics information required, set them to the Cloud Foundry environments:

$ cf set-env <appname> AWS_ACCESS_KEY <your_aws_access_key>
$ cf set-env <appname> AWS_CLIENTID <your_aws_client_id>
$ cf set-env <appname> AWS_SECRET_KEY <your_aws_secret_key>

$ cf set-env <appname> AWS_POOLID <your_aws_pool_id>
$ cf set-env <appname> AWS_USERPOOLID <your_aws_user_pool_id>

$ cf set-env <appname> AWS_USERNAME <your_aws_user_name>
$ cf set-env <appname> AWS_PASSWORD <your_aws_password>
$ cf set-env <appname> AWS_REGION <your_aws_region>

$ cf set-env <appname> AWS_BUCKET <your_aws_S3_bucket_name>

$ cf set-env <appname> QUALTRICS_SURVEYID <your_aws_access_key>
$ cf set-env <appname> QUALTRICS_TENANT <your_aws_access_key>
$ cf set-env <appname> QUALTRICS_TOKEN <your_aws_access_key>

Restart your application (so it can read the new environment variables):

$ cf restart <appname>

Now access the app from the URL route shown in the terminal.

To check that your environment variables have been set correctly, run the following command:

$ cf env <appname>

You should get a list like this:

User-Provided:
AWS_ACCESS_KEY: ABCDE1FG2HIJKLMNOP3QR
AWS_BUCKET: smilebucket
AWS_CLIENTID: 1a2bb3cdefg45h67t2z1tv5ou4
AWS_PASSWORD: MyPassword
AWS_POOLID: eu-west-1:1v2v3h44-5678-9h10-1wd2-1234567aa123
AWS_REGION: eu-west-1
AWS_SECRET_KEY: tABCcDEF1abcdEfGhIJK/12a$bc3ddEFgHiJKL/m
AWS_USERNAME: thecastro
AWS_USERPOOLID: eu-west-1_ABCdE1G2I
QUALTRICS_SURVEYID: SV_cPdRNZGwsIudugh
QUALTRICS_TENANT: sapinsights.eu
QUALTRICS_TOKEN: H0Ce5sn8ejjgFZL7yprCDvyfF7l2puOrA6Lm0D9Y

Support and Contributions

This repository is provided "as-is". No warranty or support is available. Feel free to open issues.

License

Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.

About

Analyzes selfies using AWS Rekognition and posts results to Qualtrics survey.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published