This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function save_extracted_features() | |
clear;clc;close all; | |
cd('../') | |
%% caffe settings | |
matCaffe = fullfile(pwd, '../tools/caffe-sphereface/matlab'); | |
addpath(genpath(matCaffe)); | |
gpu = 1; | |
if gpu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
import time | |
def euclidean_distance_square(x1, x2): | |
return np.einsum('ij,ij->i', x1, x1)[:, np.newaxis] + np.einsum('ij,ij->i', x2, x2) - 2*np.dot(x1, x2.T) | |
def evaluate_identification_with_modified_megaface_protocol(authorized_features_dir, unauthorized_features_dir): | |
print("Reading authorized features") | |
authorized_hashids = [] |