Extension blocks of Cognitive Services are developed with Tensorflow.js and ML5.js open source libraries and have no relation to Microsoft Azure Cognitive Services.

Add Cognitive Services extension

1) Open Codecraft and click Add Extension to open the Extension Library. Click Add in the Extension Library to add Cognitive Services extension blocks to the block category of the Stage mode.
image.png
2) After adding Cognitive Services extension, you can see the Cognitive Services blocks in Block Category of the Stage mode.
image.png
To use this extension, you need a microphone and a camera connected to your computer. At present, the cognitive services provided include:
cs-speech recognition.pngDetect the voice content and return the text results (currently only English is supported). It can detect the following words:
zero
one
two
three
four
five
six
seven
eight
nine
yes
no
up
down
left
right
stop
go

cs-nos.pngThe position of the nose in the camera is detected and the coordinate value of the number is returned.

cs-age.pngDetects the age of the person in the camera and returns the number.

cs-happy.pngCheck whether the expression of the character in the camera is in the set state.

Example: Cognitive Services blocks can interact with the Stage

The following example allows the owl to “see” through the camera whether you are happy, and if so, it will say, “I’m happy!”. Otherwise, say “Hello”. The programming and execution process is shown in the figure below.
cs-happy-p2.png
The program is as follows.
ai-cs-3.png