This tutorial enables you to add Sentiment Analysis to Agora's 1-to-1 Video call on Web using the sample app to give you an in-depth view on how to develop with the Agora API
- HTML5 Canvas
- Tensorflow
- Web sockets
- Face detection
- Emotion classification
- Agora.io Developer Account
- Python and web sockets
|
|-Scripts
|-AgoraRTCSDK-2.4.0.js
|-script.js
|-socket.io.js
|--
|-Server
|-models
|-face_box.xml
|-model.hdf5
|--
|-utils
|-data_augmentation.py
|-datasets.py
|-grad_cam.py
|-inference.py
|-preprocessing.py
|-visualizer.py
|--
|-emotions.py
|-README.md
|-requirements.txt
|-server.py
|--
|-styles
|-style.css
|--
|-index.html
|-LICENSE.md
|-README.md
|--
This section shows you how to prepare, build, and run the sample application.
- Create a developer account at agora.io. Once you finish the signup process, you will be redirected to the Dashboard.
- Navigate in the Dashboard tree on the left to Projects > Project List.
- Copy the App ID that you obtained from the Dashboard into a text file. You will need this to use the Agora platform.
- Open the
Server
directory and install the Python requirements through the terminal command.
pip install -r requirements.txt
- After install the requirements, run the server using
python server.py
- Keep the server running.
-
Open the script.js file under the
scripts
directory in a code editor. -
Under Client Setup replace the
APP_ID
with the App Id obtained from the dashboard.Before
client.init("APP_ID",() => console.log("...") ,handleFail);
After
client.init("76db51...e40d15a3",() => console.log("...") ,handleFail);
-
Open the
index.html
file in a web browser and allow access to Camera and Microphone for Audio and Video transmission. -
For a demo, open the same file in an
new tab
, this creates theremote stream
that is displayed on the Canvas and run through the sentiment analysis model.
- Complete API documentation is available at the Document Center.
- You can file bugs about this sample here.
This software is under the MIT License (MIT). View the license.