Skip to content

Commit

Permalink
Address self comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasHug committed Aug 24, 2023
1 parent f404f6c commit f9b90b2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gallery/v2_transforms/plot_transforms_v2_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
print(f"{type(img) = }\n{type(target) = }\n{target.keys() = }")
print(f"{type(target['boxes']) = }\n{type(target['labels']) = }\n{type(target['masks']) = }")

# %%
# We used the ``target_keys`` parameter to specify the kind of output we're
# interested in. Our dataset now returns a target which is dict where the values
# are :ref:`Datapoints <what_are_datapoints>` (all are :class:`torch.Tensor`
Expand Down Expand Up @@ -151,7 +152,7 @@
batch_size=2,
# We need a custom collation function here, since the object detection
# models expect a sequence of images and target dictionaries. The default
# collation function tries to :func:`~torch.stack` the individual elements,
# collation function tries to torch.stack() the individual elements,
# which fails in general for object detection, because the number of bouding
# boxes varies between the images of a same batch.
collate_fn=lambda batch: tuple(zip(*batch)),
Expand Down

0 comments on commit f9b90b2

Please sign in to comment.