Skip to content

Commit

Permalink
Added overwrite protection
Browse files Browse the repository at this point in the history
  • Loading branch information
Purg committed Oct 17, 2024
1 parent db3425f commit e7378c6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tcn_hpl/data/utils/pose_generation/generate_pose_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,15 @@ def main(
--pose-config python-tpl/TCN_HPL/tcn_hpl/data/utils/pose_generation/configs/ViTPose_base_medic_casualty_256x192.py \\
--pose-weights ./model_files/pose_estimation/pose_model.pth
"""
input_dset = kwcoco.CocoDataset(input_coco_filepath)
# Prevent overwriting an existing file. These are expensive to compute so
# we don't want to mess that up.
if output_coco_filepath.is_file():
raise ValueError(
f"Output COCO file already exists, refusing to overwrite: "
f"{output_coco_filepath}"
)

input_dset = kwcoco.CocoDataset(input_coco_filepath)

img_done_cb = None
if checkpoint_interval is not None:
Expand Down

0 comments on commit e7378c6

Please sign in to comment.