Search Unity

Question Why I cant use face tracking on World facing camera?

Discussion in 'AR' started by bausegames, Dec 1, 2022.

  1. bausegames

    bausegames

    Joined:
    Aug 13, 2020
    Posts:
    1
    I'm trying to make an app where you can see a picture next to my friend's head.
    I want to use AR Foundation and AR Face Tracking to achieve this.
    But when I try to use the rear camera the XR session disables face tracking.
    I know for a fact that you can track Face Pose with the World Camera because I've seen it in the ar-foundation-samples project.

    upload_2022-12-1_5-38-33.png

    I tried to switch the camera from the start from the user to the world but when it switched it got a new pack of supported features.

    upload_2022-12-1_5-41-58.png
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    Hi @bausegames

    You can control the session configuration that your app chooses via a custom Configuration Chooser, explained in more detail in this video:


    In your case you would want to select a configuration with the following capabilities if it is available on your device:
    Feature.WorldFacingCamera | Feature.FaceTracking
     
    KyryloKuzyk likes this.
  3. ul_antnasce

    ul_antnasce

    Joined:
    Dec 13, 2022
    Posts:
    3
    Does anyone have a working example of this (world facing camera doing face detection) - I've not had any joy following the Custom Configuration video above.
     
  4. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
    This configuration may not be possible depending on your target platform. I believe this is not possible on ARCore. On ARKit, it is possible to enable face tracking while the world-facing camera is enabled, but the face tracking will still use the user-facing camera.

    We have a sample scene for this: https://github.com/Unity-Technologies/arfoundation-samples#rear-camera-arkit