Skip to content

Commit f6ee79f

Browse files
committed
Fix mypy for Pillow 10.3.0
Signed-off-by: Beat Buesser <[email protected]>
1 parent 6812e65 commit f6ee79f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

art/estimators/object_tracking/pytorch_goturn.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,11 +743,12 @@ def compute_loss(
743743

744744
return output
745745

746-
def init(self, image: "PIL.JpegImagePlugin.JpegImageFile", box: np.ndarray):
746+
def init(self, image: "PIL.JpegImagePlugin.JpegImageFile", box: np.ndarray): # type: ignore
747747
"""
748748
Method `init` for GOT-10k trackers.
749749
750750
:param image: Current image.
751+
:param box: Initial boxes.
751752
:return: Predicted box.
752753
"""
753754
import torch
@@ -766,7 +767,7 @@ def update(self, image: np.ndarray) -> np.ndarray:
766767
"""
767768
import torch
768769

769-
curr = torch.from_numpy(np.array(image) / 255.0)
770+
curr = torch.from_numpy(image / 255.0)
770771
if self.clip_values is not None:
771772
curr = curr * self.clip_values[1]
772773
curr = curr.to(self.device)
@@ -809,7 +810,7 @@ def track(self, img_files: List[str], box: np.ndarray, visualize: bool = False)
809810
if i_f == 0:
810811
self.init(image, box)
811812
else:
812-
boxes[i_f, :] = self.update(image)
813+
boxes[i_f, :] = self.update(np.array(image))
813814
times[i_f] = time.time() - start_time
814815

815816
if visualize:

0 commit comments

Comments
 (0)