DeepSight SDK  3.0.0
DeepSight SDK - crowd face analysis
ds_person.h
Go to the documentation of this file.
1 /*
2  * DeepSight face analysis SDK
3  * Copyright (C) 2013-2023 Raydiant Inc. - All Rights Reserved
4  *
5  * This file is subject to the terms and conditions defined in
6  * the 'LICENSE.txt' file, which is part of this source code package.
7  *
8  */
9 
10 #ifndef DS_PERSON_H
11 #define DS_PERSON_H
12 
13 #include "ds_exports.h"
14 
15 #include <opencv2/core/core.hpp>
16 
17 #include <chrono>
18 
19 namespace ds {
21 {
22 public:
23  struct Headpose {
24  short yaw;
25  short pitch;
26  short roll;
27  };
28 
29  struct Emotions
30  {
31  float neutral;
32  float anger;
33  float disgust;
34  float fear;
35  float happiness;
36  float sadness;
37  float surprise;
38  };
39 
40  unsigned int ID { 0 };
41  int age { -1 };
42  float gender { 0.0f };
43  float smile { -1.0f };
44  float faceMask { -1.0f };
45  Emotions emotions { -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f };
46  float detectionConfidence { 0.0f };
47  bool isViewing { false };
48  bool isDwelling { false };
49 
50  cv::Rect boundingBox { 0, 0, 0, 0 };
51  cv::Point3i worldPosition { 0, 0, 0 };
52  Headpose headpose { -360, -360, -360 };
53  cv::Point2i headgaze { 0, 0 };
54  int distanceFromCamera { 0 };
55 
56  std::chrono::system_clock::time_point detectionTime { };
57  std::chrono::milliseconds detectionDuration { 0 };
58  std::chrono::milliseconds totalViewingDuration { 0 };
59  std::chrono::milliseconds currentViewingDuration { 0 };
60  std::chrono::milliseconds totalDwellDuration { 0 };
61  std::chrono::milliseconds currentDwellDuration { 0 };
62 };
63 
64 
66 {
67 public:
68  unsigned int ID { 0 };
69 
70  int avgAge { -1 };
71  float avgGender { 0.0f };
72 
73  bool faceMask { false };
74 
75  Person::Emotions avgEmotions { -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f };
76 
77  float smileViewing { 0.0f };
78  float smileMaximum { 0.0f };
79 
80  unsigned int viewingSessions { 0 };
81  unsigned int dwellSessions { 0 };
82 
83  std::chrono::system_clock::time_point initialDetectionTime { };
84  std::chrono::milliseconds totalDetectionDuration{ 0 };
85  std::chrono::milliseconds totalViewingDuration { 0 };
86  std::chrono::milliseconds averageViewingDuration{ 0 };
87  std::chrono::milliseconds totalDwellDuration { 0 };
88  std::chrono::milliseconds averageDwellDuration { 0 };
89 };
90 
91 
92 class DS_API Body
93 {
94 public:
95  unsigned int ID { 0 };
96  cv::Rect boundingBox { 0, 0, 0, 0 };
97  float detectionConfidence{ 0.0f };
98  std::chrono::system_clock::time_point detectionTime { };
99  std::chrono::milliseconds detectionDuration { 0 };
100 };
101 
102 
104 {
105 public:
106  unsigned int ID { 0 };
107  std::chrono::system_clock::time_point initialDetectionTime { };
108  std::chrono::milliseconds totalDetectionDuration{ 0 };
109 };
110 } /* namespace ds */
111 
112 #endif /* DS_PERSON_H */
ds::Person::Emotions::neutral
float neutral
Quantity of neutral emotion.
Definition: ds_person.h:31
ds::Person::Emotions::anger
float anger
Quantity of anger.
Definition: ds_person.h:32
ds::AggregatedPerson
DeepSight SDK aggregated person class.
Definition: ds_person.h:65
ds::Person::Headpose
Headpose structure for holding head rotation information.
Definition: ds_person.h:23
DS_API
#define DS_API
Controls the importing of the SDK symbols.
ds::Person::Emotions::disgust
float disgust
Quantity of disgust.
Definition: ds_person.h:33
ds::Person
DeepSight SDK person's face class.
Definition: ds_person.h:20
ds::Person::Emotions::fear
float fear
Quantity of fear.
Definition: ds_person.h:34
ds::Person::Headpose::pitch
short pitch
Headpose pitch angle in degrees.
Definition: ds_person.h:25
ds::AggregatedBody
DeepSight SDK aggregated body class.
Definition: ds_person.h:103
ds::Person::Headpose::yaw
short yaw
Headpose yaw angle in degrees.
Definition: ds_person.h:24
ds::Person::Emotions::sadness
float sadness
Quantity of sadness.
Definition: ds_person.h:36
ds::Person::Emotions
Emotion structure for holding facial expression information.
Definition: ds_person.h:29
ds::Body
DeepSight SDK person's body class.
Definition: ds_person.h:92
ds::Person::Emotions::surprise
float surprise
Quantity of surprise.
Definition: ds_person.h:37
ds::Person::Headpose::roll
short roll
Headpose roll angle in degrees.
Definition: ds_person.h:26
ds::Person::Emotions::happiness
float happiness
Quantity of happiness.
Definition: ds_person.h:35
ds_exports.h