Add device to pre-processing
Browse filesSigned-off-by: Vibhu Jawa <vjawa@nvidia.com>
nemotron_page_elements_v3/model.py
CHANGED
|
@@ -145,6 +145,7 @@ class YoloXWrapper(nn.Module):
|
|
| 145 |
"""
|
| 146 |
if not isinstance(image, torch.Tensor):
|
| 147 |
image = torch.from_numpy(image)
|
|
|
|
| 148 |
image = image.permute(2, 0, 1) # [H, W, 3] -> [3, H, W]
|
| 149 |
image = resize_pad(image, self.img_size)
|
| 150 |
return image.float()
|
|
|
|
| 145 |
"""
|
| 146 |
if not isinstance(image, torch.Tensor):
|
| 147 |
image = torch.from_numpy(image)
|
| 148 |
+
image = image.to(self.device)
|
| 149 |
image = image.permute(2, 0, 1) # [H, W, 3] -> [3, H, W]
|
| 150 |
image = resize_pad(image, self.img_size)
|
| 151 |
return image.float()
|