Add notes parameter to train() and export() for checkpoint/ONNX provenance metadata#1025
Draft
Add notes parameter to train() and export() for checkpoint/ONNX provenance metadata#1025
notes parameter to train() and export() for checkpoint/ONNX provenance metadata#1025Conversation
2 tasks
…ata provenance Agent-Logs-Url: https://github.com/roboflow/rf-detr/sessions/ae8a6c06-c2ae-4386-951a-e4ff3d1e6285 Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add custom notes to dictionary of .PTH and .ONNX files
Add May 4, 2026
notes parameter to train() and export() for checkpoint/ONNX provenance metadata
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (77%) is below the target coverage (95%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #1025 +/- ##
========================================
- Coverage 80% 77% -3%
========================================
Files 101 101
Lines 8523 8534 +11
========================================
- Hits 6848 6566 -282
- Misses 1675 1968 +293 🚀 New features to boost your workflow:
|
Agent-Logs-Url: https://github.com/roboflow/rf-detr/sessions/ece7f9ed-0892-4f34-907f-f21865140a06 Co-authored-by: Borda <6035284+Borda@users.noreply.github.com>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users running multiple training jobs on different datasets have no way to embed provenance metadata (labeller, date, class names, etc.) into checkpoint and ONNX files, forcing manual renaming workflows that are error-prone.
Changes
TrainConfig(config.py): Addednotes: Optional[Any] = None— accepts any JSON-serialisable value (string, dict, list, int, …).BestModelCallback._build_checkpoint_payload(best_model.py): Writesnotesat the top-levelcheckpoint["notes"]key when non-None. Already flows intocheckpoint["args"]["notes"]via the existingmodel_dump()path.export_onnx(exporter.py): Addednotesparam; post-export, reloads the ONNX file and appends ametadata_propsentry with key"notes". Strings stored verbatim; everything else JSON-encoded.RFDETR.export()(detr.py): Addednotesparam forwarded toexport_onnx.RFDETR.train()already accepts it via**kwargs → TrainConfig; docstring updated accordingly.Usage
Reading back from a checkpoint:
Reading back from ONNX:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://storage.googleapis.com/rfdetr/nano_coco/checkpoint_best_regular.pth/home/REDACTED/work/rf-detr/rf-detr/.venv/bin/python3 /home/REDACTED/work/rf-detr/rf-detr/.venv/bin/python3 -u -c import sys;exec(eval(sys.stdin.readline()))(http block)https://storage.googleapis.com/rfdetr/rf-detr-seg-n-ft.pth/home/REDACTED/work/rf-detr/rf-detr/.venv/bin/python3 /home/REDACTED/work/rf-detr/rf-detr/.venv/bin/python3 -u -c import sys;exec(eval(sys.stdin.readline()))(http block)huggingface.co/home/REDACTED/work/rf-detr/rf-detr/.venv/bin/python3 /home/REDACTED/work/rf-detr/rf-detr/.venv/bin/python3 -u -c import sys;exec(eval(sys.stdin.readline()))(dns block)images.cocodataset.org/home/REDACTED/work/rf-detr/rf-detr/.venv/bin/python3 /home/REDACTED/work/rf-detr/rf-detr/.venv/bin/python3 -u -c import sys;exec(eval(sys.stdin.readline()))(dns block)pypi.nvidia.comif sys.path[0] == "":
sys.path.pop(0)
sys.path = [] + sys.path
import wheel_stub.buildapi as backend
wheel_filename = backend.build_wheel("/home/REDACTED/.cache/uv/builds-v0/.tmpdpD9dq", {}, None)
with open("/home/REDACTED/.cache/uv/builds` (dns block)
if sys.path[0] == "":
sys.path.pop(0)
sys.path = [] + sys.path
import wheel_stub.buildapi as backend
wheel_filename = backend.build_wheel("/home/REDACTED/.cache/uv/builds-v0/.tmpYCmoCz", {}, None)
with open("/home/REDACTED/.cache/uv/builds` (dns block)
if sys.path[0] == "":
sys.path.pop(0)
sys.path = [] + sys.path
import wheel_stub.buildapi as backend
wheel_filename = backend.build_wheel("/home/REDACTED/.cache/uv/builds-v0/.tmpiNTVG7", {}, None)
with open("/home/REDACTED/.cache/uv/builds` (dns block)