add delete_episode, WIP on consolidate

This commit is contained in:
Simon Alibert
2024-10-21 20:10:13 +02:00
parent 299451af81
commit c4c0a43de7
2 changed files with 23 additions and 3 deletions

View File

@@ -107,6 +107,12 @@ class ImageWriter:
)
return str(self.dir / fpath) if return_str else self.dir / fpath
def get_episode_dir(self, episode_index: int, image_key: str, return_str: bool = True) -> str | Path:
dir_path = self.get_image_file_path(
episode_index=episode_index, image_key=image_key, frame_index=0, return_str=False
).parent
return str(dir_path) if return_str else dir_path
def stop(self, timeout=20) -> None:
"""Stop the image writer, waiting for all processes or threads to finish."""
if self.type == "threads":