![]() |
DeepSight SDK
3.0.0
DeepSight SDK - crowd face analysis
|
DeepSight SDK body aggregator class. More...
Public Member Functions | |
| BodyAggregator () | |
| ds::BodyAggregator constructor. | |
| ~BodyAggregator () noexcept | |
| ds::BodyAggregator destructor. | |
| BodyAggregator (BodyAggregator &&bodyAggregator) noexcept | |
| ds::BodyAggregator move constructor. | |
| BodyAggregator & | operator= (BodyAggregator &&bodyAggregator) noexcept |
| ds::BodyAggregator move assignment operator. | |
| void | newDetections (const std::vector< ds::Body > &bodies) |
| Adds new detections in the current state of aggregations. More... | |
| std::vector< ds::AggregatedBody > | getFinalizedAggregations (bool clean=true) |
| Get bodies whose aggregation is finalized. More... | |
| std::vector< ds::AggregatedBody > | getOngoingAggregations () const |
| Get bodies whose aggregation is still ongoing. More... | |
| std::vector< ds::AggregatedBody > | getAllAggregations () const |
| Get all aggregations, ongoing and finalized. More... | |
| void | cleanFinalizedAggregations () noexcept |
| Deletes all the finalized aggregations from the internal state. | |
| void | cleanAll () noexcept |
| Deletes ongoing and finalized aggregations from the internal state. More... | |
Static Public Member Functions | |
| static std::vector< ds::AggregatedBody > | aggregateOffline (const std::vector< ds::Body > &bodies) |
| Aggregates all the bodies in the input vector. More... | |
DeepSight SDK body aggregator class.
The ds::BodyAggregator class aggregates all information retrieved at each frame for each unique body. This means that for all ds::Body detections with the same id, the ds::BodyAggregator class produces one single ds::AggregatedBody object with the aggregated values for age, gender, and so on. The aggregation algorithm takes into account the conditions for calculating the best possible value for each estimated feature, like age, gender and so on. It also performs filtering in case a detection has a too short duration and therefore considered as a false positive.
|
static |
Aggregates all the bodies in the input vector.
| bodies | The vector of new detections to aggregate. |
Assuming that all the ds::Body detections for each body are collected in a vector, this functions performs the aggregation in a stateless fashion, that is, without requiring to construct a ds::BodyAggregator object. This is equivalent to:
Example usage:
|
noexcept |
Deletes ongoing and finalized aggregations from the internal state.
| std::vector< ds::AggregatedBody > ds::BodyAggregator::getAllAggregations | ( | ) | const |
Get all aggregations, ongoing and finalized.
This function returns all aggregations, ongoing and finalized. Aggregated bodies who have a too short detection duration are considered false positives and are filtered out.
Example usage:
| std::vector< ds::AggregatedBody > ds::BodyAggregator::getFinalizedAggregations | ( | bool | clean = true | ) |
Get bodies whose aggregation is finalized.
| clean | If true, the returned aggregations are removed from the internal state. |
When a body is not detected for about 5 seconds, DeepSight stops tracking it. Therefore a detection with the same ID cannot be generated anymore. When that happens, there will be no new detection to aggregate for that body and it's therefore considered finalized. This function returns all the bodies whose aggregation is considered finalized. Aggregated bodies who have a too short detection duration are considered false positives and are filtered out.
If the clean parameter is set to true, the returned aggregations are removed from the internal state; this has the same effect as calling ds::BodyAggregator::cleanFinalizedAggregations. Otherwise they will be returned again at the next call of the ds::BodyAggregator::getFinalizedAggregations or ds::BodyAggregator::cleanFinalizedAggregations functions.
Example usage:
| std::vector< ds::AggregatedBody > ds::BodyAggregator::getOngoingAggregations | ( | ) | const |
Get bodies whose aggregation is still ongoing.
This function returns the bodies whose aggregation is not finalized yet and can be updated with new detections in the following frames. Aggregated bodies who have a too short detection duration are considered false positives and are filtered out.
Example usage:
| void ds::BodyAggregator::newDetections | ( | const std::vector< ds::Body > & | bodies | ) |
Adds new detections in the current state of aggregations.
| bodies | New detections to aggregate. |
Use this function to update the current state of each body aggregation after every frame analysis.
Example usage: