Skip to content
Snippets Groups Projects
Commit 04dad265 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Removed the zeros

parent a83aed39
No related branches found
No related tags found
1 merge request!30Hdf5 loading
Pipeline #
......@@ -2,7 +2,6 @@ import tensorflow as tf
import numpy
import os
import bob.io.base
import bob.io.image
DEFAULT_FEATURE = {'data': tf.FixedLenFeature([], tf.string),
'label': tf.FixedLenFeature([], tf.int64),
......@@ -10,13 +9,13 @@ DEFAULT_FEATURE = {'data': tf.FixedLenFeature([], tf.string),
def from_hdf5file_to_tensor(filename):
import bob.io.image
data = bob.io.image.to_matplotlib(bob.io.base.load(filename))
#reshaping to ndim == 3
#reshaping to ndim == 3
if data.ndim == 2:
data = numpy.reshape(data, (data.shape[0], data.shape[1], 1))
data = data.astype("float32")
data = numpy.zeros((160, 160, 1), dtype="float32")
return data
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment