Hello, I'm trying the model on the WC14 dataset, the inference.ipynb works after some changes on my laptop but the pixel2world_homography_example.ipynb does not.
I'm stuck on this cell:
# load annotations from file
file_points_raw = (
Path(hparams["dataset"]["extremities_annotations"])
/ f'{hparams["dataset"]["extremities_prefix"]}{image_id}.json'
)
if not file_points_raw.exists():
raise FileNotFoundError(file_points_raw)
with open(file_points_raw) as fr:
keypoints_raw = json.load(fr)
pixel_stacked = {}
for label, points in keypoints_raw.items():
points_sel = points
if len(points_sel) > 0:
xx = torch.tensor([a["x"] for a in points_sel])
yy = torch.tensor([a["y"] for a in points_sel])
pixel_stacked[label] = torch.stack([xx, yy], dim=-1) # (?, 2)
# scale pixel annotations from [0, 1] range to source image resolution
# as this ranges from [1, {image_height, image_width}] shift pixel one left
pixel_stacked[label][:, 0] = pixel_stacked[label][:, 0] * (1280 - 1)
pixel_stacked[label][:, 1] = pixel_stacked[label][:, 1] * (720 - 1)
pixels = torch.cat([x for x in pixel_stacked.values()])
print(pixels.shape, pixels.dtype)
torchvision.transforms.functional.to_pil_image(torchvision.utils.draw_keypoints((image * 255.).to(torch.uint8), pixels.unsqueeze(0), colors="blue", radius=5)).resize((320, 180))
I tried to see across all the scripts or the notebooks but still didn't come up with a way to produce the extremities json files, are they to be downloaded?
Thanks in advance for the help and kudos for you great work!
Hello, I'm trying the model on the WC14 dataset, the inference.ipynb works after some changes on my laptop but the pixel2world_homography_example.ipynb does not.
I'm stuck on this cell:
The error it returns is:
I tried to see across all the scripts or the notebooks but still didn't come up with a way to produce the extremities json files, are they to be downloaded?
Thanks in advance for the help and kudos for you great work!