Pedestrian attributes extraction
In addition to pedestrian detection, the SmartFace Platform provides advanced functionality to extract valuable attributes of detected pedestrians. This chapter will guide you through the process of leveraging the SmartFace Platform’s capabilities to extract and store pedestrian attributes.
System configuration
By configuring the system and utilizing services and REST APIs, you can access valuable information about detected pedestrians and integrate it into your workflow.
Service for pedestrian attributes extraction
The SmartFace Platform utilizes the RpcPedestrianExtractor service for extracting pedestrian attributes. This service supports various resources such as: cpu, gpu, any routing.
The SmartFace Platform sends requests with a pedestrian crop image, the service returns the extracted attributes based on the service’s configuration. All attributes obtained through the service are stored in the database and included in the PedestrianInsertedNotificationDTO
for further use and integration.
REST API
To configure the pedestrian attributes extraction, you can utilize the REST API provided by the SmartFace Platform, using endpoint PUT /api/v1/Cameras on your REST API port 8098. By accessing the pedestrianExtractorResourceId parameter within the Camera entity, you have control over enabling or disabling attribute extraction and specifying the desired resource to be utilized. Valid options for pedestrianExtractorResourceId include cpu_remote
, gpu_remote
, any_remote
. These values determine the resource allocation for the attribute extraction process.
Pedestrian attributes and interpretation
We recognize two types of attributes:
confidence attributes - raw attributes directly returned by the underlying attribute extractor. The confidence values associated with these attributes are mapped to a range of 0 to 10 000.
interpreted attributes - derived from confidence attributes through the evaluation of a confidence threshold or by combining multiple attributes.
Below you will find a list of supported pedestrian attributes.
Confidence attributes
Attribute name | Value type | Value range |
---|---|---|
HatConfidence | float | <0 - 10 000> |
GlassesConfidence | float | <0 - 10 000> |
ShortSleeveConfidence | float | <0 - 10 000> |
LongSleeveConfidence | float | <0 - 10 000> |
UpperStripeConfidence | float | <0 - 10 000> |
UpperLogoConfidence | float | <0 - 10 000> |
UpperPlaidConfidence | float | <0 - 10 000> |
UpperSpliceConfidence | float | <0 - 10 000> |
LowerStripeConfidence | float | <0 - 10 000> |
LowerPatternConfidence | float | <0 - 10 000> |
LongCoatConfidence | float | <0 - 10 000> |
TrousersConfidence | float | <0 - 10 000> |
ShortsConfidence | float | <0 - 10 000> |
SkirtOrDressConfidence | float | <0 - 10 000> |
BootsConfidence | float | <0 - 10 000> |
HandBagConfidence | float | <0 - 10 000> |
ShoulderBagConfidence | float | <0 - 10 000> |
BackpackConfidence | float | <0 - 10 000> |
HoldObjectsInFrontConfidence | float | <0 - 10 000> |
SeniorConfidence | float | <0 - 10 000> |
IsAdultConfidence | float | <0 - 10 000> |
IsChildConfidence | float | <0 - 10 000> |
FemaleConfidence | float | <0 - 10 000> |
FrontConfidence | float | <0 - 10 000> |
SideConfidence | float | <0 - 10 000> |
BackConfidence | float | <0 - 10 000> |
Interpreted attributes
Attribute name | Interpreted by | Value type | Interpreted value |
---|---|---|---|
Hat | CommonThreshold | bool | True/False |
Glasses | GlassesThreshold | bool | True/False |
ShortSleeve | CommonThreshold | bool | True/False |
LongSleeve | CommonThreshold | bool | True/False |
UpperStripe | CommonThreshold | bool | True/False |
UpperLogo | CommonThreshold | bool | True/False |
UpperPlaid | CommonThreshold | bool | True/False |
UpperSplice | CommonThreshold | bool | True/False |
LowerStripe | CommonThreshold | bool | True/False |
LowerPattern | CommonThreshold | bool | True/False |
LongCoat | CommonThreshold | bool | True/False |
Trousers | CommonThreshold | bool | True/False |
Shorts | CommonThreshold | bool | True/False |
SkirtOrDress | CommonThreshold | bool | True/False |
Boots | CommonThreshold | bool | True/False |
HandBag | CommonThreshold | bool | True/False |
ShoulderBag | CommonThreshold | bool | True/False |
Backpack | CommonThreshold | bool | True/False |
HoldObjectsInFront | HoldThreshold | bool | True/False |
IsSenior | Will be present if is MAX(IsSenior, IsAdult, IsChild) | bool | True/False |
IsAdult | Will be present if is MAX(IsSenior, IsAdult, IsChild) | bool | True/False |
IsChild | Will be present if is MAX(IsSenior, IsAdult, IsChild) | bool | True/False |
IsMale | MaleConfidence is calculated as inverse confidence to female: (10_000 - FemaleConfidence) then regular CommonThreshold is applied | bool | True/False |
IsMale | CommonThreshold | bool | True/False |
Front | Will be present if is MAX(Front, Back, Side) | bool | True/False |
Side | Will be present if is MAX(Front, Back, Side) | bool | True/False |
Back | Will be present if is MAX(Front, Back, Side) | bool | True/False |
Threshold Interpretation formula
There are 3 possible outcomes of threshold evaluation for interpreted attributes
If confidence value is above upper threshold → TRUE
If confidence value is below threshold → FALSE
If confidence value is between low and upper threshold → Indecisive (attrribute will never be included in response)
Pedestrian attributes configuration
SmartFace Platform allows you to configure which attributes should be returned by extractor and also thresholds for interpretation in RpcPedestrianExtractor
.
Windows installation
Default configuration is as follows and can be found in appsettings.json for the Windows installation.
"Extraction": {
"Attributes": {
"AppendInterpretedAttributesUnderLowerThreshold": false,
"AppendConfidenceAttributes": false,
"AppendInterpretedAttributes": true,
"InterpretationThresholds": {
"CommonThresholdUpper": 8000,
"CommonThresholdLower": 4000,
"GlassesThresholdUpper": 8000,
"GlassesThresholdLower": 4000,
"HoldThresholdUpper": 7000,
"HoldThresholdLower": 3000
}
}
}
Linux installation
For the Docker setup, please add the environmental variables for the pedestrian-extractor service in the docker-compose.yml file:
- Extraction__Attributes__AppendInterpretedAttributesUnderLowerThreshold=false
- Extraction__Attributes__AppendConfidenceAttributes=false
- Extraction__Attributes__AppendInterpretedAttributes=true
- Extraction__Attributes__InterpretationThresholds__CommonThresholdUpper=8000
- Extraction__Attributes__InterpretationThresholds__CommonThresholdLower=4000
- Extraction__Attributes__InterpretationThresholds__GlassesThresholdUpper=8000
- Extraction__Attributes__InterpretationThresholds__GlassesThresholdLower=4000
- Extraction__Attributes__InterpretationThresholds__HoldThresholdUpper=7000
- Extraction__Attributes__InterpretationThresholds__HoldThresholdLower=3000
The resulting service would look like this:
pedestrian-extractor:
image: ${REGISTRY}sf-pedestrian-extractor:${SF_VERSION}
container_name: SFPedestrianExtractorCpu
restart: unless-stopped
environment:
- RabbitMQ__Hostname
- RabbitMQ__Username
- RabbitMQ__Password
- RabbitMQ__Port
- AppSettings__Log_RollingFile_Enabled=false
- AppSettings__USE_JAEGER_APP_SETTINGS
- JAEGER_AGENT_HOST
- Gpu__GpuEnabled=true
- Gpu__GpuNeuralRuntime=Tensor
- Extraction__Attributes__AppendInterpretedAttributesUnderLowerThreshold=false
- Extraction__Attributes__AppendConfidenceAttributes=false
- Extraction__Attributes__AppendInterpretedAttributes=true
- Extraction__Attributes__InterpretationThresholds__CommonThresholdUpper=8000
- Extraction__Attributes__InterpretationThresholds__CommonThresholdLower=4000
- Extraction__Attributes__InterpretationThresholds__GlassesThresholdUpper=8000
- Extraction__Attributes__InterpretationThresholds__GlassesThresholdLower=4000
- Extraction__Attributes__InterpretationThresholds__HoldThresholdUpper=7000
- Extraction__Attributes__InterpretationThresholds__HoldThresholdLower=3000
volumes:
- "./iengine.lic:/etc/innovatrics/iengine.lic"
- "/var/tmp/innovatrics/tensor-rt:/var/tmp/innovatrics/tensor-rt"
runtime: nvidia
Attributes filtering
You can control how many attributes are returned by setting Append configuration properties.
Append configuration property | Description |
---|---|
AppendInterpretedAttributesUnderLowerThreshold | Returns interpreted attributes which did not passed by threshold evaluation |
AppendConfidenceAttributes | Return confidence attributes in response |
AppendInterpretedAttributes | Return interpreted attributes in response |
Thresholds
Threshold name | Value type | Value range | Default value |
---|---|---|---|
CommonThresholdUpper | float | <0..10000> | 8000 |
CommonThresholdLower | float | <0 - 10 000> | 4000 |
GlassesThresholdUpper | float | <0 - 10 000> | 8000 |
GlassesThresholdLower | float | <0 - 10 000> | 4000 |
HoldThresholdUpper | float | <0 - 10 000> | 7000 |
HoldThresholdLower | float | <0 - 10 000> | 3000 |