Table of Contents

Face Landmark (Python)

Example Description
The example demonstrates how to use face landmarks in the projects.

The example demonstrates how to use face landmarks in the projects. Following are the key steps happening:

  1. Initializing the program with parameters for the sprite, pen, and face detection library.
  2. Running face detection.
  3. Running the loop to show every landmark on the face.

Code

sprite = Sprite('Ball')
fd = FaceDetection()
import time
pen = Pen()

pen.clear()
sprite.setsize(10)

fd.enablebox()

fd.analysestage()

for i in range(68):
  sprite.setx(fd.landmarksx(1, i+1))
  sprite.sety(fd.landmarksy(1, i+1))
  pen.stamp()
  time.sleep(0.2)

Output