Skip to main content
Version: 3.11.1

Swift Demo Program

Swift Video Recognition Demo

The program demonstrates tracking, detection and identification of faces from the database on the video stream from the camera. Also gender, age and main emotion are determined for tracked faces.

Software requirements

  • XCode >= 10
  • iOS-device with iOS >= 12

Running the demo program

  1. Open the project file examples/swift/video_recognition_demo/video_recognition_demo.xcodeproj in the XCode.
  2. Open the project settings. In the "Build Settings" tab, go to the "Signing" section. Select the value of the "Development Team" parameter.
  3. Click the "Run" button to build and run the application.

Note: face detection and identification is performed only when the device is in vertical (portrait) orientation.

After launching the application, a preview from the front camera of the device is displayed on the device screen. A red circle is displayed around the detected faces. Inside the circle, information about the age, gender and dominant emotion of the person is displayed.

Face detection

To identify a person, you need to add him/his face to the database. To add a face to the database, enter the person's name in the text box at the bottom of the screen and click on the "Add to database" button.
Note: you can add a face to the database only when there is one person in front of the camera.

If the person is identified, then the color of the circle changes from red to green, and the name from the database is displayed.

Face identification