Added manual file path selection option for coco#511
Conversation
|
Updated: YOLO manual path selection is now implemented in the latest commit (4c96108). Both COCO and YOLO manual paths are working. Ready for review. |
|
Thanks for your contribution! There are too many changes in this PR. Give it a second thought and try to keep changes to a minimum please. |
|
Hi, thanks for the feedback! I understand the scope of this PR is quite large. I’ll split it into smaller PRs to keep the changes minimal and easier to review. Does it make sense to separate this into:
Or would you prefer prioritizing a specific subset first? |
|
Hi @shardulmahamulkar ! Sorry for the delay. For now we are going to close this PR just to keep things simple for now. In any case, you can check out how the GUI is looking like in #609 which is meant to be merged soon and give it a try. If you come up with any improvements, feel free to raise an issue! |
Closes #465
Summary
The Streamlit app auto-detects image directories and annotation files based on a fixed COCO folder convention (images/{split}/ + annotations/instances_{split}.json). When users have datasets organised differently, the app failed silently with a generic error and no guidance.
This PR adds an optional "Use manual paths" checkbox in the sidebar (COCO mode only) that lets users override auto-detection by specifying the image directory and annotation file directly.
Changes
perceptionmetrics/utils/gui.py
Added
browse_file(filetypes=None)A cross-platform native file-picker dialog (Windows / WSL / macOS / Linux via zenity or kdialog), analogous to the existing
browse_folder()
.
app.py
Imports
browse_file
alongside
browse_folder
.
Dataset Viewer (
tabs/dataset_viewer.py)manual_img_dirmanual_ann_filemanual_paths_enableddataset_viewer_tab():dataset_pathvalidation when valid manual paths are provided.manual_{img_dir}_{ann_file}_{split}when manual paths are active to prevent stale cache usage.FileNotFoundErrorand generic exceptions).Evaluator (
tabs/evaluator.py)dataset_pathdirectory exists.
Error messages updated with expected structure hints.
Expected COCO Structure (auto-detection)
Testing
.jsonUpdate: YOLO Manual Path Selection
The YOLO mode currently does not correctly detect datasets when using manual path selection. Additionally, Streamlit caching is causing inconsistent behavior in some cases.
I am actively working on resolving these issues.
In the meantime, please feel free to review the current changes and let me know if there are any suggestions or improvements.