Skip to content

Commit

Permalink
test: fix gen_ground_truth
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisVincent committed Jul 15, 2023
1 parent e59fc51 commit 5ad8cb3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/papers/gen_ground_truth.py
Expand Up @@ -22,13 +22,18 @@
mask_keys = [key for key in stim.keys() if key.endswith("mask")]
if "target_mask" in mask_keys:
mask = stim["target_mask"]
else:
elif mask_keys:
mask = stim[mask_keys[0]]
else:
mask = None

stim.clear()
stim["img"] = img
stim["mask"] = mask
export.arrays_to_checksum(stim, ["img", "mask"])
keys = ["img"]
if mask is not None:
stim["mask"] = mask
keys += ["mask"]
export.arrays_to_checksum(stim, keys)

# Save all as .JSON
export.to_json(stims, f"{d}/{paper}.json")

0 comments on commit 5ad8cb3

Please sign in to comment.