Skip to content

Commit

Permalink
Adding chunksize != 1 for large datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
ancestor-mithril committed Aug 6, 2024
1 parent b6f0b7b commit 5623b80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dice_score_3d/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ def execute_evaluate_predictions(gt_files: List[str], pred_files: List[str], reo
ret = [evaluate_prediction(gt, pred, reorient, dtype, indices) for gt, pred in tqdm(
list(zip(gt_files, pred_files)))]
else:
chunksize = len(gt_files) // num_workers // 4 # arbitrarily chosen
if chunksize < 4:
chunksize = 1
ret = process_map(evaluate_prediction_wrapper,
[(gt, pred, reorient, dtype, indices) for gt, pred in zip(gt_files, pred_files)],
max_workers=num_workers)
max_workers=num_workers, chunksize=chunksize)
return ret


Expand Down

0 comments on commit 5623b80

Please sign in to comment.