Commit 7de67590 authored by Pavel KORSHUNOV's avatar Pavel KORSHUNOV

Merge branch 'master' of gitlab.idiap.ch:bob/bob.pad.voice

parents 9f90dce2 db5aedf8
Pipeline #7285 failed with stages
in 12 minutes and 46 seconds
......@@ -32,7 +32,7 @@ class TensorflowAlgo(Algorithm):
)
self.data_reader = DiskAudio([0], [0])
# self.session = tf.Session()
self.session = tf.Session()
self.dnn_model = None
# def __del__(self):
......@@ -47,8 +47,8 @@ class TensorflowAlgo(Algorithm):
def load_projector(self, projector_file):
logger.info("Loading pretrained model from {0}".format(projector_file))
self.dnn_model = SequenceNetwork()
# self.dnn_model.load(bob.io.base.HDF5File(projector_file), session=self.session)
self.dnn_model.load(projector_file, True)
self.dnn_model.load_hdf5(bob.io.base.HDF5File(projector_file), shape=[1, 6560, 1])
# self.dnn_model.load(projector_file, True)
def project_feature(self, feature):
......@@ -58,8 +58,8 @@ class TensorflowAlgo(Algorithm):
logger.debug(" .... And %d frames are extracted to pass into DNN model" % frames.shape[0])
frames = numpy.reshape(frames, (frames.shape[0], -1, 1))
forward_output = self.dnn_model(frames)
# return tf.nn.log_softmax(tf.nn.log_softmax(forward_output)).eval(session=self.session)
return forward_output
return tf.nn.log_softmax(tf.nn.log_softmax(forward_output)).eval(session=self.session)
# return forward_output
def project(self, feature):
"""project(feature) -> projected
......
......@@ -78,5 +78,6 @@ class ASVspoof2017PadDatabase(PadDatabase):
Returns: A set of Files with the specified properties.
"""
purposes = self.convert_purposes(purposes, ('genuine', 'spoof'), ('real', 'attack'))
objects = self.__db.objects(protocol=protocol, groups=groups, purposes=purposes, **kwargs)
return [ASVspoof2017PadFile(f) for f in objects]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment