Skip to content

Fix #529: support YOLO datasets in the image detection evaluator - #644

Open
gtfrans2re wants to merge 1 commit into
JdeRobot:masterfrom
gtfrans2re:gtfrans2re/fix-529-evaluator-yolo-datase
Open

gtfrans2re wants to merge 1 commit into
JdeRobot:masterfrom
gtfrans2re:gtfrans2re/fix-529-evaluator-yolo-datase

Conversation

@gtfrans2re

Copy link
Copy Markdown

Closes #529

What changed

  • Added load_image_detection_dataset() and get_image_detection_dataset_key() in
    gui/tasks/image_detection/dataset_viewer.py, following the existing
    load_image_segmentation_dataset() pattern.
  • The Dataset Viewer and Evaluator tabs now share this loader, so the Evaluator can
    load YOLO datasets on its own instead of only when the Viewer had cached them first.
  • The dataset type is now part of the session cache key, so switching between COCO
    and YOLO on the same folder/split no longer returns a stale dataset.
  • The YOLO config is read with getvalue() instead of read(), which returns empty
    bytes on a second read of the uploaded file.

Why

As @dpascualhe noted in the issue, YOLO is supported, but the Evaluator's fallback
loader only handled COCO. Whenever the Viewer hadn't cached the dataset (e.g., the
YAML wasn't uploaded yet), users saw "Only COCO datasets are currently supported
for evaluation."

Design decisions

  • The loader keeps filenames relative. model.eval() already calls
    make_fname_global() on its own copy of the dataset, and the Viewer relies on
    relative paths, so the Evaluator no longer globalizes the shared cached dataset.
  • The sidebar is unchanged: YOLO stays selectable because it is supported.
  • Two pre-existing lines in tests/gui/test_image_detection.py that Black would
    reformat were left untouched to keep the diff scoped to this issue.

How it was tested

Screenshots

YOLO dataset loaded in the Evaluator:

01  Screenshot from 2026-09-28 14-01-02

Same dataset in the Dataset Viewer:

02  Screenshot from 2026-09-28 14-01-10

Signed-off-by: gtfrans2re <francoisgonothitoure@gmail.com>
@gtfrans2re

Copy link
Copy Markdown
Author

Hi, @dpascualhe! Any plans to check this PR and merging if it's fine with you?

This branch has not been deployed

No deployments
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.

[Bug] GUI Dataset Type selector includes YOLO but Evaluator only supports COCO — causes silent mismatch

1 participant