Skip to content

Commit

Permalink
add CUDA support for draw_segmentation_masks
Browse files Browse the repository at this point in the history
  • Loading branch information
mshr-h committed Jun 20, 2023
1 parent b9a1984 commit 926cbc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torchvision/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def draw_segmentation_masks(
return image

out_dtype = torch.uint8
colors = [torch.tensor(color, dtype=out_dtype) for color in _parse_colors(colors, num_objects=num_masks)]
colors = [torch.tensor(color, dtype=out_dtype, device=image.device) for color in _parse_colors(colors, num_objects=num_masks)]

img_to_draw = image.detach().clone()
# TODO: There might be a way to vectorize this
Expand Down

0 comments on commit 926cbc3

Please sign in to comment.