diff --git "a/Apresentacao_do_projeto/.ipynb_checkpoints/Apresenta\303\247\303\243o_Landmarks-checkpoint.ipynb" "b/Apresentacao_do_projeto/.ipynb_checkpoints/Apresenta\303\247\303\243o_Landmarks-checkpoint.ipynb" index b5f6f3b..139c462 100755 --- "a/Apresentacao_do_projeto/.ipynb_checkpoints/Apresenta\303\247\303\243o_Landmarks-checkpoint.ipynb" +++ "b/Apresentacao_do_projeto/.ipynb_checkpoints/Apresenta\303\247\303\243o_Landmarks-checkpoint.ipynb" @@ -77,7 +77,7 @@ "\n", "Representação das distâncias em um rosto desenhado | Cálculo das respectivas distâncias\n", ":-------------------------------------------------:|:-------------------------:\n", - "![face.png](face.png) | ![dist.png](dist.png)\n", + "![ims/face.png](imgs/face.png) | ![imgs/dist.png](imgs/dist.png)\n", "Fonte: [[Feature-Based Face Recognition Using Mixt ure-Distance](https://ieeexplore.ieee.org/document/517076) | Fonte: [Feature-Based Face Recognition Using Mixt ure-Distance](https://ieeexplore.ieee.org/document/517076)\n", "\n", " Dessa forma foi proposto extrair essas features a partir de uma foto tirada de uma webcam. Algumas considerações importantes, se o modelo não consegue identificar o rosto, as *landmarks* não são expostas, consequentemente o cálculo da distância joga um erro. Como a distância é variável de acordo com a proximidade do rosto à câmera, decidiu-se utilizar uma como normalizadora das outras, no caso, a terceira: distância entre têmporas, por ser constituída majoritáriamente de osso, essa distância é razoavelmente invariante à expressão facial." @@ -2330,6 +2330,1060 @@ "source": [ "std_clf.score(stdtest_x, test_y)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# DeepFace - Uma nova abordagem mais tradicional" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + " Os resultados acima são considerávelmente satisfatórios, ainda mais considerando uma abordagem clássica, sem uso de redes neurais. Ainda assim a curiosidade do grupo em relação ao ganho de desempenho possível ao utilizar esse método hoje mais tradicional motivou uma busca por implementações de redes que já foram implementadas e treinadas com tal objetivo, visto que o treino é proibitivo para o grupo, devido à falta de um dataset da magnitude necessária. Assim tentamos nos ater à alguma rede já treinada, tentar modificar sua implementação para nossas necessidades e, se necessário, realizar um ajuste fino de parâmetros para melhorar o desempenho da mesma." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + " É com esse objetivo que encontramos a interface DeepFace, disponível em: [DeepFace](https://github.com/serengil/deepface). Essa implementação de uma biblioteca que busca utilizar grandes redes de identificação de features faciais, acessar o vetor flatten da rede e realizar a comparação dois a dois destes vetores utilizando alguma métrica de distâncias. Os vetores então podem ser considerados a **codificação das respectivas imagens**, utilizando um threshold definido pela própria biblioteca é possível decidir se as imagens pertencem ou não à mesma pessoa. No caso a biblioteca faz uso de quatro redes diferentes:\n", + ">**VGG-Face**: \n", + "Desenvolvida por Oxford, esta rede tem sua arquitetura baseada na VGG16 e está sob a licença Creative Commons Attribution, logo não pode ser utilizada em uso comercial.\n", + "\n", + ">**Facenet**: Rede desenvolvida com base na arquitetura de Zeiler&Fergus, bem como também baseada na inception. Implementada em tensorflow, é uma rede antiga mas tem ótimos resultados. Sua licença é a MIT, portanto pode ser utilizada em uso comercial.\n", + "\n", + ">**OpenFace**: Implementada em Torch, essa rede é baseada no mesmo paper da Facenet, inclusive foi uma inspiração para a atualização desta pós primeiro lançamento. Está sob a liceça Apache 2.0 e pode ser usada comercialmente.\n", + "\n", + ">**Deepface**:\n", + "\n", + "Baseado em um paper de mesmo nome publicado em 2014, esta rede é a implementação da equipe de desenvolvimento do facebook, utilizando a API do Keras. É considerada a mais complexa das quatro aqui citadas e também está sob a licença MIT.\n", + "\n", + "Assim é possível utilizar qualquer uma das 4 redes citadas acima, e utilizar uma das seguintes métricas: similaridade de cossenos, distância euclidiana, e distância L2. Mas, como temos todos os modelos disponíveis, é possível também realizar um ensemble learning de todos os modelos, utilizando todas as métricas, para fazer a verificação, assim temos o seguinte esquema:\n", + "\n", + "\n", + "Que é exatamente o que vamos fazer, modificamos a biblioteca original para funcionar melhor com os propósitos do banco, e com propósitos próprios do grupo que vamos mostrar a seguir. A rede ainda possui outras funcionalidades interessantes, como verificação de gênero, idade, etinia, sentimento, etc." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Funcionamento da biblio modificada pelo grupo:" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Using TensorFlow backend.\n" + ] + } + ], + "source": [ + "from deepface import DeepFace\n", + "import cv2\n", + "import numpy as np #para trabalhar com vetores\n", + "import glob\n", + "import os \n", + "import shutil\n", + "import pathlib\n", + "import os\n", + "import pandas as pd" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [], + "source": [ + "dic = DeepFace.make_dict('/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces')" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'Rodrigo_Fill.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Rodrigo_Fill/Fill01.jpeg',\n", + " 'Rodrigo_Fill.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Rodrigo_Fill/Fill02.jpeg',\n", + " 'Luisa_Heise.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Luisa_Heise/Luisa02.jpeg',\n", + " 'Luisa_Heise.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Luisa_Heise/Luisa01.jpeg',\n", + " 'Ariel_Guerreiro.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Ariel_Guerreiro/Ariel01.jpeg',\n", + " 'Ariel_Guerreiro.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Ariel_Guerreiro/Ariel02.jpeg',\n", + " 'Guilherme_Goncalves.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Guilherme_Goncalves/Gui01.jpeg',\n", + " 'Guilherme_Goncalves.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Guilherme_Goncalves/Gui02.jpeg',\n", + " 'Camila_Fonseca.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Camila_Fonseca/Camila02.jpeg',\n", + " 'Camila_Fonseca.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Camila_Fonseca/Camila01.jpeg',\n", + " 'Guilherme_Cola.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Guilherme_Cola/Cola02.jpeg',\n", + " 'Guilherme_Cola.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Guilherme_Cola/Cola01.jpeg',\n", + " 'Noel_Viscome.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Noel_Viscome/Noel02.jpeg',\n", + " 'Noel_Viscome.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Noel_Viscome/Noel01.jpeg',\n", + " 'Victor_Jinsi.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Victor_Jinsi/Victor01.jpeg',\n", + " 'Eduardo_Eiras.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Eduardo_Eiras/Edu06.jpg',\n", + " 'Eduardo_Eiras.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Eduardo_Eiras/Edu05.jpeg',\n", + " 'Eduardo_Eiras.3': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Eduardo_Eiras/Edu03.jpeg',\n", + " 'Eduardo_Eiras.4': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Eduardo_Eiras/Edu04.jpeg',\n", + " 'Eduardo_Eiras.5': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Eduardo_Eiras/Edu01.jpeg',\n", + " 'Eduardo_Eiras.6': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Eduardo_Eiras/Edu02.jpg',\n", + " 'Eduardo_Eiras.7': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Eduardo_Eiras/Edu07.jpg',\n", + " 'Nelson_Alves.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Nelson_Alves/Nelson02.jpeg',\n", + " 'Nelson_Alves.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Nelson_Alves/Nelson01.jpeg',\n", + " 'Leonardo_Murakami.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Leonardo_Murakami/Mura01.jpeg',\n", + " 'Leonardo_Murakami.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Leonardo_Murakami/Mura02.jpeg',\n", + " 'Felipe_Azank.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Felipe_Azank/Azank02.jpeg',\n", + " 'Felipe_Azank.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Felipe_Azank/Azank03.jpeg',\n", + " 'Felipe_Azank.3': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Felipe_Azank/Azank01.jpeg',\n", + " 'Enzo_Bustos.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Enzo_Bustos/Enzo02.jpeg',\n", + " 'Enzo_Bustos.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Enzo_Bustos/Enzo01.jpeg',\n", + " 'Paulo_Sestini.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Paulo_Sestini/Paulo01.jpeg',\n", + " 'Paulo_Sestini.2': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Paulo_Sestini/Paulo02.jpeg',\n", + " 'Alex_Koji.1': '/home/fill/Documentos/Turing/VC/DeepFace/Turing_Faces/Alex_Koji/Koji01.jpeg'}" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "dic" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Ensemble learning enabled\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Loading Facebook DeepFace: 100%|██████████| 4/4 [00:43<00:00, 10.87s/it]\n", + "Avaliando Hash: 100%|██████████| 34/34 [01:10<00:00, 2.08s/it]\n" + ] + } + ], + "source": [ + "df = DeepFace.save_hash(dic)" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
VGG-FaceFacenetOpenFaceDeepFace
Rodrigo_Fill.1[0.011258397, -0.0051986985, -0.0035807253, 0....[-0.7107556, 0.2447348, -1.3264471, 0.20392153...[0.09385188, -0.07862704, 0.0021203938, 0.0650...[0.0, 0.0, 0.66140383, 0.0, 0.6555716, 2.81141...
Rodrigo_Fill.2[0.01038197, -0.009693551, 0.008820645, 0.0113...[0.81892776, 1.5169264, -2.3059661, 0.83081686...[0.07494784, -0.013211267, -0.101745866, 0.045...[0.0, 0.0, 0.76971376, 1.1680458, 3.7435546, 1...
Luisa_Heise.1[0.013311128, 0.016905498, 0.017590838, 0.0007...[0.15546729, -0.48523352, 1.1752089, -1.828793...[0.03517189, 0.043330558, -0.080343574, 0.0138...[0.0, 0.0, 0.0, 0.3481037, 1.2885046, 3.498858...
Luisa_Heise.2[0.0052965735, 0.007177258, -0.0013739086, 0.0...[-1.5654796, -1.0087686, 0.77439445, -0.830853...[0.015118088, 0.01344703, -0.10854726, -0.0123...[0.0, 0.0, 0.0, 0.0, 1.1309611, 4.682887, 2.07...
Ariel_Guerreiro.1[0.019220604, 0.015955398, 0.025329819, 0.0061...[1.8040531, 2.4030004, -1.5023875, 1.736949, 0...[-0.03975611, 0.10978596, 0.016175106, 0.07090...[0.0, 0.0, 0.0, 0.9227623, 2.601956, 0.0, 0.90...
Ariel_Guerreiro.2[0.008694698, -0.005788977, -0.0016123804, -0....[-0.19725096, 1.6418126, -1.1741674, 0.9594986...[0.019117408, 0.18743879, 0.025908452, 0.05127...[0.0, 0.0, 0.0, 0.36150473, 0.0, 2.553075, 2.4...
Guilherme_Goncalves.1[0.0071882443, 6.268373e-05, 0.007376805, 0.00...[-0.5617701, 0.15997693, 0.18063924, 0.9567702...[-0.041704994, -0.00016754917, 0.035282012, -0...[0.0, 0.0, 0.0, 0.03970301, 1.1502867, 0.0, 2....
Guilherme_Goncalves.2[0.008158567, -0.00033164697, 0.009618739, 0.0...[-0.7463429, -0.24570425, 0.20713773, 1.214165...[-0.029539527, 0.004947966, 0.0065265903, -0.0...[0.0, 0.0, 0.0, 0.0, 0.47723967, 0.0, 3.388195...
Camila_Fonseca.1[0.020502472, 0.014146947, 0.013597289, -0.001...[-1.8097155, -1.8309294, -1.20493, 1.3271358, ...[0.051527027, -0.008045665, -0.070917234, 0.00...[0.0, 0.0, 0.0, 0.30561933, 3.0658455, 2.70023...
Camila_Fonseca.2[0.016508777, 0.0141032515, 0.017723288, 0.007...[-1.3376508, -1.5952889, 0.25136778, 1.1719253...[0.033205245, 0.06364468, -0.036076825, -0.026...[0.0, 0.0, 0.0, 0.0, 2.3348985, 5.3893414, 2.8...
Guilherme_Cola.1[0.011286672, -0.0031716733, 0.006024914, 0.00...[-0.10863148, 0.12147777, -2.1797159, 2.553167...[0.09351041, 0.023937931, 0.014001634, 0.13893...[0.0, 0.0, 0.0, 0.0, 0.0, 3.8363554, 0.0, 0.0,...
Guilherme_Cola.2[0.016229464, -0.006794181, 0.0052082087, -1.6...[0.19653642, -0.065777265, -2.1988037, 2.93330...[0.07559654, 0.0140757235, -0.089574635, 0.076...[0.0, 0.0, 0.0, 0.0, 0.8358648, 6.13692, 1.777...
Noel_Viscome.1[0.007722295, -0.0032768892, 0.01261278, 0.015...[-1.7278033, 0.26465106, 0.6038073, 0.36027545...[0.038704526, 0.07394758, -0.09165, 0.04594578...[0.0, 0.0, 0.0, 0.064310044, 1.9042714, 2.0811...
Noel_Viscome.2[0.009547951, 0.0034925663, 0.01011407, 0.0061...[-0.5509963, 0.74306023, 0.14488125, -0.936631...[0.051902585, -0.023795338, -0.08508713, -0.03...[0.0, 0.0, 0.0, 0.0, 3.124282, 2.3894014, 3.08...
Victor_Jinsi.1[0.020444352, 0.010158352, 0.00625316, 0.01316...[0.5734688, 0.86270785, -0.64202434, 1.1462065...[-0.01967564, 0.0672678, 0.011682327, 0.033551...[0.0, 0.0, 0.0, 0.0, 2.0280519, 0.0, 1.4935838...
Eduardo_Eiras.1[0.021600582, 0.006747674, 0.013444074, 0.0118...[-0.34935245, -0.37163797, -0.39313334, 0.7243...[-0.005565289, 0.051990893, -0.041520093, -0.0...[0.0, 0.0, 0.0, 0.26732165, 1.0506326, 0.35762...
Eduardo_Eiras.2[0.027794681, 0.012595378, 0.015973512, 0.0243...[0.4253676, 0.68349314, 0.5815365, -0.06460958...[-0.0114504425, -0.02118617, -0.09935128, -0.0...[0.0, 0.0, 0.0, 0.0, 3.7076707, 0.6628028, 2.7...
Eduardo_Eiras.3[0.023938581, -0.005019143, -0.0041286526, 0.0...[-1.293877, -0.1234024, -1.4063007, 1.3587369,...[-0.02248524, 0.14344844, 0.04551649, 0.008724...[0.0, 0.0, 0.0, 0.0, 2.8374405, 2.356803, 0.70...
Eduardo_Eiras.5[0.014218462, 0.0028408384, 0.012237807, 0.018...[-1.3807191, 0.006177306, -0.50413, 1.6096864,...[-0.004796549, 0.002740741, -0.01581459, -0.02...[0.0, 0.0, 0.0, 0.0, 3.0053782, 0.65704703, 2....
Eduardo_Eiras.6[0.023989934, 0.014054777, 0.004245261, 0.0108...[-0.7857877, 0.35950303, -0.56709725, 0.465594...[-0.03314291, -0.03338445, -0.0071588843, -0.0...[0.0, 0.0, 0.0, 0.27838233, 0.0, 1.7221168, 1....
Eduardo_Eiras.7[0.023237122, 0.011033161, 0.016982649, 0.0112...[-0.9716029, -0.26354784, -0.4264811, 1.663771...[-0.06154397, 0.031329878, 0.051613558, -0.094...[0.0, 0.0, 0.0, 0.334877, 0.69340277, 0.0, 0.0...
Nelson_Alves.1[0.011202453, -0.011317662, 0.006242816, -0.00...[0.2442035, -0.018297125, -1.086241, 1.2000073...[0.0517047, 0.13678262, 0.06404092, 0.07557396...[0.0, 0.0, 0.0, 0.0, 1.1573782, 2.4152763, 1.9...
Leonardo_Murakami.1[0.017816652, -0.0014210419, 0.0012131145, 0.0...[-1.7009012, -0.6807573, 0.14056861, -0.153483...[-0.015473774, -0.0020993, -0.03174869, -0.055...[0.0, 0.0, 0.0, 0.62446773, 0.0, 0.0, 1.890828...
Leonardo_Murakami.2[0.01864994, 0.0052387556, -0.0028785854, 0.01...[-1.7920934, -1.4230772, 0.6691602, -0.2342174...[0.035412, 0.00017503757, -0.043976996, -0.071...[0.0, 0.0, 0.0, 0.6731644, 0.0, 0.0, 0.6979854...
Enzo_Bustos.1[0.02399399, 0.0052210162, -0.015569969, 0.012...[-2.1904962, -1.3387287, 0.13840455, 0.6652469...[0.10071324, -0.036814034, -0.1275556, 0.04338...[0.0, 0.0, 0.0, 0.0, 4.0648704, 8.178255, 1.45...
Enzo_Bustos.2[0.019614054, 0.0023429843, -0.0011203118, 0.0...[0.29559124, -0.25272578, 0.33746648, 1.579556...[0.13314737, 0.06992418, -0.15777715, 0.004923...[0.0, 0.0, 0.0, 0.0, 2.9943137, 5.8091803, 3.4...
Paulo_Sestini.1[0.013956297, 0.00030987675, 0.0015853783, 0.0...[-1.698124, -0.39025182, -1.4879581, 1.7800299...[-0.0883103, -0.007851686, 0.0411439, -0.07708...[0.0, 0.0, 0.0, 0.0, 1.3161561, 0.009125233, 1...
Paulo_Sestini.2[0.015406041, -0.00386795, -0.0001494264, 0.00...[-0.886387, 0.30212864, 0.016729653, 2.1621618...[-0.043899756, 0.054894928, 0.010215374, -0.05...[0.0, 0.0, 0.0, 0.0, 1.3580369, 0.0, 2.9301717...
Alex_Koji.1[0.013313855, 0.016293736, -0.0011014326, 0.00...[0.06953996, -1.1348931, -1.6284283, 0.6346901...[-0.004252907, 0.17901103, 0.0792524, 0.141097...[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8053236, 0.0,...
\n", + "
" + ], + "text/plain": [ + " VGG-Face \\\n", + "Rodrigo_Fill.1 [0.011258397, -0.0051986985, -0.0035807253, 0.... \n", + "Rodrigo_Fill.2 [0.01038197, -0.009693551, 0.008820645, 0.0113... \n", + "Luisa_Heise.1 [0.013311128, 0.016905498, 0.017590838, 0.0007... \n", + "Luisa_Heise.2 [0.0052965735, 0.007177258, -0.0013739086, 0.0... \n", + "Ariel_Guerreiro.1 [0.019220604, 0.015955398, 0.025329819, 0.0061... \n", + "Ariel_Guerreiro.2 [0.008694698, -0.005788977, -0.0016123804, -0.... \n", + "Guilherme_Goncalves.1 [0.0071882443, 6.268373e-05, 0.007376805, 0.00... \n", + "Guilherme_Goncalves.2 [0.008158567, -0.00033164697, 0.009618739, 0.0... \n", + "Camila_Fonseca.1 [0.020502472, 0.014146947, 0.013597289, -0.001... \n", + "Camila_Fonseca.2 [0.016508777, 0.0141032515, 0.017723288, 0.007... \n", + "Guilherme_Cola.1 [0.011286672, -0.0031716733, 0.006024914, 0.00... \n", + "Guilherme_Cola.2 [0.016229464, -0.006794181, 0.0052082087, -1.6... \n", + "Noel_Viscome.1 [0.007722295, -0.0032768892, 0.01261278, 0.015... \n", + "Noel_Viscome.2 [0.009547951, 0.0034925663, 0.01011407, 0.0061... \n", + "Victor_Jinsi.1 [0.020444352, 0.010158352, 0.00625316, 0.01316... \n", + "Eduardo_Eiras.1 [0.021600582, 0.006747674, 0.013444074, 0.0118... \n", + "Eduardo_Eiras.2 [0.027794681, 0.012595378, 0.015973512, 0.0243... \n", + "Eduardo_Eiras.3 [0.023938581, -0.005019143, -0.0041286526, 0.0... \n", + "Eduardo_Eiras.5 [0.014218462, 0.0028408384, 0.012237807, 0.018... \n", + "Eduardo_Eiras.6 [0.023989934, 0.014054777, 0.004245261, 0.0108... \n", + "Eduardo_Eiras.7 [0.023237122, 0.011033161, 0.016982649, 0.0112... \n", + "Nelson_Alves.1 [0.011202453, -0.011317662, 0.006242816, -0.00... \n", + "Leonardo_Murakami.1 [0.017816652, -0.0014210419, 0.0012131145, 0.0... \n", + "Leonardo_Murakami.2 [0.01864994, 0.0052387556, -0.0028785854, 0.01... \n", + "Enzo_Bustos.1 [0.02399399, 0.0052210162, -0.015569969, 0.012... \n", + "Enzo_Bustos.2 [0.019614054, 0.0023429843, -0.0011203118, 0.0... \n", + "Paulo_Sestini.1 [0.013956297, 0.00030987675, 0.0015853783, 0.0... \n", + "Paulo_Sestini.2 [0.015406041, -0.00386795, -0.0001494264, 0.00... \n", + "Alex_Koji.1 [0.013313855, 0.016293736, -0.0011014326, 0.00... \n", + "\n", + " Facenet \\\n", + "Rodrigo_Fill.1 [-0.7107556, 0.2447348, -1.3264471, 0.20392153... \n", + "Rodrigo_Fill.2 [0.81892776, 1.5169264, -2.3059661, 0.83081686... \n", + "Luisa_Heise.1 [0.15546729, -0.48523352, 1.1752089, -1.828793... \n", + "Luisa_Heise.2 [-1.5654796, -1.0087686, 0.77439445, -0.830853... \n", + "Ariel_Guerreiro.1 [1.8040531, 2.4030004, -1.5023875, 1.736949, 0... \n", + "Ariel_Guerreiro.2 [-0.19725096, 1.6418126, -1.1741674, 0.9594986... \n", + "Guilherme_Goncalves.1 [-0.5617701, 0.15997693, 0.18063924, 0.9567702... \n", + "Guilherme_Goncalves.2 [-0.7463429, -0.24570425, 0.20713773, 1.214165... \n", + "Camila_Fonseca.1 [-1.8097155, -1.8309294, -1.20493, 1.3271358, ... \n", + "Camila_Fonseca.2 [-1.3376508, -1.5952889, 0.25136778, 1.1719253... \n", + "Guilherme_Cola.1 [-0.10863148, 0.12147777, -2.1797159, 2.553167... \n", + "Guilherme_Cola.2 [0.19653642, -0.065777265, -2.1988037, 2.93330... \n", + "Noel_Viscome.1 [-1.7278033, 0.26465106, 0.6038073, 0.36027545... \n", + "Noel_Viscome.2 [-0.5509963, 0.74306023, 0.14488125, -0.936631... \n", + "Victor_Jinsi.1 [0.5734688, 0.86270785, -0.64202434, 1.1462065... \n", + "Eduardo_Eiras.1 [-0.34935245, -0.37163797, -0.39313334, 0.7243... \n", + "Eduardo_Eiras.2 [0.4253676, 0.68349314, 0.5815365, -0.06460958... \n", + "Eduardo_Eiras.3 [-1.293877, -0.1234024, -1.4063007, 1.3587369,... \n", + "Eduardo_Eiras.5 [-1.3807191, 0.006177306, -0.50413, 1.6096864,... \n", + "Eduardo_Eiras.6 [-0.7857877, 0.35950303, -0.56709725, 0.465594... \n", + "Eduardo_Eiras.7 [-0.9716029, -0.26354784, -0.4264811, 1.663771... \n", + "Nelson_Alves.1 [0.2442035, -0.018297125, -1.086241, 1.2000073... \n", + "Leonardo_Murakami.1 [-1.7009012, -0.6807573, 0.14056861, -0.153483... \n", + "Leonardo_Murakami.2 [-1.7920934, -1.4230772, 0.6691602, -0.2342174... \n", + "Enzo_Bustos.1 [-2.1904962, -1.3387287, 0.13840455, 0.6652469... \n", + "Enzo_Bustos.2 [0.29559124, -0.25272578, 0.33746648, 1.579556... \n", + "Paulo_Sestini.1 [-1.698124, -0.39025182, -1.4879581, 1.7800299... \n", + "Paulo_Sestini.2 [-0.886387, 0.30212864, 0.016729653, 2.1621618... \n", + "Alex_Koji.1 [0.06953996, -1.1348931, -1.6284283, 0.6346901... \n", + "\n", + " OpenFace \\\n", + "Rodrigo_Fill.1 [0.09385188, -0.07862704, 0.0021203938, 0.0650... \n", + "Rodrigo_Fill.2 [0.07494784, -0.013211267, -0.101745866, 0.045... \n", + "Luisa_Heise.1 [0.03517189, 0.043330558, -0.080343574, 0.0138... \n", + "Luisa_Heise.2 [0.015118088, 0.01344703, -0.10854726, -0.0123... \n", + "Ariel_Guerreiro.1 [-0.03975611, 0.10978596, 0.016175106, 0.07090... \n", + "Ariel_Guerreiro.2 [0.019117408, 0.18743879, 0.025908452, 0.05127... \n", + "Guilherme_Goncalves.1 [-0.041704994, -0.00016754917, 0.035282012, -0... \n", + "Guilherme_Goncalves.2 [-0.029539527, 0.004947966, 0.0065265903, -0.0... \n", + "Camila_Fonseca.1 [0.051527027, -0.008045665, -0.070917234, 0.00... \n", + "Camila_Fonseca.2 [0.033205245, 0.06364468, -0.036076825, -0.026... \n", + "Guilherme_Cola.1 [0.09351041, 0.023937931, 0.014001634, 0.13893... \n", + "Guilherme_Cola.2 [0.07559654, 0.0140757235, -0.089574635, 0.076... \n", + "Noel_Viscome.1 [0.038704526, 0.07394758, -0.09165, 0.04594578... \n", + "Noel_Viscome.2 [0.051902585, -0.023795338, -0.08508713, -0.03... \n", + "Victor_Jinsi.1 [-0.01967564, 0.0672678, 0.011682327, 0.033551... \n", + "Eduardo_Eiras.1 [-0.005565289, 0.051990893, -0.041520093, -0.0... \n", + "Eduardo_Eiras.2 [-0.0114504425, -0.02118617, -0.09935128, -0.0... \n", + "Eduardo_Eiras.3 [-0.02248524, 0.14344844, 0.04551649, 0.008724... \n", + "Eduardo_Eiras.5 [-0.004796549, 0.002740741, -0.01581459, -0.02... \n", + "Eduardo_Eiras.6 [-0.03314291, -0.03338445, -0.0071588843, -0.0... \n", + "Eduardo_Eiras.7 [-0.06154397, 0.031329878, 0.051613558, -0.094... \n", + "Nelson_Alves.1 [0.0517047, 0.13678262, 0.06404092, 0.07557396... \n", + "Leonardo_Murakami.1 [-0.015473774, -0.0020993, -0.03174869, -0.055... \n", + "Leonardo_Murakami.2 [0.035412, 0.00017503757, -0.043976996, -0.071... \n", + "Enzo_Bustos.1 [0.10071324, -0.036814034, -0.1275556, 0.04338... \n", + "Enzo_Bustos.2 [0.13314737, 0.06992418, -0.15777715, 0.004923... \n", + "Paulo_Sestini.1 [-0.0883103, -0.007851686, 0.0411439, -0.07708... \n", + "Paulo_Sestini.2 [-0.043899756, 0.054894928, 0.010215374, -0.05... \n", + "Alex_Koji.1 [-0.004252907, 0.17901103, 0.0792524, 0.141097... \n", + "\n", + " DeepFace \n", + "Rodrigo_Fill.1 [0.0, 0.0, 0.66140383, 0.0, 0.6555716, 2.81141... \n", + "Rodrigo_Fill.2 [0.0, 0.0, 0.76971376, 1.1680458, 3.7435546, 1... \n", + "Luisa_Heise.1 [0.0, 0.0, 0.0, 0.3481037, 1.2885046, 3.498858... \n", + "Luisa_Heise.2 [0.0, 0.0, 0.0, 0.0, 1.1309611, 4.682887, 2.07... \n", + "Ariel_Guerreiro.1 [0.0, 0.0, 0.0, 0.9227623, 2.601956, 0.0, 0.90... \n", + "Ariel_Guerreiro.2 [0.0, 0.0, 0.0, 0.36150473, 0.0, 2.553075, 2.4... \n", + "Guilherme_Goncalves.1 [0.0, 0.0, 0.0, 0.03970301, 1.1502867, 0.0, 2.... \n", + "Guilherme_Goncalves.2 [0.0, 0.0, 0.0, 0.0, 0.47723967, 0.0, 3.388195... \n", + "Camila_Fonseca.1 [0.0, 0.0, 0.0, 0.30561933, 3.0658455, 2.70023... \n", + "Camila_Fonseca.2 [0.0, 0.0, 0.0, 0.0, 2.3348985, 5.3893414, 2.8... \n", + "Guilherme_Cola.1 [0.0, 0.0, 0.0, 0.0, 0.0, 3.8363554, 0.0, 0.0,... \n", + "Guilherme_Cola.2 [0.0, 0.0, 0.0, 0.0, 0.8358648, 6.13692, 1.777... \n", + "Noel_Viscome.1 [0.0, 0.0, 0.0, 0.064310044, 1.9042714, 2.0811... \n", + "Noel_Viscome.2 [0.0, 0.0, 0.0, 0.0, 3.124282, 2.3894014, 3.08... \n", + "Victor_Jinsi.1 [0.0, 0.0, 0.0, 0.0, 2.0280519, 0.0, 1.4935838... \n", + "Eduardo_Eiras.1 [0.0, 0.0, 0.0, 0.26732165, 1.0506326, 0.35762... \n", + "Eduardo_Eiras.2 [0.0, 0.0, 0.0, 0.0, 3.7076707, 0.6628028, 2.7... \n", + "Eduardo_Eiras.3 [0.0, 0.0, 0.0, 0.0, 2.8374405, 2.356803, 0.70... \n", + "Eduardo_Eiras.5 [0.0, 0.0, 0.0, 0.0, 3.0053782, 0.65704703, 2.... \n", + "Eduardo_Eiras.6 [0.0, 0.0, 0.0, 0.27838233, 0.0, 1.7221168, 1.... \n", + "Eduardo_Eiras.7 [0.0, 0.0, 0.0, 0.334877, 0.69340277, 0.0, 0.0... \n", + "Nelson_Alves.1 [0.0, 0.0, 0.0, 0.0, 1.1573782, 2.4152763, 1.9... \n", + "Leonardo_Murakami.1 [0.0, 0.0, 0.0, 0.62446773, 0.0, 0.0, 1.890828... \n", + "Leonardo_Murakami.2 [0.0, 0.0, 0.0, 0.6731644, 0.0, 0.0, 0.6979854... \n", + "Enzo_Bustos.1 [0.0, 0.0, 0.0, 0.0, 4.0648704, 8.178255, 1.45... \n", + "Enzo_Bustos.2 [0.0, 0.0, 0.0, 0.0, 2.9943137, 5.8091803, 3.4... \n", + "Paulo_Sestini.1 [0.0, 0.0, 0.0, 0.0, 1.3161561, 0.009125233, 1... \n", + "Paulo_Sestini.2 [0.0, 0.0, 0.0, 0.0, 1.3580369, 0.0, 2.9301717... \n", + "Alex_Koji.1 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.8053236, 0.0,... " + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "df" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Avaliando cada pessoa em relação à todas as outras: 100%|██████████| 29/29 [00:00<00:00, 99.78it/s]\n" + ] + } + ], + "source": [ + "metrics_df = DeepFace.metrics_dataframe(df, one_compair = False)" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Cosine with VGG-FaceEuclidean with VGG-FaceL2 with VGG-FaceCosine with FacenetEuclidean with FacenetL2 with FacenetCosine with OpenFaceEuclidean with OpenFaceL2 with OpenFaceCosine with DeepFaceEuclidean with DeepFaceL2 with DeepFace
Rodrigo_Fill.1-Rodrigo_Fill.15.96046e-08000005.96046e-0800-1.19209e-0700
Rodrigo_Fill.1-Rodrigo_Fill.20.3386850.3087370.8230250.33599510.18570.819750.1656490.5755850.5755850.20513157.15850.640517
Rodrigo_Fill.1-Luisa_Heise.10.6571160.7182661.14640.77105515.28041.241820.3668570.8565710.8565710.40087668.93610.895406
Rodrigo_Fill.1-Luisa_Heise.20.6058890.5861271.100810.77883514.88381.248070.6131981.107431.107430.45776773.55290.956835
Rodrigo_Fill.1-Ariel_Guerreiro.10.5946890.7254281.090591.0110817.60721.422030.6550141.144561.144560.34483660.50030.830464
.......................................
Alex_Koji.1-Enzo_Bustos.10.5508180.765771.049590.87538116.09161.323160.5792971.076381.076380.50234386.65021.00234
Alex_Koji.1-Enzo_Bustos.20.5102560.7480471.01020.69407214.85611.17820.5255711.025251.025250.42599986.59410.923037
Alex_Koji.1-Paulo_Sestini.10.5090080.6795951.008970.70190414.37091.184820.6380411.129641.129640.41509469.99260.911146
Alex_Koji.1-Paulo_Sestini.20.4627760.7386740.9620560.63163413.72571.123950.4979720.997970.997970.31299963.0950.7912
Alex_Koji.1-Alex_Koji.1000-1.19209e-0700-1.19209e-07005.96046e-0800
\n", + "

841 rows × 12 columns

\n", + "
" + ], + "text/plain": [ + " Cosine with VGG-Face Euclidean with VGG-Face \\\n", + "Rodrigo_Fill.1-Rodrigo_Fill.1 5.96046e-08 0 \n", + "Rodrigo_Fill.1-Rodrigo_Fill.2 0.338685 0.308737 \n", + "Rodrigo_Fill.1-Luisa_Heise.1 0.657116 0.718266 \n", + "Rodrigo_Fill.1-Luisa_Heise.2 0.605889 0.586127 \n", + "Rodrigo_Fill.1-Ariel_Guerreiro.1 0.594689 0.725428 \n", + "... ... ... \n", + "Alex_Koji.1-Enzo_Bustos.1 0.550818 0.76577 \n", + "Alex_Koji.1-Enzo_Bustos.2 0.510256 0.748047 \n", + "Alex_Koji.1-Paulo_Sestini.1 0.509008 0.679595 \n", + "Alex_Koji.1-Paulo_Sestini.2 0.462776 0.738674 \n", + "Alex_Koji.1-Alex_Koji.1 0 0 \n", + "\n", + " L2 with VGG-Face Cosine with Facenet \\\n", + "Rodrigo_Fill.1-Rodrigo_Fill.1 0 0 \n", + "Rodrigo_Fill.1-Rodrigo_Fill.2 0.823025 0.335995 \n", + "Rodrigo_Fill.1-Luisa_Heise.1 1.1464 0.771055 \n", + "Rodrigo_Fill.1-Luisa_Heise.2 1.10081 0.778835 \n", + "Rodrigo_Fill.1-Ariel_Guerreiro.1 1.09059 1.01108 \n", + "... ... ... \n", + "Alex_Koji.1-Enzo_Bustos.1 1.04959 0.875381 \n", + "Alex_Koji.1-Enzo_Bustos.2 1.0102 0.694072 \n", + "Alex_Koji.1-Paulo_Sestini.1 1.00897 0.701904 \n", + "Alex_Koji.1-Paulo_Sestini.2 0.962056 0.631634 \n", + "Alex_Koji.1-Alex_Koji.1 0 -1.19209e-07 \n", + "\n", + " Euclidean with Facenet L2 with Facenet \\\n", + "Rodrigo_Fill.1-Rodrigo_Fill.1 0 0 \n", + "Rodrigo_Fill.1-Rodrigo_Fill.2 10.1857 0.81975 \n", + "Rodrigo_Fill.1-Luisa_Heise.1 15.2804 1.24182 \n", + "Rodrigo_Fill.1-Luisa_Heise.2 14.8838 1.24807 \n", + "Rodrigo_Fill.1-Ariel_Guerreiro.1 17.6072 1.42203 \n", + "... ... ... \n", + "Alex_Koji.1-Enzo_Bustos.1 16.0916 1.32316 \n", + "Alex_Koji.1-Enzo_Bustos.2 14.8561 1.1782 \n", + "Alex_Koji.1-Paulo_Sestini.1 14.3709 1.18482 \n", + "Alex_Koji.1-Paulo_Sestini.2 13.7257 1.12395 \n", + "Alex_Koji.1-Alex_Koji.1 0 0 \n", + "\n", + " Cosine with OpenFace Euclidean with OpenFace \\\n", + "Rodrigo_Fill.1-Rodrigo_Fill.1 5.96046e-08 0 \n", + "Rodrigo_Fill.1-Rodrigo_Fill.2 0.165649 0.575585 \n", + "Rodrigo_Fill.1-Luisa_Heise.1 0.366857 0.856571 \n", + "Rodrigo_Fill.1-Luisa_Heise.2 0.613198 1.10743 \n", + "Rodrigo_Fill.1-Ariel_Guerreiro.1 0.655014 1.14456 \n", + "... ... ... \n", + "Alex_Koji.1-Enzo_Bustos.1 0.579297 1.07638 \n", + "Alex_Koji.1-Enzo_Bustos.2 0.525571 1.02525 \n", + "Alex_Koji.1-Paulo_Sestini.1 0.638041 1.12964 \n", + "Alex_Koji.1-Paulo_Sestini.2 0.497972 0.99797 \n", + "Alex_Koji.1-Alex_Koji.1 -1.19209e-07 0 \n", + "\n", + " L2 with OpenFace Cosine with DeepFace \\\n", + "Rodrigo_Fill.1-Rodrigo_Fill.1 0 -1.19209e-07 \n", + "Rodrigo_Fill.1-Rodrigo_Fill.2 0.575585 0.205131 \n", + "Rodrigo_Fill.1-Luisa_Heise.1 0.856571 0.400876 \n", + "Rodrigo_Fill.1-Luisa_Heise.2 1.10743 0.457767 \n", + "Rodrigo_Fill.1-Ariel_Guerreiro.1 1.14456 0.344836 \n", + "... ... ... \n", + "Alex_Koji.1-Enzo_Bustos.1 1.07638 0.502343 \n", + "Alex_Koji.1-Enzo_Bustos.2 1.02525 0.425999 \n", + "Alex_Koji.1-Paulo_Sestini.1 1.12964 0.415094 \n", + "Alex_Koji.1-Paulo_Sestini.2 0.99797 0.312999 \n", + "Alex_Koji.1-Alex_Koji.1 0 5.96046e-08 \n", + "\n", + " Euclidean with DeepFace L2 with DeepFace \n", + "Rodrigo_Fill.1-Rodrigo_Fill.1 0 0 \n", + "Rodrigo_Fill.1-Rodrigo_Fill.2 57.1585 0.640517 \n", + "Rodrigo_Fill.1-Luisa_Heise.1 68.9361 0.895406 \n", + "Rodrigo_Fill.1-Luisa_Heise.2 73.5529 0.956835 \n", + "Rodrigo_Fill.1-Ariel_Guerreiro.1 60.5003 0.830464 \n", + "... ... ... \n", + "Alex_Koji.1-Enzo_Bustos.1 86.6502 1.00234 \n", + "Alex_Koji.1-Enzo_Bustos.2 86.5941 0.923037 \n", + "Alex_Koji.1-Paulo_Sestini.1 69.9926 0.911146 \n", + "Alex_Koji.1-Paulo_Sestini.2 63.095 0.7912 \n", + "Alex_Koji.1-Alex_Koji.1 0 0 \n", + "\n", + "[841 rows x 12 columns]" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "metrics_df" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Realizando o ensemble para cada par de indivíduos!: 100%|██████████| 841/841 [00:00<00:00, 2306.28it/s]\n" + ] + } + ], + "source": [ + "verif_df = DeepFace.ensemble_dataframe(metrics_df)" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
VerifiedRealityScore
Rodrigo_Fill.1-Rodrigo_Fill.1truetrue0.996973
Rodrigo_Fill.1-Rodrigo_Fill.2truetrue0.996922
Rodrigo_Fill.1-Luisa_Heise.1falsefalse0.998384
Rodrigo_Fill.1-Luisa_Heise.2falsefalse0.998695
Rodrigo_Fill.1-Ariel_Guerreiro.1falsefalse0.998559
............
Alex_Koji.1-Enzo_Bustos.1falsefalse0.998646
Alex_Koji.1-Enzo_Bustos.2falsefalse0.998646
Alex_Koji.1-Paulo_Sestini.1falsefalse0.998697
Alex_Koji.1-Paulo_Sestini.2falsefalse0.998527
Alex_Koji.1-Alex_Koji.1truetrue0.996973
\n", + "

841 rows × 3 columns

\n", + "
" + ], + "text/plain": [ + " Verified Reality Score\n", + "Rodrigo_Fill.1-Rodrigo_Fill.1 true true 0.996973\n", + "Rodrigo_Fill.1-Rodrigo_Fill.2 true true 0.996922\n", + "Rodrigo_Fill.1-Luisa_Heise.1 false false 0.998384\n", + "Rodrigo_Fill.1-Luisa_Heise.2 false false 0.998695\n", + "Rodrigo_Fill.1-Ariel_Guerreiro.1 false false 0.998559\n", + "... ... ... ...\n", + "Alex_Koji.1-Enzo_Bustos.1 false false 0.998646\n", + "Alex_Koji.1-Enzo_Bustos.2 false false 0.998646\n", + "Alex_Koji.1-Paulo_Sestini.1 false false 0.998697\n", + "Alex_Koji.1-Paulo_Sestini.2 false false 0.998527\n", + "Alex_Koji.1-Alex_Koji.1 true true 0.996973\n", + "\n", + "[841 rows x 3 columns]" + ] + }, + "execution_count": 9, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "verif_df" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
AccuracyRecallPrecisionF1
Results:0.9785971.00.8144330.897727
\n", + "
" + ], + "text/plain": [ + " Accuracy Recall Precision F1\n", + "Results: 0.978597 1.0 0.814433 0.897727" + ] + }, + "execution_count": 10, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "f1_df = DeepFace.f1_calculation(verif_df)\n", + "f1_df" + ] } ], "metadata": { @@ -2348,7 +3402,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.8" + "version": "3.7.6" } }, "nbformat": 4, diff --git "a/Apresentacao_do_projeto/Apresenta\303\247\303\243o_Landmarks.ipynb" "b/Apresentacao_do_projeto/Apresenta\303\247\303\243o_Landmarks.ipynb" index f47e578..139c462 100755 --- "a/Apresentacao_do_projeto/Apresenta\303\247\303\243o_Landmarks.ipynb" +++ "b/Apresentacao_do_projeto/Apresenta\303\247\303\243o_Landmarks.ipynb" @@ -1639,11 +1639,7 @@ "metadata": {}, "outputs": [], "source": [ - "\n", - "\n", - "Sabendo então que Gui e Sib foram responsáveis por apresentar o grupo ao Big Boss, e sabendo que os resultados obtidos foram satisfatórios, em um intervado de tempo menor que a PUC. Assim é visível que ambos receberão bonus de desempenho, dependendo da ordem de redução dos custos é possível que eles possam pagar poke para o grupo por pelo menos um ano, todos os dias. Assim o próximo projeto é encontrar uma forma eficiente de cobrar nossos caros amigos :).\n", - "\n", - "aimport pickle\n", + "import pickle\n", "#save the model to disk\n", "filename = 'gradient_boosting_faces_clf.sav'\n", "pickle.dump(clf, open(filename, 'wb'))"