Skip to content

Commit

Permalink
force zip64 for tracker_state
Browse files Browse the repository at this point in the history
If not, the saving of larger videos fails
  • Loading branch information
bstandaert authored and victorjoos committed Jun 28, 2024
1 parent fa024ac commit ccd6a0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tracklab/datastruct/tracker_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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
]
Expand Down

0 comments on commit ccd6a0f

Please sign in to comment.