... | @@ -4,5 +4,110 @@ |
... | @@ -4,5 +4,110 @@ |
|
|
|
|
|
Por padrão o FindFace não é configurado para usar o cluster, já que ele consome mais recurso da máquina a cada processamento de cluster.
|
|
Por padrão o FindFace não é configurado para usar o cluster, já que ele consome mais recurso da máquina a cada processamento de cluster.
|
|
|
|
|
|
|
|
### Configuração
|
|
|
|
|
|
|
|
1. Abra o arquivo $`\textcolor{red}{\text{/opt/findface-multi/configs/findface-multi-legacy/findface-multi-legacy.py}}`$. E vá até a seção de "Clusters Configurations"
|
|
|
|
|
|
|
|
**Exemplo:**
|
|
|
|
```yaml
|
|
|
|
|
|
|
|
# -- Clusters configuration --
|
|
|
|
'ENABLE_NIGHT_CLUSTERIZATION': False,
|
|
|
|
'ENABLE_REALTIME_CLUSTERIZATION': True,
|
|
|
|
# rrule (recurrence rule) for scheduling "night" clusterization
|
|
|
|
'CLUSTERIZATION_SCHEDULE': 'RRULE:FREQ=DAILY;INTERVAL=1;WKST=MO;BYHOUR=0;BYMINUTE=0',
|
|
|
|
# clusterize only selected objects types (for realtime and nightly clusterization)
|
|
|
|
# available are: face, body, car
|
|
|
|
'CLUSTERIZE_OBJECT_TYPES': ['face'],
|
|
|
|
# keep no more than N the best quality events in centroid (None to disable)
|
|
|
|
'CENTROID_MAX_SIZE': None,
|
|
|
|
# save cluster events without emben and images (only keep thumbnail for the best event)
|
|
|
|
'LONG_LIVING_CLUSTER_EVENTS': False,
|
|
|
|
# skip clusterization if unpinned cluster events count is greater than this value
|
|
|
|
'CLUSTERIZATION_MAX_CLUSTER_EVENTS': None,
|
|
|
|
# create cluster only from cluster events in current case or only from cluster events without case
|
|
|
|
'ISOLATE_CASE_CLUSTERS': True,
|
|
|
|
# cluster event to cluster matching confidence threshold
|
|
|
|
'FACE_CLUSTER_CONFIDENCE_THRESHOLD': 0.714, # model: [mango_320]
|
|
|
|
'BODY_CLUSTER_CONFIDENCE_THRESHOLD': 0.65, # model: [durga]
|
|
|
|
# minimum required event quality for cluster creation
|
|
|
|
'FACE_CLUSTER_EVENT_MIN_QUALITY': 0.5, # model: [quality_fast.v1]
|
|
|
|
'BODY_CLUSTER_EVENT_MIN_QUALITY': 0.6, # model: [pedattr.quality.v0]
|
|
|
|
'CAR_CLUSTER_EVENT_MIN_QUALITY': 0.73, # model: [carattr.quality.v0]
|
|
|
|
# discard cluster event if `max_centroids` similar centroids found with confidence greater than `confidence`
|
|
|
|
'FACE_CLUSTER_MAX_N_SIMILAR': {'enabled': False, 'max_centroids': 5, 'confidence': 0.714},
|
|
|
|
'BODY_CLUSTER_MAX_N_SIMILAR': {'enabled': False, 'max_centroids': 5, 'confidence': 0.65},
|
|
|
|
# minimum required object size in pixels for cluster creation
|
|
|
|
'FACE_CLUSTER_EVENT_MIN_SIZE': 50,
|
|
|
|
'BODY_CLUSTER_EVENT_MIN_SIZE': 50,
|
|
|
|
'CAR_CLUSTER_EVENT_MIN_SIZE': 50,
|
|
|
|
# minimum required number events in episode for cluster creation
|
|
|
|
'FACE_CLUSTER_EVENT_MIN_EPISODE_EVENTS': 1,
|
|
|
|
'BODY_CLUSTER_EVENT_MIN_EPISODE_EVENTS': 1,
|
|
|
|
'CAR_CLUSTER_EVENT_MIN_EPISODE_EVENTS': 1,
|
|
|
|
# age feature threshold for cluster creation
|
|
|
|
'FACE_CLUSTER_EVENT_MIN_AGE_THRESHOLD': 16,
|
|
|
|
....
|
|
|
|
# pinned clusters keep their id and events after reclusterization
|
|
|
|
'CLUSTERS_AUTO_PIN_HEURISTICS': {
|
|
|
|
'face': {
|
|
|
|
# pin clusters with `value` minimum cluster events
|
|
|
|
'min_events': {'enabled': True, 'value': 10},
|
|
|
|
# cluster's centroid similarity confidence is less than
|
|
|
|
'max_centroid_similarity_threshold': {'enabled': True, 'value': 0.54}, # mango_320
|
|
|
|
# minimum average event's quality
|
|
|
|
'min_average_events_quality': {'enabled': True, 'value': 0.45},
|
|
|
|
},
|
|
|
|
'body': {},
|
|
|
|
'car': {},
|
|
|
|
},
|
|
|
|
# always pin clusters with matched events (not affected by heuristics above)
|
|
|
|
'PIN_MATCHED_CLUSTERS': False,
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
|
|
|
2. Ative a clusterização em tempo real, configurando **'ENABLE_REALTIME_CLUSTERIZATION': True**
|
|
|
|
3. Se for preciso, ative a clusterização programada configurando **'ENABLE_NIGHT_CLUSTERIZATION': True**
|
|
|
|
|
|
|
|
> Ativando a clusterização programada só faz sentindo se a clusterização em tempo real estiver ativada. A clusterização programada vai revisar no tempo definido em CLUSTERIZATION_SCHEDULE as cluster já criados
|
|
|
|
|
|
|
|
4. Se for necessário, especifique um horário em que deseja que os cluster sejam revisados usando RRULE (Regra de Recorrência) em CLUSTERIZATION_SCHEDULE, caso deixe o padrão a revisão ocorrerá as 00:00 GMT
|
|
|
|
|
|
|
|
> Calculadora RRULE [aqui](https://jkbrzt.github.io/rrule/)
|
|
|
|
|
|
|
|
5. Por padrão o sistema gera cluster somente de rostos, caso queira expandir para corpo e veículos, modifique a seguinte linha
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
...
|
|
|
|
|
|
|
|
# available are: face, body, car
|
|
|
|
'CLUSTERIZE_OBJECT_TYPES': ['face','body','car'],
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
|
|
|
6. Caso precise modificar o número mínimo de eventos usado pelo cluster, sendo 1 por padrão, modifique esses parâmetros para cada tipo de objeto.
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
...
|
|
|
|
|
|
|
|
# minimum required number events in episode for cluster creation
|
|
|
|
'FACE_CLUSTER_EVENT_MIN_EPISODE_EVENTS': 3,
|
|
|
|
'BODY_CLUSTER_EVENT_MIN_EPISODE_EVENTS': 3,
|
|
|
|
'CAR_CLUSTER_EVENT_MIN_EPISODE_EVENTS': 2,
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
|
|
|
7. Reinicie o FindFace
|
|
|
|
|
|
|
|
```shell
|
|
|
|
cd /opt/findface-multi
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
```shell
|
|
|
|
docker-compose restart
|
|
|
|
```
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
**Lembre-se de que habilitando o cluster o uso de CPU e de memória RAM devem aumentar** |
|
|
|
\ No newline at end of file |