9. Palm Keypoint Classification

Perform palm keypoint classification on the AI Camera.

After palm detection inference, the keypoint coordinates are obtained, and the joint angle of each finger is calculated to recognize the gesture (such as fist, five, gun, love, etc.).

9.1. Gestures

../../../../_images/palm_keypoint_classification_gesture.png

id: 0 - fist (clenched fist)

id: 1 - five (open palm)

id: 2 - gun (gun shape)

id: 3 - love (love gesture)

id: 4 - one (number one)

id: 5 - six (number six)

id: 6 - three (number three)

id: 7 - thumbUp (thumbs up)

id: 8 - yeah (victory / peace sign)

9.2. Python Example

Example: Palm Keypoint Classification
#mPythonType:0
from mpython import *
import smartcamera_k230 as smartcamera

smart_camera = smartcamera.SmartCameraK230(tx=Pin.P1, rx=Pin.P0)

smart_camera.model_init(4)

while True:
    smart_camera.hand_keypoint_class.recognize()
    if smart_camera.hand_keypoint_class.gesture_id != None:
        print(str('Gesture id: ') + str(smart_camera.hand_keypoint_class.gesture_id))
        print(str('Gesture string: ') + str(smart_camera.hand_keypoint_class.gesture_str))

9.3. mPython Graphical Example

../../../../_images/palm_keypoint_classification.png