From ccd6a0f81244fd33d131d1a519eeba28c410c73a Mon Sep 17 00:00:00 2001 From: bstandaert Date: Wed, 26 Jun 2024 09:50:05 +0200 Subject: [PATCH] force zip64 for tracker_state If not, the saving of larger videos fails --- tracklab/datastruct/tracker_state.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tracklab/datastruct/tracker_state.py b/tracklab/datastruct/tracker_state.py index 7f979453..ff31ccca 100644 --- a/tracklab/datastruct/tracker_state.py +++ b/tracklab/datastruct/tracker_state.py @@ -263,7 +263,7 @@ def save(self): ), "The detections_pred should not be empty when saving" if f"{self.video_id}.pkl" not in self.zf["save"].namelist(): if "summary.json" not in self.zf["save"].namelist(): - with self.zf["save"].open("summary.json", "w") as fp: + with self.zf["save"].open("summary.json", "w", force_zip64=True) as fp: summary = {"columns": { "detection": list(self.detections_pred.columns), "image": list(self.image_pred.columns), @@ -273,13 +273,13 @@ def save(self): 'utf-8') fp.write(summary_bytes) if not self.detections_pred.empty: - with self.zf["save"].open(f"{self.video_id}.pkl", "w") as fp: + with self.zf["save"].open(f"{self.video_id}.pkl", "w", force_zip64=True) as fp: detections_pred = self.detections_pred[ self.detections_pred.video_id == self.video_id ] pickle.dump(detections_pred, fp, protocol=pickle.DEFAULT_PROTOCOL) if not self.image_pred.empty: - with self.zf["save"].open(f"{self.video_id}_image.pkl", "w") as fp: + with self.zf["save"].open(f"{self.video_id}_image.pkl", "w", force_zip64=True) as fp: image_pred = self.image_pred[ self.image_pred.video_id == self.video_id ]