Extension—Cognitive Services

The Cognitive Services extension provides more image, sound, and knowledge functions for sprites, which allows you to have more fun with stage programming.

Note: To use the Cognitive Services extension, ensure that your PC is equipped with a camera or connected to an external one and that the camera is working properly.

If your camera doesn't work properly, refer to What If My Camera or Microphone Doesn't Work Properly When I Use mBlock 5? to solve the problem.

Add the Cognitive Services extension

1. Click the Sprites tab and click + extension at the bottom of the Blocks area.

1596678324368-09d85f7e-60ff-4c06-b35c-189b1765b5bc.png

2. On the Extension center page that appears, click + Add at the bottom of Cognitive Services.

1596683158917-5feecf34-36b8-4fcc-919f-dd2c6e7ae66b.png

After being added, the extension and its blocks are displayed in the Blocks area.

1596683243589-ad7a8344-007b-49e6-b77e-4b3737ee7359.png

Use the Cognitive Services blocks

Try to use the Cognitive Services blocks.

Create a project and program Panda to recognize your happy emotion.

  1. Program Panda as follows:

1596683790265-8753dfb6-12c4-470e-99db-00892663f955.png

With this program, Panda recognizes your emotion for two seconds after you click the green flag.

  1. Let's make Panda react to your happy emotion. Program Panda as follows:

1596684141745-41a00f6c-85fa-47a1-a92b-55ca7308b229.png

With this program, Panda recognizes that you are happy and says "You are happy!" when the happiness value is greater than 10.

  1. Now, execute the script. When you click the green flag, the recognition window is displayed, and Panda recognizes your emotion in two seconds. The recognition result is displayed on the stage. The value 58 indicates that you are happy, and thus Panda says "You are happy!"

1596683572578-132417b8-1474-4fae-8050-10815681e674.png

1596684415733-563a8df7-0865-472d-afcf-d17a030a605d.png

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.