We use the 4 pixel radius to make the point visible to the eye.ĭrawLine procedure draws a line segment on the Canvas between two defined points. This procedure will help us draw the key points of the body such as the joints. Which you may recall from high school Geometry and Algebra.ĭrawPoint procedure draws a small circle of 4 pixel radius on the Canvas at the location of a given defined point. any key point of the body is not trackable by PoseNet, an empty list will be returned to indicate the failure to detect this key point.ĭistance is a function that computes the Euclidean distance between two points on the Canvas when the two points are defined. If the posture of the body is such that perhaps due to poor lighting, messy background, baggy clothes etc. We will use this helper function to collectively check if certain key points of the body are properly tracked and returned by the PoseNet extension. If all the points are defined, it returns true and otherwise, if any of the points is not defined, it returns false. If PoseNet is unable to detect any of the body key points, it will return an empty list for each of the missing key points.ĪllDefined is a Boolean function that checks whether all the points in a given list of points are defined. A point is simply a list of two elements that PoseNet returns representing the x and y-coordinates of the given point’s location.ĭefined is a Boolean function that returns true if the given point is a list of two elements (representing the x and y-coordinates of the point’s location) and false otherwise. GetX and getY functions extract the x and y-coordinates of a given point. You are also given some helper functions. The CanvasLiveButton adjusts the value of a Boolean variable which will be used to display the PoseNet constructed skeleton either on a live background or on a solid black background. The SwapCameraButton toggles the camera view from its default “Front” view to “Back” and vice versa. The ResetButton resets the Dance Score to zero each time it is clicked. These two blocks are used to communicate the status of PoseNet as either “Ready” or in case of error, display the error message. Study these to make sure that you have a general idea what they do. You are also given some preliminary code for the GUI. When PoseNet is unable to track a body key point, it will return an empty list. Whenever PoseNet is able to track a body key point, it will return a list of two elements representing the x and y-coordinates of the key point. The key points of the body tracked by PoseNet are: eyes, ears, nose, shoulders, elbows, wrists, hips, knees and ankles. Note that at the very bottom of the Components panel is the PosenetExtension which is the AI technology that we will be using to track key points of a body and which will help you to build a skeletal version of the body. It is recommended that you do not change the default values given in this starter file. The dimensions of the WebViewer component and the Canvas component have to match in order to facilitate body tracking. The WebViewer component is where the camera view will be cast and the Canvas component is where the skeletal model of the body will be created either against a black background or a live camera view background. ResetButton sets the Dance Score back to zero. CanvasLiveButton toggles the Canvas background from a solid black color to a live camera view. The SwapCameraButton toggles the camera view from Front to Back as the user wishes. However, please do not rename the components, as this tutorial will refer to the given names in the instructions. Please change the properties of the components as you wish to get the look and feel you want. Graphical User Interface (GUI)Ī possible GUI has been created for you in the starter file. To make sure that your mobile device has the needed hardware capability for PoseNet, use AI2 Companion on this. Important: Please note that for this project you cannot use the Emulator to test your app as the Emulator cannot run MIT App Inventor extensions such as the PoseNet Extension. Awesome Dancing with AI (Level: Intermediate) Introductionĭo you like dancing? Are you good at it? Would you like to improve? Is there an algorithm to describe, identify or measure an amazing dance? Can dance moves be quantified and measured? Can AI be used to help you improve your dancing skills? In this project you will learn how to use the new AI technology PoseNet to track key points of your body to create a skeletal model and develop some basic methods to quantify, measure and identify some dance moves.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |