Skip to content

Commit

Permalink
ultralytics 8.1.28 avoid * ops on bool Tensors for RT-DETR OpenVINO…
Browse files Browse the repository at this point in the history
… export (#8937)

Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
3 people committed Mar 15, 2024
1 parent bc34ae5 commit 2d513a9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ultralytics/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ultralytics YOLO 🚀, AGPL-3.0 license

__version__ = "8.1.27"
__version__ = "8.1.28"

from ultralytics.data.explorer.explorer import Explorer
from ultralytics.models import RTDETR, SAM, YOLO, YOLOWorld
Expand Down
2 changes: 0 additions & 2 deletions ultralytics/models/rtdetr/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
For more information on RT-DETR, visit: https://arxiv.org/pdf/2304.08069.pdf
"""

from pathlib import Path

from ultralytics.engine.model import Model
from ultralytics.nn.tasks import RTDETRDetectionModel

Expand Down
2 changes: 1 addition & 1 deletion ultralytics/nn/modules/head.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def _generate_anchors(self, shapes, grid_size=0.05, dtype=torch.float32, device=
anchors.append(torch.cat([grid_xy, wh], -1).view(-1, h * w, 4)) # (1, h*w, 4)

anchors = torch.cat(anchors, 1) # (1, h*w*nl, 4)
valid_mask = ((anchors > eps) * (anchors < 1 - eps)).all(-1, keepdim=True) # 1, h*w*nl, 1
valid_mask = ((anchors > eps) & (anchors < 1 - eps)).all(-1, keepdim=True) # 1, h*w*nl, 1
anchors = torch.log(anchors / (1 - anchors))
anchors = anchors.masked_fill(~valid_mask, float("inf"))
return anchors, valid_mask
Expand Down

0 comments on commit 2d513a9

Please sign in to comment.