module documentation
Undocumented
Function | apply |
Undocumented |
Function | crop |
Crop the image to the bounding box and resize it to the given size. |
Function | crop |
Crop the keypoints to the bounding box. |
Function | enlarge |
Enlarge the bounding box to the smallest square that contains it without changing its center. |
Function | gaussian |
Undocumented |
Function | get |
Generate the images of the keypoints. |
Function | process |
Process a batch of data. |
Undocumented
Parameters | |
image:torch.Tensor | Undocumented |
meantorch.Tensor | Undocumented |
meantorch.Tensor | Undocumented |
sigma:float | Undocumented |
Returns | |
torch.Tensor | Undocumented |
Crop the image to the bounding box and resize it to the given size.
Parameters | |
image:torch.Tensor | A tensor of shape (batchsize, channels, height, width) containing the image. |
bboxtorch.Tensor | A tensor of shape (batchsize, 4) containing the bounding box in the format [x, y, w, h]. |
imageint | The size to which the image should be resized. |
Returns | |
torch.Tensor | A tensor of shape (batchsize, channels, image_size, image_size) containing the cropped and resized image. |
Crop the keypoints to the bounding box.
Parameters | |
keypoints:torch.Tensor | A tensor of shape (batchsize, num_keypoints, 2) containing the keypoints. |
bboxtorch.Tensor | A tensor of shape (batchsize, 4) containing the bounding box in the format [x, y, w, h]. |
mask:torch.Tensor | A tensor of shape (batchsize, num_keypoints) containing the mask. |
Returns | |
torch.Tensor | A tensor of shape (batchsize, num_keypoints, 3) containing the cropped keypoints. |
Enlarge the bounding box to the smallest square that contains it without changing its center.
Parameters | |
bbox:torch.Tensor | A tensor of shape (4) containing the bounding box in the format [x, y, w, h]. |
Returns | |
torch.Tensor | A tensor of shape (4) containing the enlarged bounding box in the format [x1, y1, w1, h1]. |
Undocumented
Parameters | |
x:torch.Tensor | Undocumented |
y:torch.Tensor | Undocumented |
meantorch.Tensor | Undocumented |
meantorch.Tensor | Undocumented |
sigma:float | Undocumented |
Returns | |
torch.Tensor | Undocumented |
Generate the images of the keypoints.
Parameters | |
keypoints:torch.Tensor | A tensor of shape (batchsize, num_keypoints, 2) containing the keypoints. |
imageint | The size of the image. |
mask:torch.Tensor | A tensor of shape (batchsize, num_keypoints) containing the mask. |
sigma:float | The sigma of the gaussian. |
Returns | |
torch.Tensor | A tensor of shape (batchsize, num_keypoints, image_size, image_size) containing the images of the keypoints. |
Process a batch of data.
Parameters | |
image:torch.Tensor | A tensor of shape (batchsize, channels, height, width) containing the image. |
bbox:torch.Tensor | A tensor of shape (batchsize, 4) containing the bounding box in the format [x, y, w, h]. |
keypoints:torch.Tensor | A tensor of shape (batchsize, num_keypoints, 2) containing the keypoints. |
labeltorch.Tensor | A tensor of shape (batchsize, num_keypoints) containing the mask. |
imageint | The size to which the image should be resized. |
scaleint | Patch size of output keypoint heatmaps. Must be 4 the default Unipose model is used without modification. |
Returns | |
List[ | A list of tensors containing the cropped and resized image and the images of the keypoints. |