Add LibreRFDETRm-ui (UI-DETR-1), match upstream RF-DETR resize, make Results.plot() render every task - #897
Merged
Merged
Conversation
…-class conversion
| FILENAME_PREFIX: ClassVar[str] = "LibreRFDETR" | ||
| # Dataset-variant weights: ``-ui`` is the class-agnostic UI element | ||
| # detector (UI-DETR-1, racineai, MIT), an RF-DETR-M fine-tune. | ||
| WEIGHT_VARIANTS: ClassVar[tuple[str, ...]] = ("ui",) |
There was a problem hiding this comment.
UI weights cannot auto-download. If the Hugging Face mirror remains unavailable as stated in the PR, loading
LibreRFDETRm-ui.pt without a local copy sends the user to a URL that returns 404. The advertised auto-download workflow fails, so users cannot obtain the new variant that way. Publish the weights before advertising it as downloadable.
Contributor
Author
Handoff (end of 2026-09-24)State of this PR at head Done
Next steps
Open decisions (not in this PR)
Done outside the repo (HF, no code change)
|
…emory and URL inputs
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.
What: add the UI-DETR-1 weights as an RF-DETR dataset variant (
LibreRFDETRm-ui.pt), and fix two RF-DETR bugs it exposed.Why: #896. UI-DETR-1 (racineai, MIT) is an RF-DETR-M fine-tune for class-agnostic UI element detection, so it needs weights, not a new family.
WEIGHT_VARIANTS = ("ui",)on RF-DETR, soLibreRFDETRm-ui.ptauto-downloads fromLibreYOLO/LibreRFDETRm-ui.PUBLISHED_WEIGHT_VARIANTSlimits variant downloads to the published (size, task, variant) triples; names likeLibreRFDETRs-ui.ptorLibreRFDETRm-seg-ui.ptraiseFileNotFoundErrorlisting the valid name instead of hitting a 404.predict()since rf-detr 1.9.0 (fix(inference): disable antialias inpredict()resize to match training roboflow/rf-detr#1206). Before this, PIL bilinear antialiased on downscale and boxes drifted on large inputs.nc=1, notnc=80with 79 placeholder names.modelstate, strict schema validation passes) and added to the LibreYOLO Models collection. Auto-download from a clean directory verified.Results.plot()renders every predict output (boxes, masks, OBB, keypoints, classify top-5, points, OCR, semantic, panoptic, gaze). It raisedNotImplementedErrorfor all of them. Returns a BGRnp.ndarray(pil=Truefor PIL) and takesconf,labels,boxes,masks,probs,line_width,img,show,save,filename. One renderer,drawing.draw_results, now backsplot(),predict(save=True), video saving, L2CS and every exported-model backend, so a plot matches the saved file.Results.orig_img(BGR) keeps in-memory and URL sources. Local files are reopened frompath; collected video/GIF results keep no frames andplot()decodesframe_idxon demand, so directory and video predictions do not hold every image.weights/LICENSE_NOTICE.txt, upload-skill whitelist, CHANGELOG.Parity vs upstream
rfdetr1.10.1 at conf 0.3 (5 UI screenshots, 6 COCO images; UI-DETR-1 and stock RF-DETR-M):ONNX vs PyTorch on UI-DETR-1: identical boxes at conf >= 0.3; differences only in boxes below conf 0.26.
Check (plot):
draw_resultsis a move of_save_annotated_image's per-task branches; saved detect/segment/pose images are pixel-identical before and after the refactor (YOLO9, RF-DETR-seg, YOLO-NAS-pose). Classification saves now draw the top-5, and tracked results show track IDs.Greptile notes: the "single-logit head mislabelled" finding is not a bug. RF-DETR uses sigmoid/focal classification with no background logit; a one-category upstream dataset gives a one-output head, and upstream
rfdetrpredicts class 0 for every UI-DETR-1 box, which this conversion matches box for box.Known limits: in-memory image lists keep their sources (the caller already holds them); a collected remote video stream cannot be re-decoded, so pass
stream=Trueto plot its frames.Check: the resize change affects every RF-DETR detect/seg/obb predict, val and ONNX runtime (pose keeps its antialiased path; LW-DETR/DETR/Deformable DETR have their own preprocess and are untouched). RF-DETR-M COCO mAP50-95 on a 200-image val subset: 0.6195 -> 0.6179.
Not verified:
Closes #896.
Opened by an agent.
Code provenance
The PR appears safe to merge; no new actionable issue or outstanding previous finding remains.
Summary
The PR adds UI-DETR-1 as an RF-DETR-M weight variant, changes RF-DETR inference resize to match upstream behavior, and gives prediction results a shared renderer for plotting and saving.
Reviews (4) · Last reviewed commit: "Keep the source image on gaze and OCR re..."