Skip to content

fix: YOLOv5u version detection and revert changes in ghcr image building#148

Merged
jkbmrz merged 6 commits intomainfrom
fix/yolov5u_version_detection
May 9, 2025
Merged

fix: YOLOv5u version detection and revert changes in ghcr image building#148
jkbmrz merged 6 commits intomainfrom
fix/yolov5u_version_detection

Conversation

@jkbmrz
Copy link
Copy Markdown
Contributor

@jkbmrz jkbmrz commented May 6, 2025

Purpose

First, this PR improves the automatic YOLO version detection mechanism to better detect the anchor-free version of the YOLOv5 introduced in one of the more recent version of Ultralytics (YOLOv5u). Second, it reverts the ghcr image building changes introduced in #147 (it turns out that the erroneous version detection was the underlying source of the problem).

Specification

tools/main.py:

  • adding a log note when YOLOv5u is detected explaining that the YOLOv8 conversion procedure will be utilized.

tools/utils/version_detection.py:

  • removing the "YOLOv8" in content criterion for YOLOv8 detection as some YOLOv5u models were mistakenly labeled as YOLOv8 due to this check. Moreover, it doesn't seem to be so important for the YOLOv8 detection at all as the "yolov8" in content criterion seems to be sufficient;
  • adding the "yolov5u" in content and "yolov5" in content and "ultralytics" in content criteria for YOLOv5u detection.

Dependencies & Potential Impact

Removing the "YOLOv8" in content criterion might cause some issues (according to my tests it shouldn't but let's be cautious). Do we have some test .pt files that we could run the detection on to test this out?

Deployment Plan

None

Testing & Validation

Testing version detection with some yolo files found online (yolov5n, yolov5nu, yolov8).

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 6, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
22186 4824 22% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
tools/main.py 0% 🟢
tools/utils/init.py 100% 🟢
tools/utils/version_detection.py 87% 🟢
TOTAL 62% 🟢

updated for commit: 24df078 by action🐍

@github-actions
Copy link
Copy Markdown

github-actions bot commented May 6, 2025

Test Results

  6 files    6 suites   8m 44s ⏱️
 26 tests  26 ✅ 0 💤 0 ❌
156 runs  156 ✅ 0 💤 0 ❌

Results for commit 24df078.

♻️ This comment has been updated with latest results.

@jkbmrz jkbmrz changed the title fix: YOLOv5u version detection and image building fix: YOLOv5u version detection and revert changes in ghcr image building May 6, 2025
@jkbmrz jkbmrz marked this pull request as ready for review May 6, 2025 14:44
@jkbmrz jkbmrz requested a review from klemen1999 May 6, 2025 14:44
Copy link
Copy Markdown
Collaborator

@klemen1999 klemen1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but let's add the tests by expanding the test_conversion tests

@jkbmrz jkbmrz requested a review from klemen1999 May 7, 2025 14:27
@jkbmrz jkbmrz merged commit 25588a5 into main May 9, 2025
10 checks passed
@jkbmrz jkbmrz deleted the fix/yolov5u_version_detection branch May 9, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants