Skip to content

Commit

Permalink
Update YOLOv8 class (#79)
Browse files Browse the repository at this point in the history
* yolov8 class working

* better error message
  • Loading branch information
matteobeltrami authored Jan 16, 2024
1 parent 2ba9318 commit 3c6ee87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion micromind/networks/yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,9 @@ class YOLOv8(nn.Module):
def __init__(self, w, r, d, num_classes=80):
super().__init__()
self.net = Darknet(w, r, d)
self.fpn = Yolov8Neck(w, r, d)
self.fpn = Yolov8Neck(
filters=[int(256 * w), int(512 * w), int(512 * w * r)], d=d
)
self.head = DetectionHead(
num_classes, filters=(int(256 * w), int(512 * w), int(512 * w * r))
)
Expand Down
4 changes: 3 additions & 1 deletion recipes/object_detection/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def get_parameters(self, heads=[True, True, True]):
temp = """The layers you selected are not valid. \
Please choose only layers between which the spatial resolution \
doubles every time. Eventually, you can achieve this by \
changing the downsampling layers."""
changing the downsampling layers. If you are trying to change \
the input resolution, make sure you also change it in the \
dataset configuration file and that it is a multiple of 4."""

assert up == [2, 2], " ".join(temp.split())

Expand Down

0 comments on commit 3c6ee87

Please sign in to comment.