Skip to content

Instantly share code, notes, and snippets.

View yxchng's full-sized avatar

yxchng

View GitHub Profile
@yxchng
yxchng / save_extracted_features.m
Created June 8, 2018 02:31
save_extracted_features
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
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 = []