Skip to content
Snippets Groups Projects
Commit cb61d1fc authored by Ketan Kotwal's avatar Ketan Kotwal
Browse files

remove frameindexes while loading

parent 35611207
Branches
Tags
No related merge requests found
...@@ -39,8 +39,10 @@ class File(VideoPadFile): ...@@ -39,8 +39,10 @@ class File(VideoPadFile):
hdf_file = h5py.File(path) hdf_file = h5py.File(path)
fc = FrameContainer() fc = FrameContainer()
frame_keys = list(hdf_file.keys())
for idx, frame_data in enumerate(hdf_file.keys()): frame_keys.remove("FrameIndexes")
for idx, frame_data in enumerate(frame_keys):
frame = hdf_file[frame_data]["array"].value frame = hdf_file[frame_data]["array"].value
fc.add(idx, frame, None) fc.add(idx, frame, None)
......
...@@ -10,6 +10,12 @@ import os, sys ...@@ -10,6 +10,12 @@ import os, sys
from bob.bio.video import FrameContainer from bob.bio.video import FrameContainer
from bob.io.base import create_directories_safe, HDF5File from bob.io.base import create_directories_safe, HDF5File
import numpy as np 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 frames_per_video = 20
...@@ -51,7 +57,7 @@ class MLFPConvertor: ...@@ -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) assert(len(image.shape)==2)
...@@ -115,7 +121,6 @@ class MLFPConvertor: ...@@ -115,7 +121,6 @@ class MLFPConvertor:
# if image is grayscale, convert to 3 channel for face detection # if image is grayscale, convert to 3 channel for face detection
if len(image.shape) == 2: if len(image.shape) == 2:
print (image.shape)
image = np.repeat(image[:, :, np.newaxis], 3, axis=2) image = np.repeat(image[:, :, np.newaxis], 3, axis=2)
image = np.transpose(image, (2,0,1)) image = np.transpose(image, (2,0,1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment