@@ -47,10 +47,10 @@ def __new__(
4747 data : Any ,
4848 * ,
4949 canvas_size : tuple [int , int ],
50- dtype : Optional [ torch .dtype ] = None ,
51- device : Optional [ Union [ torch .device , str , int ]] = None ,
52- requires_grad : Optional [ bool ] = None ,
53- ):
50+ dtype : torch .dtype | None = None ,
51+ device : torch .device | str | int | None = None ,
52+ requires_grad : bool | None = None ,
53+ ) -> KeyPoints :
5454 tensor : torch .Tensor = cls ._to_tensor (data , dtype = dtype , device = device , requires_grad = requires_grad )
5555 if tensor .ndim == 1 :
5656 tensor = tensor .unsqueeze (0 )
@@ -63,10 +63,10 @@ def __new__(
6363 @classmethod
6464 def _wrap_output (
6565 cls ,
66- output : Any ,
66+ output : torch . Tensor ,
6767 args : Sequence [Any ] = (),
68- kwargs : Optional [ Mapping [str , Any ]] = None ,
69- ) -> Any :
68+ kwargs : Mapping [str , Any ] | None = None ,
69+ ) -> KeyPoints :
7070 # Mostly copied over from the BoundingBoxes TVTensor, minor improvements.
7171 # This copies over the metadata.
7272 # For BoundingBoxes, that included format, but we only support one format here !
0 commit comments