Skip to content

Commit d9a3be0

Browse files
committed
typehints, opencv-python-headless
1 parent 704649c commit d9a3be0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pytorch_grad_cam/base_cam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable, List, Optional, Tuple
1+
from typing import Callable, List, Optional, Tuple, Union
22

33
import numpy as np
44
import torch
@@ -135,7 +135,7 @@ def forward(
135135

136136
def get_target_width_height(
137137
self, input_tensor: torch.Tensor
138-
) -> Tuple[int, int] | Tuple[int, int, int]:
138+
) -> Union[Tuple[int, int], Tuple[int, int, int]]:
139139
if len(input_tensor.shape) == 4:
140140
width, height = input_tensor.size(-1), input_tensor.size(-2)
141141
return width, height

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ torch>=1.7.1
44
torchvision>=0.8.2
55
ttach
66
tqdm
7-
opencv-python
7+
opencv-python-headless
88
matplotlib
99
scikit-learn

0 commit comments

Comments
 (0)