Demo entry 3842838

python_code

   

Submitted by antoine on Mar 02, 2016 at 16:22
Language: Python. Code size: 966 Bytes.

"""
Scripts to eval a model on LFW (Labeled Faces in the Wild).
"""
from __future__ import division
import os
import argparse
import importlib
import imp
import numpy as np
from collections import defaultdict
import bokeh.plotting as bk_plot
from bokeh.palettes import Spectral10
from bokeh.embed import components
from sklearn.metrics import roc_curve, roc_auc_score
import jinja2

from datasets import lfw
from tensorflow_exp.triplet_loss.two_movies_test import compute_features

TEMPLATE_FILE = './templates/lfw.html'

def maybe_compute_features(files, net, features_file, read_image):
    """Computes LFW features if they do not exist yet."""
    if os.path.isfile(features_file):
        print('Loading features')
        return np.load(features_file)
    else:
        print('Computing features')
        features = compute_features(files, net, read_image=read_image)
        np.save(features_file, features)
    return features

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).