Ajout explication structure modèles
This commit is contained in:
parent
aae27700ad
commit
a7df65b7d9
74
README.md
74
README.md
@ -1,105 +1,121 @@
|
|||||||
# Expérimentations de reconnaissance faciale
|
# Expérimentations de reconnaissance faciale
|
||||||
|
|
||||||
## Les images sources
|
## Les images sources
|
||||||
|
|
||||||
Chris Evan
|
Chris Evan
|
||||||
* https://upload.wikimedia.org/wikipedia/commons/0/0e/Chris_Evans_-_Captain_America_2_press_conference_%28cropped%29.jpg
|
|
||||||
* https://upload.wikimedia.org/wikipedia/commons/3/36/MJK_68238_Daniel_Br%C3%BChl_%28Berlinale_2020%29.jpg
|
- https://upload.wikimedia.org/wikipedia/commons/0/0e/Chris_Evans_-_Captain_America_2_press_conference_%28cropped%29.jpg
|
||||||
|
- https://upload.wikimedia.org/wikipedia/commons/3/36/MJK_68238_Daniel_Br%C3%BChl_%28Berlinale_2020%29.jpg
|
||||||
|
|
||||||
Robert Downey
|
Robert Downey
|
||||||
* https://upload.wikimedia.org/wikipedia/commons/a/ab/Robert_Downey_Jr-2008_cropped.JPG
|
|
||||||
* https://live.staticflickr.com/3882/14802381172_8ac8f59478_b.jpg
|
- https://upload.wikimedia.org/wikipedia/commons/a/ab/Robert_Downey_Jr-2008_cropped.JPG
|
||||||
|
- https://live.staticflickr.com/3882/14802381172_8ac8f59478_b.jpg
|
||||||
|
|
||||||
Jennifer Lawrence
|
Jennifer Lawrence
|
||||||
* https://upload.wikimedia.org/wikipedia/commons/f/fe/Jennifer_Lawrence_in_2018.png
|
|
||||||
* https://upload.wikimedia.org/wikipedia/commons/a/a6/Jennifer_Lawrence_SDCC_2013_X-Men.jpg
|
- https://upload.wikimedia.org/wikipedia/commons/f/fe/Jennifer_Lawrence_in_2018.png
|
||||||
|
- https://upload.wikimedia.org/wikipedia/commons/a/a6/Jennifer_Lawrence_SDCC_2013_X-Men.jpg
|
||||||
|
|
||||||
Margot Robbie
|
Margot Robbie
|
||||||
* https://upload.wikimedia.org/wikipedia/commons/0/00/Margot_Robbie_by_Gage_Skidmore.jpg
|
|
||||||
* https://upload.wikimedia.org/wikipedia/commons/0/0b/Margot_Robbie_%2828316659170%29_%28cropped%29.jpg
|
|
||||||
|
|
||||||
|
- https://upload.wikimedia.org/wikipedia/commons/0/00/Margot_Robbie_by_Gage_Skidmore.jpg
|
||||||
|
- https://upload.wikimedia.org/wikipedia/commons/0/0b/Margot_Robbie_%2828316659170%29_%28cropped%29.jpg
|
||||||
|
|
||||||
> Ces images sont normalement toutes libres de droits. Il peut cependant être judicieux d'indiquer leur source pour en attester.
|
> Ces images sont normalement toutes libres de droits. Il peut cependant être judicieux d'indiquer leur source pour en attester.
|
||||||
|
|
||||||
Une copie de ces images est disponible dans le dossier [src](src)
|
Une copie de ces images est disponible dans le dossier [src](src)
|
||||||
|
|
||||||
|
|
||||||
## Emplacement des visages
|
## Emplacement des visages
|
||||||
|
|
||||||
|
|
||||||
![boxes/ChrisEvan1.jpg](boxes/ChrisEvan1.jpg)
|
![boxes/ChrisEvan1.jpg](boxes/ChrisEvan1.jpg)
|
||||||
|
|
||||||
|
|
||||||
[src/ChrisEvan1.jpg](src/ChrisEvan1.jpg): De 490x218 à 1128x1008
|
[src/ChrisEvan1.jpg](src/ChrisEvan1.jpg): De 490x218 à 1128x1008
|
||||||
|
|
||||||
|
|
||||||
![boxes/ChrisEvan2.jpg](boxes/ChrisEvan2.jpg)
|
![boxes/ChrisEvan2.jpg](boxes/ChrisEvan2.jpg)
|
||||||
|
|
||||||
|
|
||||||
[src/ChrisEvan2.jpg](src/ChrisEvan2.jpg): De 541x1006 à 1844x2347
|
[src/ChrisEvan2.jpg](src/ChrisEvan2.jpg): De 541x1006 à 1844x2347
|
||||||
|
|
||||||
|
|
||||||
![boxes/MargotRobbie1.jpg](boxes/MargotRobbie1.jpg)
|
![boxes/MargotRobbie1.jpg](boxes/MargotRobbie1.jpg)
|
||||||
|
|
||||||
|
|
||||||
[src/MargotRobbie1.jpg](src/MargotRobbie1.jpg): De 527x181 à 1014x715
|
[src/MargotRobbie1.jpg](src/MargotRobbie1.jpg): De 527x181 à 1014x715
|
||||||
|
|
||||||
|
|
||||||
![boxes/MargotRobbie2.jpg](boxes/MargotRobbie2.jpg)
|
![boxes/MargotRobbie2.jpg](boxes/MargotRobbie2.jpg)
|
||||||
|
|
||||||
|
|
||||||
[src/MargotRobbie2.jpg](src/MargotRobbie2.jpg): De 697x359 à 1680x1358
|
[src/MargotRobbie2.jpg](src/MargotRobbie2.jpg): De 697x359 à 1680x1358
|
||||||
|
|
||||||
|
|
||||||
![boxes/RobertDowney1.jpg](boxes/RobertDowney1.jpg)
|
![boxes/RobertDowney1.jpg](boxes/RobertDowney1.jpg)
|
||||||
|
|
||||||
|
|
||||||
[src/RobertDowney1.jpg](src/RobertDowney1.jpg): De 384x159 à 845x736
|
[src/RobertDowney1.jpg](src/RobertDowney1.jpg): De 384x159 à 845x736
|
||||||
|
|
||||||
|
|
||||||
![boxes/RobertDowney2.jpg](boxes/RobertDowney2.jpg)
|
![boxes/RobertDowney2.jpg](boxes/RobertDowney2.jpg)
|
||||||
|
|
||||||
|
|
||||||
[src/RobertDowney2.jpg](src/RobertDowney2.jpg): De 360x119 à 553x350
|
[src/RobertDowney2.jpg](src/RobertDowney2.jpg): De 360x119 à 553x350
|
||||||
|
|
||||||
|
|
||||||
![boxes/JenniferLawrence1.png](boxes/JenniferLawrence1.png)
|
![boxes/JenniferLawrence1.png](boxes/JenniferLawrence1.png)
|
||||||
|
|
||||||
|
|
||||||
[src/JenniferLawrence1.png](src/JenniferLawrence1.png): De 196x115 à 365x314
|
[src/JenniferLawrence1.png](src/JenniferLawrence1.png): De 196x115 à 365x314
|
||||||
|
|
||||||
|
|
||||||
![boxes/JenniferLawrence2.png](boxes/JenniferLawrence2.png)
|
![boxes/JenniferLawrence2.png](boxes/JenniferLawrence2.png)
|
||||||
|
|
||||||
|
|
||||||
[src/JenniferLawrence2.png](src/JenniferLawrence2.png): De 695x428 à 1591x1396
|
[src/JenniferLawrence2.png](src/JenniferLawrence2.png): De 695x428 à 1591x1396
|
||||||
|
|
||||||
|
|
||||||
## "Embeddings"
|
## "Embeddings"
|
||||||
|
|
||||||
L'ensemble des nombres caractérisant les visages générés par mon modèle de classification des visages sont disponibles dans le dossier [embeddings](embeddings).
|
L'ensemble des nombres caractérisant les visages générés par mon modèle de classification des visages sont disponibles dans le dossier [embeddings](embeddings).
|
||||||
|
|
||||||
Voici quelques exemples :
|
Voici quelques exemples :
|
||||||
|
|
||||||
* `ChrisEvan1.jpg`:
|
- `ChrisEvan1.jpg`:
|
||||||
|
|
||||||
```
|
```
|
||||||
0.013588272 0.14924107 0.10293563 -0.0894408 -0.14983389 -0.15014969 -0.10940615 -0.08662054 -0.027009228 0.025306579 0.063713625 0.0029894528 -0.22485909 -0.1171356 -0.028612543 0.052584253 -0.01020841 0.08544659 -0.039860334 0.08512174 0.16187522 -0.12540862 0.04619039 -0.034596693 0.049454086 -0.003330931 -0.02040488 0.12404345 0.044619344 0.06511985 -0.18827626 0.1292971 -0.16731974 0.05794434 -0.080326095 0.13209893 -0.040213954 -0.0860508 -0.19195764 0.02851134 -0.012864292 0.08082352 0.042097613 0.12528199 0.00915616 0.04863165 0.15132628 0.034243103 -0.16731258 0.074604616 -0.065076664 -0.020548549 0.11536233 0.10212831 -0.0850409 -0.069237165 -0.046551146 0.13450986 -0.025315845 0.07234829 0.03134743 -0.013245294 -0.12022436 0.10452058 0.1345366 0.17489764 0.119002044 0.12792549 0.20691383 -0.025321007 -0.05199498 0.019840801 0.006721283 0.11697529 -0.08906952 0.15815419 0.06950762 -0.04278898 -0.03946757 -0.11027197 -0.06240656 -0.030829161 0.035503548 0.026103929 0.13984278 -0.08964199 0.045302223 -0.12754425 -0.008096112 0.11721313 -0.014474002 -0.031576354 0.14043052 0.065895215 -0.06676938 0.043812174 -0.10521634 0.009509598 -0.045587383 -0.02444263 0.00013175681 0.0056394055 0.048152678 -0.11565323 -0.124192216 -0.02743731 -0.163479 0.22907133 -0.022912463 0.036762048 0.03346427 0.035544943 0.026411045 0.11851789 0.020429777 0.19305018 -0.016451316 -0.09938731 -0.013517487 0.09305682 0.16937472 -0.02410161 -0.14735183 -0.10815277 0.06747906 -0.14740476 0.0958967 -0.020174563
|
0.013588272 0.14924107 0.10293563 -0.0894408 -0.14983389 -0.15014969 -0.10940615 -0.08662054 -0.027009228 0.025306579 0.063713625 0.0029894528 -0.22485909 -0.1171356 -0.028612543 0.052584253 -0.01020841 0.08544659 -0.039860334 0.08512174 0.16187522 -0.12540862 0.04619039 -0.034596693 0.049454086 -0.003330931 -0.02040488 0.12404345 0.044619344 0.06511985 -0.18827626 0.1292971 -0.16731974 0.05794434 -0.080326095 0.13209893 -0.040213954 -0.0860508 -0.19195764 0.02851134 -0.012864292 0.08082352 0.042097613 0.12528199 0.00915616 0.04863165 0.15132628 0.034243103 -0.16731258 0.074604616 -0.065076664 -0.020548549 0.11536233 0.10212831 -0.0850409 -0.069237165 -0.046551146 0.13450986 -0.025315845 0.07234829 0.03134743 -0.013245294 -0.12022436 0.10452058 0.1345366 0.17489764 0.119002044 0.12792549 0.20691383 -0.025321007 -0.05199498 0.019840801 0.006721283 0.11697529 -0.08906952 0.15815419 0.06950762 -0.04278898 -0.03946757 -0.11027197 -0.06240656 -0.030829161 0.035503548 0.026103929 0.13984278 -0.08964199 0.045302223 -0.12754425 -0.008096112 0.11721313 -0.014474002 -0.031576354 0.14043052 0.065895215 -0.06676938 0.043812174 -0.10521634 0.009509598 -0.045587383 -0.02444263 0.00013175681 0.0056394055 0.048152678 -0.11565323 -0.124192216 -0.02743731 -0.163479 0.22907133 -0.022912463 0.036762048 0.03346427 0.035544943 0.026411045 0.11851789 0.020429777 0.19305018 -0.016451316 -0.09938731 -0.013517487 0.09305682 0.16937472 -0.02410161 -0.14735183 -0.10815277 0.06747906 -0.14740476 0.0958967 -0.020174563
|
||||||
```
|
```
|
||||||
|
|
||||||
* `JenniferLawrence1.png.txt`
|
- `JenniferLawrence1.png.txt`
|
||||||
|
|
||||||
```
|
```
|
||||||
0.059789382 -0.06540175 0.09384677 -0.09344663 -0.124955855 -0.14620578 0.21621326 0.08681343 -0.22887544 0.16835837 -0.21205847 -0.09929459 -0.07712983 0.18850496 0.0040708827 0.06931689 -0.12965605 -0.19898388 0.15594587 -0.05846893 0.010512652 0.029273292 -0.06976994 -0.009134532 -0.075729 0.15730128 0.20621045 -0.14657775 -0.023199601 0.19438854 -0.025176251 0.16280289 0.15292016 0.203397 -0.042337168 -0.043469157 0.13448407 -0.07164188 0.25583833 0.014922339 -0.11000569 0.17076612 -0.11343877 -0.03459193 -0.07640086 0.09205383 -0.09176708 0.009503559 -0.10276184 -0.0680929 -0.06760132 0.12734948 -0.067464754 0.034245383 -0.030228864 -0.043915395 0.0072117387 0.1366474 0.032039784 0.039552618 -0.13448033 -0.049129415 -0.070208974 -0.11192467 0.0077691986 -0.09058856 0.007923333 0.15862593 -0.0441338 0.18257132 0.11437641 0.047846057 0.06540898 -0.056939643 -0.0064649535 0.04443105 -0.06582029 -0.094180234 0.026080629 -0.043123882 0.052541822 -0.066220045 -0.031253625 -0.014365362 -0.030886997 -0.015664259 -0.09257816 0.0117671965 -0.018785734 0.018891882 -0.086992756 0.1330208 -0.0472171 -0.013287547 -0.080245994 0.0035603195 -0.033081498 -0.017256219 0.06913957 0.0291235 -0.0057697054 -0.04429207 -0.17319635 -0.1331113 -0.048168566 -0.057445955 -0.11418376 -0.10913006 -0.12299465 0.11582708 -0.019224066 -0.1671122 0.011502104 -0.07045502 0.14687648 0.008338821 -0.057212986 -0.07145432 0.11368221 0.06900518 0.07788772 -0.042550106 -0.17789641 0.045252983 0.014051363 0.024645478 0.09975756 0.08491579
|
0.059789382 -0.06540175 0.09384677 -0.09344663 -0.124955855 -0.14620578 0.21621326 0.08681343 -0.22887544 0.16835837 -0.21205847 -0.09929459 -0.07712983 0.18850496 0.0040708827 0.06931689 -0.12965605 -0.19898388 0.15594587 -0.05846893 0.010512652 0.029273292 -0.06976994 -0.009134532 -0.075729 0.15730128 0.20621045 -0.14657775 -0.023199601 0.19438854 -0.025176251 0.16280289 0.15292016 0.203397 -0.042337168 -0.043469157 0.13448407 -0.07164188 0.25583833 0.014922339 -0.11000569 0.17076612 -0.11343877 -0.03459193 -0.07640086 0.09205383 -0.09176708 0.009503559 -0.10276184 -0.0680929 -0.06760132 0.12734948 -0.067464754 0.034245383 -0.030228864 -0.043915395 0.0072117387 0.1366474 0.032039784 0.039552618 -0.13448033 -0.049129415 -0.070208974 -0.11192467 0.0077691986 -0.09058856 0.007923333 0.15862593 -0.0441338 0.18257132 0.11437641 0.047846057 0.06540898 -0.056939643 -0.0064649535 0.04443105 -0.06582029 -0.094180234 0.026080629 -0.043123882 0.052541822 -0.066220045 -0.031253625 -0.014365362 -0.030886997 -0.015664259 -0.09257816 0.0117671965 -0.018785734 0.018891882 -0.086992756 0.1330208 -0.0472171 -0.013287547 -0.080245994 0.0035603195 -0.033081498 -0.017256219 0.06913957 0.0291235 -0.0057697054 -0.04429207 -0.17319635 -0.1331113 -0.048168566 -0.057445955 -0.11418376 -0.10913006 -0.12299465 0.11582708 -0.019224066 -0.1671122 0.011502104 -0.07045502 0.14687648 0.008338821 -0.057212986 -0.07145432 0.11368221 0.06900518 0.07788772 -0.042550106 -0.17789641 0.045252983 0.014051363 0.024645478 0.09975756 0.08491579
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Classification des visages utilisés en exemple
|
||||||
|
|
||||||
|
| | ChrisEvan1.jpg | ChrisEvan2.jpg | JenniferLawrence1.png | JenniferLawrence2.png | MargotRobbie1.jpg | MargotRobbie2.jpg | RobertDowney1.jpg | RobertDowney2.jpg |
|
||||||
|
| --------------------- | -------------- | -------------- | --------------------- | --------------------- | ----------------- | ----------------- | ----------------- | ----------------- |
|
||||||
|
| ChrisEvan1.jpg | **0** | 1.4469901 | 1.5851444 | 1.4725641 | 1.493774 | 1.5233572 | 1.5027672 | 1.5772052 |
|
||||||
|
| ChrisEvan2.jpg | 1.4469901 | **0** | 1.7558935 | 1.7296197 | 1.7195596 | 1.6490623 | 1.5382934 | 1.5368507 |
|
||||||
|
| JenniferLawrence1.png | 1.5851444 | 1.7558935 | **0** | **0.7988865** | 1.3284732 | 1.4284842 | 1.5345646 | 1.5157186 |
|
||||||
|
| JenniferLawrence2.png | 1.4725641 | 1.7296197 | **0.7988865** | **0** | 1.3276035 | 1.4731331 | 1.6620125 | 1.5803103 |
|
||||||
|
| MargotRobbie1.jpg | 1.493774 | 1.7195596 | 1.3284732 | 1.3276035 | **0** | **0.973696** | 1.4589473 | 1.5014138 |
|
||||||
|
| MargotRobbie2.jpg | 1.5233572 | 1.6490623 | 1.4284842 | 1.4731331 | **0.973696** | **0** | 1.6180637 | 1.6254852 |
|
||||||
|
| RobertDowney1.jpg | 1.5027672 | 1.5382934 | 1.5345646 | 1.6620125 | 1.4589473 | 1.6180637 | **0** | **0.7831072** |
|
||||||
|
| RobertDowney2.jpg | 1.5772052 | 1.5368507 | 1.5157186 | 1.5803103 | 1.5014138 | 1.6254852 | **0.7831072** | **0** |
|
||||||
|
|
||||||
|
> La distance correpond l'écart type de chaque valeurs des embeddings de `embeddings_1[i] - embeddings_2[i]` pour `i` variant de `0` à `taille(embeddings)` .
|
||||||
|
|
||||||
## Schéma du fonctionnement général
|
## Schéma du fonctionnement général
|
||||||
|
|
||||||
### Détection des visages
|
### Détection des visages
|
||||||
|
|
||||||
![](./schemas/DetectionVisages.png)
|
![](./schemas/DetectionVisages.png)
|
||||||
|
|
||||||
### Classification des visages
|
### Classification des visages
|
||||||
|
|
||||||
![](./schemas/RecFaciale.png)
|
![](./schemas/RecFaciale.png)
|
||||||
|
|
||||||
### Processus complet
|
### Processus complet
|
||||||
|
|
||||||
![](./schemas/ProcessComplet.png)
|
![](./schemas/ProcessComplet.png)
|
||||||
|
|
||||||
## Explications sur les modèles
|
## Explications sur les modèles
|
||||||
|
|
||||||
|
### Modèle de détection des visages
|
||||||
|
* En entrée : L'image est de taille arbitraire, chaque pixel de l'image est représenté par les trois couleurs rouge, vert et bleu sur un 1 octet (valeur de `0` à `255`)
|
||||||
|
* En sortie : Le modèle fournit, pour chaque visage détecté : : l'emplacement du visage, ainsi que la probabilité qu'il s'agisse bien d'un visage
|
||||||
|
|
||||||
|
|
||||||
|
### Modèle de classification des visages
|
||||||
|
* En entrée :
|
||||||
|
* Les visages à classifier sont redimensionnés pour avoir une taille de 160x160 pixels (avec trois cannaux : rouge, vert, bleu).
|
||||||
|
* Chaque pixel fait l'objet d'un traitement de normalisation : `(valeur - moyenne) / écart type`
|
||||||
|
* En sortie : Le modèle retourne pour chaque visage fournit en entrée les embeddings (la suite de nombre donnée en exemple ci-dessus)
|
6
TODO.md
6
TODO.md
@ -24,9 +24,9 @@ for i in ChrisEvan1.jpg ChrisEvan2.jpg MargotRobbie1.jpg MargotRobbie2.jpg Rober
|
|||||||
```
|
```
|
||||||
|
|
||||||
* [ ] Des informations techniques un peu plus détaillées sur mes modèles
|
* [ ] Des informations techniques un peu plus détaillées sur mes modèles
|
||||||
* [ ] Taille des images en entrée
|
* [x] Taille des images en entrée
|
||||||
* [ ] Transformation appliquées à l'image en entrée
|
* [x] Transformation appliquées à l'image en entrée
|
||||||
* [ ] Nature des données en sortie
|
* [x] Nature des données en sortie
|
||||||
* [ ] La structure des couches des modèles
|
* [ ] La structure des couches des modèles
|
||||||
|
|
||||||
* [x] Un schéma du fonctionnement global du processus
|
* [x] Un schéma du fonctionnement global du processus
|
Loading…
Reference in New Issue
Block a user