Skip to content

Commit 056a033

Browse files
committed
Silence mypy. Twice. lol.
1 parent fcba00a commit 056a033

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

torchvision/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def draw_bounding_boxes(
202202
num_boxes = boxes.shape[0]
203203

204204
if labels is None:
205-
labels = [None] * num_boxes
205+
labels: Union[List[str], List[None]] = [None] * num_boxes # type: ignore[no-redef]
206206
elif len(labels) != num_boxes:
207207
raise ValueError(
208208
f"Number of boxes ({num_boxes}) and labels ({len(labels)}) mismatch. Please specify labels for each box."
@@ -233,7 +233,7 @@ def draw_bounding_boxes(
233233

234234
txt_font = ImageFont.load_default() if font is None else ImageFont.truetype(font=font, size=font_size)
235235

236-
for bbox, color, label in zip(img_boxes, colors, labels):
236+
for bbox, color, label in zip(img_boxes, colors, labels): # type: ignore[arg-type]
237237
if fill:
238238
fill_color = color + (100,)
239239
draw.rectangle(bbox, width=width, outline=color, fill=fill_color)

0 commit comments

Comments
 (0)