Skip to content

Commit

Permalink
add crop size info to posetrack_data files to remove duplicates
Browse files Browse the repository at this point in the history
Signed-off-by: Martin <[email protected]>
  • Loading branch information
bmmtstb committed Jun 28, 2024
1 parent d320d04 commit 0218e03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/helpers/extract_bboxes_pt21.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ def predict_and_save_rcnn(config: Config, dl_key: str, subm_key: str, rcnn_cfg_s
gt_imgs = read_json(gt_data_path)["images"]
gt_img_id_map = [img["image_id"] for img in gt_imgs] # zero-indexed!

# create img output folder
crop_h, crop_w = config[dl_key]["crop_size"]
crops_folder = f"./data/PoseTrack21/crops/{crop_h}x{crop_w}/{rcnn_cfg_str}/{ds_name}/"
mkdir_if_missing(crops_folder)

# modify the configuration
config[dl_key]["data_path"] = dataset_path
config[subm_key]["file"] = f"./data/PoseTrack21/posetrack_data/{rcnn_cfg_str}/{ds_name}.json"
config[dl_key]["mask_path"] = gt_data_path
config[subm_key]["file"] = f"./data/PoseTrack21/posetrack_data/{crop_h}x{crop_w}_{rcnn_cfg_str}/{ds_name}.json"

if os.path.exists(config[subm_key]["file"]):
continue

dl_module = module_loader(config=config, module_class="dataloader", key=dl_key)
subm_module: PoseTrack21Submission = module_loader(config=config, module_class="submission", key=subm_key)

# create img output folder
crop_h, crop_w = config[dl_key]["crop_size"]
crops_folder = f"./data/PoseTrack21/crops/{crop_h}x{crop_w}/{rcnn_cfg_str}/{ds_name}/"
mkdir_if_missing(crops_folder)

batch: list[State]
for batch in tqdm(dl_module, desc="batch", leave=False):
for s in batch:
Expand Down

0 comments on commit 0218e03

Please sign in to comment.