@@ -42,6 +42,7 @@ def make_grid(
42
42
Returns:
43
43
grid (Tensor): the tensor containing grid of images.
44
44
"""
45
+ _log_api_usage_once ("utils" , "make_grid" )
45
46
if not (torch .is_tensor (tensor ) or (isinstance (tensor , list ) and all (torch .is_tensor (t ) for t in tensor ))):
46
47
raise TypeError (f"tensor or list of tensors expected, got { type (tensor )} " )
47
48
@@ -130,6 +131,7 @@ def save_image(
130
131
**kwargs: Other arguments are documented in ``make_grid``.
131
132
"""
132
133
134
+ _log_api_usage_once ("utils" , "save_image" )
133
135
grid = make_grid (tensor , ** kwargs )
134
136
# Add 0.5 after unnormalizing to [0, 255] to round to nearest integer
135
137
ndarr = grid .mul (255 ).add_ (0.5 ).clamp_ (0 , 255 ).permute (1 , 2 , 0 ).to ("cpu" , torch .uint8 ).numpy ()
@@ -174,6 +176,7 @@ def draw_bounding_boxes(
174
176
img (Tensor[C, H, W]): Image Tensor of dtype uint8 with bounding boxes plotted.
175
177
"""
176
178
179
+ _log_api_usage_once ("utils" , "draw_bounding_boxes" )
177
180
if not isinstance (image , torch .Tensor ):
178
181
raise TypeError (f"Tensor expected, got { type (image )} " )
179
182
elif image .dtype != torch .uint8 :
@@ -252,6 +255,7 @@ def draw_segmentation_masks(
252
255
img (Tensor[C, H, W]): Image Tensor, with segmentation masks drawn on top.
253
256
"""
254
257
258
+ _log_api_usage_once ("utils" , "draw_segmentation_masks" )
255
259
if not isinstance (image , torch .Tensor ):
256
260
raise TypeError (f"The image must be a tensor, got { type (image )} " )
257
261
elif image .dtype != torch .uint8 :
@@ -329,6 +333,7 @@ def draw_keypoints(
329
333
img (Tensor[C, H, W]): Image Tensor of dtype uint8 with keypoints drawn.
330
334
"""
331
335
336
+ _log_api_usage_once ("utils" , "draw_keypoints" )
332
337
if not isinstance (image , torch .Tensor ):
333
338
raise TypeError (f"The image must be a tensor, got { type (image )} " )
334
339
elif image .dtype != torch .uint8 :
0 commit comments