This project is a demo to show how to use https://www.microsoft.com/cognitive-services. You will need to obtain a key for the Emotion API here.
You can find a demo at http://happyimagetester.azurewebsites.net/
Prefer Node.js? Check out this sample in Node.js.
Use Docker (https://www.docker.com/)
- Clone this repo and move into folder:
CD happy-image-tester-django
- Add environemnt variable with your Cognitive Services key to your current console session:
mac:
export OXFORD_KEY=<yourkey>
windows:set "OXFORD_KEY=<yourkey>"
- Run
docker-compose -f ./docker-compose.debug.yml up
from same session - Browse to the website: open favorite browser to 127.0.0.1:8000
- Use sample images to upload a file
This project can be Setup on Windows or Mac. You will need to add the Emotion API key to your environment variables (see below on how to do that for local environment).
- Install Python 3.5 or greater (it will work with 2.7 if you want to use it)
- Open command prompt and Clone this repo
- Move into cloned repo folder:
CD happy-image-tester-django
- Create a virtual environment:
c:\python34\python.exe -m venv env
(your path to Python may vary) - Install library requirements:
env\scripts\pip install -r requirements.txt
- Open the file
env\scripts\activation.bat
- At the end of the file before
:END
addset "OXFORD_KEY=<yourkey>"
and save file. - Activate Virtual Environment:
env\Scripts\activate.bat
- Start development server:
env\scripts\python manage.py runserver
- Browse to the website: open favorite browser to 127.0.0.1:8000
- Use sample images to upload a file.
When done with development de-activate virtual environment with env\Scripts\deactivate.bat
- Install Python 3.5 or greater (it will work with 2.7 if you want to use it)
- Open command prompt and Clone this repo
- Move into cloned repo folder:
CD happy-image-tester-django
- Create a virtual environment:
python3 -m venv env
- Install library requirements:
env/bin/pip install -r requirements.txt
- Open the file
env/bin/activate
in your favorite text editor - At the middle of the file, after
EXPORT PATH
addexport "OXFORD_KEY=<yourkey>"
and save file. - Activate Virtual Environment:
source env/bin/activate
- Start development server:
env/bin/python manage.py runserver
- Browse to the website: open favorite browser to 127.0.0.1:8000
- Use sample images to upload a file.
When down with development de-activate virtual Environment with deactivate