diff --git a/bob/paper/nir_patch_pooling/database/mlfp.py b/bob/paper/nir_patch_pooling/database/mlfp.py index 3b6473a5885c72b7150651a678492ca346c8bb89..9046e2c64b7e5bbe1efda90cbcfd00461665cd4b 100644 --- a/bob/paper/nir_patch_pooling/database/mlfp.py +++ b/bob/paper/nir_patch_pooling/database/mlfp.py @@ -39,8 +39,10 @@ class File(VideoPadFile): hdf_file = h5py.File(path) fc = FrameContainer() - - for idx, frame_data in enumerate(hdf_file.keys()): + frame_keys = list(hdf_file.keys()) + frame_keys.remove("FrameIndexes") + + for idx, frame_data in enumerate(frame_keys): frame = hdf_file[frame_data]["array"].value fc.add(idx, frame, None) diff --git a/bob/paper/nir_patch_pooling/script/convert_mlfp_database.py b/bob/paper/nir_patch_pooling/script/convert_mlfp_database.py index ef4ba4171ac34577b8979d826aa809c152d2d102..1148ac4816d7ba72d6abb48b57b4dbed88a66291 100755 --- a/bob/paper/nir_patch_pooling/script/convert_mlfp_database.py +++ b/bob/paper/nir_patch_pooling/script/convert_mlfp_database.py @@ -10,6 +10,12 @@ import os, sys from bob.bio.video import FrameContainer from bob.io.base import create_directories_safe, HDF5File import numpy as np +from bob.pad.face.preprocessor.FaceCropAlign import detect_face_landmarks_in_image +import json + +import logging +logger = logging.getLogger(__name__) +logger.setLevel(logging.INFO) frames_per_video = 20 @@ -51,7 +57,7 @@ class MLFPConvertor: #------------------------------------------------------------------------------ - def normalize_image(self, image, n_sigma=3.0): # or 4.0 + def normalize_image(self, image, n_sigma=4.0): # 3.0 or 4.0 assert(len(image.shape)==2) @@ -115,7 +121,6 @@ class MLFPConvertor: # if image is grayscale, convert to 3 channel for face detection if len(image.shape) == 2: - print (image.shape) image = np.repeat(image[:, :, np.newaxis], 3, axis=2) image = np.transpose(image, (2,0,1))