File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
torchvision/transforms/v2/functional Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11import math
2- from typing import Optional
2+ from typing import Optional , Union
33
44import PIL .Image
55import torch
@@ -448,7 +448,7 @@ def sanitize_keypoints(
448448 key_points : torch .Tensor ,
449449 canvas_size : Optional [tuple [int , int ]] = None ,
450450 min_valid_edge_distance : int = 0 ,
451- min_invalid_points : int | float = 1 ,
451+ min_invalid_points : Union [ int , float ] = 1 ,
452452) -> tuple [torch .Tensor , torch .Tensor ]:
453453 """Remove keypoints outside of the image area and their corresponding labels (if any).
454454
@@ -527,7 +527,7 @@ def _get_sanitize_keypoints_mask(
527527 key_points : torch .Tensor ,
528528 canvas_size : tuple [int , int ],
529529 min_valid_edge_distance : int = 0 ,
530- min_invalid_points : int | float = 1 ,
530+ min_invalid_points : Union [ int , float ] = 1 ,
531531) -> torch .Tensor :
532532
533533 image_h , image_w = canvas_size
You can’t perform that action at this time.
0 commit comments