Skip to content

Commit

Permalink
updated cache field tutorial to reflect name change
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Sela committed Jan 15, 2025
1 parent a505e87 commit 8a52fdf
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 62 deletions.

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions docs/source/recipes/torch-dataset-examples/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def get_item_cached_quickstart(sample_dict):
image = Image.open(sample_dict["filepath"])
og_wh = np.array([image.width, image.height])
image = tv_tensors.Image(image)
detections = sample_dict["ground_truth.detections.bounding_box"]
detections = sample_dict["detections.detections.bounding_box"]
if detections is None:
detections = []
detections_tensor = (
torch.tensor(detections)
if len(detections) > 0
Expand All @@ -54,7 +56,7 @@ def get_item_cached_quickstart(sample_dict):
format=tv_tensors.BoundingBoxFormat("XYWH"),
canvas_size=image.shape[-2:],
)
res["label"] = sample_dict["ground_truth.detections.label"]
res["label"] = sample_dict["detections.detections.label"]
res["id"] = sample_dict["id"]
image, res = augmentations_quickstart(image, res)
return image, res
Expand Down

0 comments on commit 8a52fdf

Please sign in to comment.