Skip to content

Latest commit

 

History

History
145 lines (105 loc) · 4.49 KB

Person_Reidentification.md

File metadata and controls

145 lines (105 loc) · 4.49 KB

Person Re-identification

Nuitrack is now able to recognize the same users if they left the frame and returned back in a single runtime session.

Disclaimer:
For this feature to work Nuitrack SDK uses facial / body features to be able to recognize person on reappearance.
This data is processed in RAM only through a single runtime session and isn't kept / stored / transmitted anyhow anywhere.

Supported platforms

  • Linux x64
  • Windows x64/x86

Try out Re-identification feature

To try the person re-identification:

  • launch the Nuitrack application
  • make sure that the Reidentification checkbox is checked
  • start visualization via Try Nuitrack! button

You will see unique person identifier next to person skeleton, as well as time of first appearance and number of seconds spent in a frame.

Preconditions for triggering Re-identification

  • A person should stand still at a distance of 3 meters or less from the sensor.
  • A person should look directly into the sensor. The face should not be covered by clothes, hands, etc.

If all the conditions above are met, re-identification will not take longer than 1 second. After the re-identification is completed, a unique identifier (UUID) will be assigned to the person, which will be fixed regardless of the direction of the person's face and his movement.

Getting Re-identification data using SDK

Follow these steps to get Re-identification data from Nuitrack.

  1. Enable Re-identification feature after initializing Nuitrack:

    C++
    #include <nuitrack/Nuitrack.h>
    using namespace tdv::nuitrack;
    ...
    
    Nuitrack::init();
    Nuitrack::setConfigValue("Reidentification.ToUse", "true");
    C#
    using nuitrack;
    ...
    
    Nuitrack.Init("");
    Nuitrack.SetConfigValue("Reidentification.ToUse", "true");
  2. Create SkeletonTracker module, connect it to the callback function and start Nuitrack:

    C++
    void onSkeletonUpdate(SkeletonData::Ptr userSkeletons) { /* your SkeletonData processing */ }
    
    ...
    
    auto skeletonTracker = SkeletonTracker::create();
    skeletonTracker->connectOnUpdate(onSkeletonUpdate);
    Nuitrack::run();
    C#
    void onSkeletonUpdate(SkeletonData skeletonData) { /* your SkeletonData processing */ }
    
    ...
    
    SkeletonTracker skeletonTracker = SkeletonTracker.Create();
    skeletonTracker.OnSkeletonUpdateEvent += onSkeletonUpdate;
    Nuitrack.Run();
  3. After you run Nuitrack you can start getting it's data in JSON format like this:

    C++
    while (true)
    {
        Nuitrack::waitUpdate(skeletonTracker);
        auto jsonData = Nuitrack::getInstancesJson();
    }
    C#
    while (true)
    {
        Nuitrack.Update(skeletonTracker);
        string json = Nuitrack.GetInstancesJson();
    }

    Example of JSON file:

    {
        "Timestamp": "1659084464875886",
        "Instances": [
            {
                "id": "1",
                "class": "human",
                "uuid": "2a6de0bd-5ed8-4b57-aedb-f38135f87c14"
            }
        ]
    }

    Note:

    • id is a unique identifier of a person until he leaves the frame. After re-entering the frame, a new ID is assigned. Corresponds to a person ID contained in data received from other Nuitrack modules. This is necessary, for example, so that you can link a person skeleton and its long-term unique identifier.
    • uuid is a long-term unique identifier provided by the reidentification function. This ID will remain the same even if you leave the frame and come back again. But be careful to get it for the first time and restore it after re-entry, you need to turn your face towards the camera once.
  4. Before exiting your program don't forget to release Nuitrack:

    C++
    Nuitrack::release();
    C#
    skeletonTracker.OnSkeletonUpdateEvent -= onSkeletonUpdate;
    
    Nuitrack.Release();