correct pickle loading
This commit is contained in:
@@ -282,9 +282,18 @@ class Human36mDataset(MocapDataset):
|
|||||||
cam['intrinsic'] = np.concatenate((cam['focal_length'], cam['center'],
|
cam['intrinsic'] = np.concatenate((cam['focal_length'], cam['center'],
|
||||||
cam['radial_distortion'], cam['tangential_distortion']))
|
cam['radial_distortion'], cam['tangential_distortion']))
|
||||||
|
|
||||||
|
# save np.load
|
||||||
|
np_load_old = np.load
|
||||||
|
|
||||||
|
# modify the default parameters of np.load
|
||||||
|
np.load = lambda *a,**k: np_load_old(*a, allow_pickle=True, **k)
|
||||||
|
|
||||||
# Load serialized dataset
|
# Load serialized dataset
|
||||||
data = np.load(path)['positions_3d'].item()
|
data = np.load(path)['positions_3d'].item()
|
||||||
|
|
||||||
|
# restore np.load for future normal usage
|
||||||
|
np.load = np_load_old
|
||||||
|
|
||||||
self._data = {}
|
self._data = {}
|
||||||
for subject, actions in data.items():
|
for subject, actions in data.items():
|
||||||
self._data[subject] = {}
|
self._data[subject] = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user