User Manual
Print

Showing the Class Labels in Pose Model

Pose Model get class labels

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>poseModel</variable><variable>posePredictionResult</variable></variables><block type=\"TeachableMachine_PoseModel_getClassLabels\" disabled=\"true\" x=\"-22\" y=\"113\"><value name=\"poseModel\"><block type=\"variables_get\" disabled=\"true\"><field name=\"VAR\">poseModel</field></block></value></block></xml>"}
				
			

This is used for getting class labels from pose model.

Parameters: AI Model (Teachable Machine Pose Model)

Output: Array
Sample code:

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>poseModel</variable><variable>posePredictionResult</variable><variable>labels</variable><variable>index</variable></variables><block type=\"pxt-on-start\" x=\"0\" y=\"0\"><statement name=\"HANDLER\"><block type=\"variables_set\"><field name=\"VAR\">poseModel</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"TeachableMachine_loadPoseModel\"><value name=\"baseUrl\"><shadow type=\"text\"><field name=\"TEXT\">https://teachablemachine.withgoogle.com/models/LL-rF1gZS/</field></shadow></value></block></value><next><block type=\"variables_set\"><field name=\"VAR\">posePredictionResult</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"TeachableMachine_PoseModel_predict\"><value name=\"poseModel\"><block type=\"variables_get\"><field name=\"VAR\">poseModel</field></block></value><value name=\"photo\"><block type=\"Resources_getPhotoByURL\"><value name=\"url\"><shadow type=\"text\"><field name=\"TEXT\">https://i2.wp.com/runnersfirst.co.uk/wp-content/uploads/2019/01/running-woman.jpg?resize=678%2C381&amp;ssl=1</field></shadow></value></block></value></block></value><next><block type=\"variables_set\"><field name=\"VAR\">labels</field><value name=\"VALUE\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"TeachableMachine_PoseModel_getClassLabels\"><value name=\"poseModel\"><block type=\"variables_get\"><field name=\"VAR\">poseModel</field></block></value></block></value><next><block type=\"Camera_showPhoto\"><value name=\"photo\"><block type=\"Resources_getPhotoByURL\"><value name=\"url\"><shadow type=\"text\"><field name=\"TEXT\">https://i2.wp.com/runnersfirst.co.uk/wp-content/uploads/2019/01/running-woman.jpg?resize=678%2C381&amp;ssl=1</field></shadow></value></block></value><next><block type=\"basic_consoleLogText\"><value name=\"text\"><block type=\"Json_JsonValue_stringify\"><value name=\"jsonValue\"><block type=\"TeachableMachine_PosePredictionResult_getResults\"><value name=\"posePredictionResult\"><block type=\"variables_get\"><field name=\"VAR\">posePredictionResult</field></block></value></block></value></block></value><next><block type=\"pxt_controls_for\"><value name=\"VAR\"><shadow type=\"variables_get_reporter\"><field name=\"VAR\">index</field></shadow></value><value name=\"TO\"><shadow type=\"math_whole_number\"><field name=\"NUM\">0</field></shadow><block type=\"math_arithmetic\"><field name=\"OP\">MINUS</field><value name=\"A\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"lists_length\"><value name=\"VALUE\"><block type=\"variables_get\"><field name=\"VAR\">labels</field></block></value></block></value><value name=\"B\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></value></block></value><statement name=\"DO\"><block type=\"basic_consoleLogText\"><value name=\"text\"><block type=\"lists_index_get\"><value name=\"LIST\"><block type=\"variables_get\"><field name=\"VAR\">labels</field></block></value><value name=\"INDEX\"><shadow type=\"math_number\"><field name=\"NUM\">0</field></shadow><block type=\"variables_get\"><field name=\"VAR\">index</field></block></value></block></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></statement></block></xml>"}
				
			

The output:

Pose Model Get Class Labels - Output