in videoalignment/datasets.py [0:0]
def get_video_feature_entire(self, v):
if self.features_string.endswith(".pkl"):
if not self.features:
self.features = pkl.load(
open(self.features_string % self.args.resnet_level, "rb")
)
if v["video"].endswith("longvid"):
ts = self.features["frames/" + v["video"] + ".avi"].astype(np.float32)
else:
ts = self.features["frames/" + v["video"]].astype(np.float32)
else:
if v["video"] == "albert_ixus70/longvid":
vv = "albert_ixus70/longvid.avi"
else:
vv = v["video"]
fname = self.features_string % self.args.resnet_level + vv + ".pkl"
# incompatibility of pickled numpy array,
# see https://stackoverflow.com/questions/11305790/pickle-incompatibility-of-numpy-arrays-between-python-2-and-3
# TODO (lowik): Re-serialize all files with pickle from Python3
ts = pkl.load(open(fname, "rb"), encoding="latin1").astype(np.float32)
return ts