Documentation

Una is developed by Una Technologies Limited

All rights reserved

© 2022 Una Technologies Limited

Print

Classifying Pose on Image

Pose Model classify pose on photo and get top … result

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>poseModel</variable><variable>posePredictionResult</variable><variable>imageModel</variable></variables><block type=\"TeachableMachine_PoseModel_predictTopK\" disabled=\"true\" x=\"-22\" y=\"203\"><value name=\"poseModel\"><block type=\"variables_get\" disabled=\"true\"><field name=\"VAR\">poseModel</field></block></value><value name=\"maxPredictions\"><shadow type=\"math_number\" disabled=\"true\"><field name=\"NUM\">0</field></shadow></value></block></xml>"}
				
			

This is used for loading the pose model to classify pose on image and get the appropriate result.

Parameters:

      • AI Model (Teachable Machine Pose Model)
      • Image
      • Number (Default: 0)

Output: Model Prediction Result (From Teachable Machine Pose Model) 
Sample code:

				
					{"blocks":"<xml xmlns=\"https://developers.google.com/blockly/xml\"><variables><variable>poseModel</variable><variable>posePredictionResult</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_predictTopK\"><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><value name=\"maxPredictions\"><shadow type=\"math_number\"><field name=\"NUM\">1</field></shadow></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></block></next></block></next></block></next></block></statement></block></xml>"}
				
			

The output:

pose model classify pose photo and get top ... result - Output
Previous Loading Custom Pose Model from URL
Next Classifying Pose on Image and Get All Result