GTR

A dense prediction model family whose backbone replaces softmax attention with gated linear attention, run as a recurrence over image tokens. LibreYOLO loads six of its tasks as one family, with the task carried by the checkpoint filename.

작업
detection, instance segmentation, pose, oriented boxes, depth, semantic segmentation
설치
pip install libreyolo
지원 티어
코어, v1.6.0부터 지원. 학습 가능한 핵심 탐지기입니다. 기능은 같은 릴리스 주기에서 플래그십을 따릅니다.
업스트림
Intellindust AI Lab의 GTR, MIT. 논문, 소스
라이선스
코드 MIT and Apache-2.0, 가중치 MIT. 상업적 사용

Install

GTR needs no optional extra. Everything it imports is in the base install.

bash
pip install libreyolo

Adapter fine-tuning with lora=True needs the lora extra.

bash
pip install "libreyolo[lora]"

On CPU and Apple silicon the backbone runs a portable PyTorch recurrence. On CUDA it uses the flash-linear-attention kernels when that package is importable, and the same portable recurrence when it is not. The package is not a LibreYOLO extra. On a compatible CUDA system, install the version the library documents.

bash
pip install flash-linear-attention==0.5.0

The authors' custom CUDA operator and TensorRT plugin are not part of LibreYOLO, and the portable recurrence does not reproduce the latency the paper reports.

Predict

Weights download from Hugging Face on first use and are cached locally.

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreGTRs.pt", device="cpu")result = model(SAMPLE_IMAGE) for box in result.boxes:    print(box.cls, box.conf, box.xyxy)
Instance segmentation
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreGTRs-seg.pt", device="cpu")result = model(SAMPLE_IMAGE) print(result.masks.data.shape)
Pose
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreGTRs-pose.pt", device="cpu")result = model(SAMPLE_IMAGE) print(result.keypoints.xy.shape)   # (people, 17, 2)print(result.boxes.conf)
Oriented boxes
from libreyolo import LibreYOLO, SAMPLE_IMAGE # Oriented boxes run at a fixed 1024 x 1024 input.model = LibreYOLO("LibreGTRs-obb.pt", device="cpu")result = model(SAMPLE_IMAGE) # One row per box: (cx, cy, w, h, theta) in pixels, theta in [0, pi).print(result.obb.xywhr)
Depth
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreGTRs-depth.pt", device="cpu")result = model(SAMPLE_IMAGE) # Relative inverse depth on the original canvas: higher values are closer.depth = result.depth_map.dataprint(depth.shape, float(depth.min()), float(depth.max()))
Semantic segmentation
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreGTRs-sem.pt", device="cpu")result = model(SAMPLE_IMAGE) # (H, W) class IDs on the original canvas; model.names maps them to labels.print(result.semantic_mask.data.unique())print(model.names)

The checkpoint filename selects the task: no suffix for detection, then -seg, -pose, -obb, -depth and -sem. Detection, instance segmentation, pose, depth and semantic segmentation come in four sizes, s, m, l and x. Oriented boxes come in s and x, the only sizes upstream publishes.

Every task returns the Results object all families return. Detection fills result.boxes, instance segmentation adds result.masks, and pose adds result.keypoints for one class, person, with the 17 COCO keypoints. Each pose box is the extent of its keypoints, and keypoint visibility is reported as 1. Detection, instance segmentation, pose and oriented boxes decode a fixed set of queries by top-K selection with no NMS step, so conf and max_det filter the output and iou has no effect.

Detection, instance segmentation, pose and depth take a square input, 640 by default. imgsz must be a single integer that is a multiple of 32 and at least 160; a (height, width) pair raises a ValueError.

Oriented boxes run at a fixed 1024 by 1024 input. The image is resized to fit without distortion and padded at the bottom and right. result.obb.xywhr holds (cx, cy, w, h, theta) in pixels, with w >= h and theta in [0, pi). The published checkpoints predict the 15 DOTA v1.0 classes in upstream order.

Depth fills result.depth_map with relative inverse depth on the original image canvas, so higher values are closer. The network itself predicts metric depth, and 1 / result.depth_map.data recovers that estimate in meters; the meter scale holds only for cameras and scenes like its training data. Preprocessing stretches the image to a square imgsz.

Semantic segmentation fills result.semantic_mask with an (H, W) map of class IDs on the original canvas, over the 19 Cityscapes classes that model.names lists. The image is letterboxed into a 1024 by 2048 canvas, and the network averages overlapping 1024-pixel windows at a 768-pixel stride, as upstream evaluates.

See prediction for sources, streaming and result handling.

Train

All six tasks train through train(), which reads the task from the loaded checkpoint and applies that task's upstream recipe. Every recipe uses AdamW and trains in FP32 by default (amp=False).

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreGTRs.pt", device="cpu")# Detection dataset YAML with YOLO box labels.model.train(data="path/to/your/dataset.yaml", epochs=30, device="cpu", workers=0)
Instance segmentation
from libreyolo import LibreYOLO model = LibreYOLO("LibreGTRs-seg.pt", device="cpu")# Dataset YAML with YOLO polygon labels.model.train(data="path/to/your/dataset.yaml", epochs=30, device="cpu", workers=0)
Segmentation from detection weights
from libreyolo import LibreGTR # Loads every layer from the detection checkpoint except the mask head,# which starts untrained. The factory LibreYOLO() does not take this flag.model = LibreGTR(    "LibreGTRs.pt",    size="s",    task="segment",    allow_detect_to_segment_transfer=True,    device="cpu",)model.train(data="path/to/your/dataset.yaml", epochs=30, device="cpu", workers=0)
Pose
from libreyolo import LibreYOLO # Needs a single-class dataset whose YAML declares kpt_shape: [17, 3],# and imgsz left at the native 640.model = LibreYOLO("LibreGTRs-pose.pt", device="cpu")model.train(data="path/to/your/pose-dataset.yaml", device="cpu", workers=0)
Oriented boxes
from libreyolo import LibreYOLO # Dataset YAML with YOLO oriented-box labels.model = LibreYOLO("LibreGTRs-obb.pt", device="cpu")model.train(data="path/to/your/obb-dataset.yaml", device="cpu", workers=0)
Depth
from libreyolo import LibreYOLO # Ground-truth depth in meters keeps the model's metric scale.model = LibreYOLO("LibreGTRs-depth.pt", device="cpu")model.train(data="path/to/your/depth-dataset.yaml", device="cpu", workers=0)
Semantic segmentation
from libreyolo import LibreYOLO # Images plus single-channel class-ID masks; imgsz sets the square crop.model = LibreYOLO("LibreGTRs-sem.pt", device="cpu")model.train(data="path/to/your/semantic.yaml", device="cpu", workers=0)
LoRA
from libreyolo import LibreYOLO # Needs the lora extra. Detection, instance segmentation, pose and# oriented boxes accept lora=True; depth and semantic segmentation raise.model = LibreYOLO("LibreGTRs.pt", device="cpu")model.train(data="path/to/your/dataset.yaml", epochs=30, lora=True, device="cpu", workers=0)

Detection defaults to 30 epochs, batch 4 and lr0=5e-4, with a 2000-iteration warmup, six flat epochs and cosine decay. Mosaic (mosaic_prob=0.5) and batch MixUp (mixup_prob=0.5) run for the first mosaic_epochs=6 epochs, and the strong augmentations switch off for the last two. Runs shorter than 30 epochs compress these phases to fit. An optimizer other than "adamw" or a scheduler other than "flat_cosine" raises a ValueError rather than being ignored. The backbone trains at a size-specific fraction of lr0.

The other tasks follow their own upstream recipes:

  • Instance segmentation keeps the detection schedule without Mosaic or MixUp and adds mask losses. Upstream starts it from the COCO detector. LibreYOLO does the same only when asked, through allow_detect_to_segment_transfer=True on LibreGTR, and the mask head then starts untrained. On the CLI, task=segment with a detection checkpoint makes the same transfer.
  • Pose runs 92 epochs for s and m and 74 for l and x, with a 500-iteration warmup and then a constant learning rate. It needs imgsz=640 and a single-class dataset whose YAML declares kpt_shape with 17 keypoints; anything else raises before the run starts.
  • Oriented boxes train at the fixed 1024 input for 20 epochs on s and 30 on x, with random flips (flip_prob=0.75) and rotations (degrees=180) in place of Mosaic and MixUp. A dataset with a different class count rebuilds the heads.
  • Depth runs 60 epochs at batch 8 and lr0=2e-4 with a SILog loss. Ground-truth depth in meters keeps the metric scale.
  • Semantic segmentation runs 30 epochs at batch 8 on 1024-pixel square crops, and imgsz sets the crop size. Its head uses BatchNorm, and batches much smaller than 8 give noisy batch statistics.

lora=True freezes the backbone and the decoder layers and trains adapters on the backbone's q, k and v projections and on the decoder layers' linear layers, while the encoder and heads keep training. It applies to detection, instance segmentation, pose and oriented boxes; depth and semantic segmentation raise a ValueError. Export merges the adapters into dense weights. See LoRA.

pretrained=False reinitializes the whole network and trains from scratch. Any value other than True or False raises a ValueError; to start from other weights, load them as the model. resume=True keeps writing into the checkpoint's own run directory with the device passed to the call, and exist_ok=False opens a new numbered run instead.

What has been checked: inference parity against the pinned upstream graph on CPU for every published size of every task, and CPU training runs that complete, save and reload for every task. What has not: convergence of a full fine-tune on a real dataset, multi-GPU training, and reproduction of the accuracy the authors report.

Dataset setup describes the required training data.

Validate

val() returns a dictionary of metrics/ keys. Detection reports box mAP under metrics/mAP50-95 and metrics/mAP50, and oriented boxes report rotated-box mAP under the same keys. Instance segmentation reports masks under (M) and boxes under (B), and pose reports keypoint OKS metrics under metrics/keypoints_*. Depth reports metrics/abs_rel, metrics/rmse and metrics/delta1 to metrics/delta3, and semantic segmentation reports metrics/mIoU and metrics/pixel_accuracy.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreGTRs.pt", device="cpu")metrics = model.val(data="path/to/your/dataset.yaml", workers=0) print(metrics["metrics/mAP50-95"])print(metrics["metrics/mAP50"])
Instance segmentation
from libreyolo import LibreYOLO model = LibreYOLO("LibreGTRs-seg.pt", device="cpu")metrics = model.val(data="path/to/your/dataset.yaml", workers=0) print(metrics["metrics/mAP50-95(M)"])   # masksprint(metrics["metrics/mAP50-95(B)"])   # boxes
Pose
from libreyolo import LibreYOLO model = LibreYOLO("LibreGTRs-pose.pt", device="cpu")metrics = model.val(data="path/to/your/pose-dataset.yaml", workers=0) print(metrics["metrics/keypoints_mAP50-95"])print(metrics["metrics/keypoints_mAP50"])
Oriented boxes
from libreyolo import LibreYOLO # Label IDs must follow the DOTA v1.0 class order of the checkpoint.model = LibreYOLO("LibreGTRs-obb.pt", device="cpu")metrics = model.val(data="path/to/your/obb-dataset.yaml", workers=0) print(metrics["metrics/mAP50-95"])print(metrics["metrics/mAP50"])
Depth
from libreyolo import LibreYOLO model = LibreYOLO("LibreGTRs-depth.pt", device="cpu")metrics = model.val(data="path/to/your/depth-dataset.yaml", workers=0) print(metrics["metrics/abs_rel"])print(metrics["metrics/delta1"])
Semantic segmentation
from libreyolo import LibreYOLO model = LibreYOLO("LibreGTRs-sem.pt", device="cpu")metrics = model.val(data="path/to/your/semantic.yaml", workers=0) print(metrics["metrics/mIoU"])print(metrics["metrics/pixel_accuracy"])

Validating a published oriented-box checkpoint expects label IDs in its DOTA v1.0 class order, so a dataset labeled in a different order needs its IDs remapped first. Depth validation fits a per-image scale and shift in inverse-depth space rather than following the upstream evaluation protocol, so its numbers are not comparable to the paper's. Validation explains the dataset requirements and returned metrics.

Export

작업ONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
DetectionDetection to ONNX: 지원함Detection to TorchScript: 지원함Detection to ExecuTorch: 지원하지 않음Detection to TensorRT: 지원하지 않음Detection to OpenVINO: 지원하지 않음Detection to Paddle: 지원하지 않음Detection to MNN: 지원하지 않음Detection to RKNN: 지원하지 않음Detection to ncnn: 지원하지 않음Detection to TFLite: 지원하지 않음Detection to CoreML: 지원하지 않음Detection to Core AI: 지원하지 않음
Instance segmentationInstance segmentation to ONNX: 지원함Instance segmentation to TorchScript: 지원함Instance segmentation to ExecuTorch: 지원하지 않음Instance segmentation to TensorRT: 지원하지 않음Instance segmentation to OpenVINO: 지원하지 않음Instance segmentation to Paddle: 지원하지 않음Instance segmentation to MNN: 지원하지 않음Instance segmentation to RKNN: 지원하지 않음Instance segmentation to ncnn: 지원하지 않음Instance segmentation to TFLite: 지원하지 않음Instance segmentation to CoreML: 지원하지 않음Instance segmentation to Core AI: 지원하지 않음
PosePose to ONNX: 지원함Pose to TorchScript: 지원함Pose to ExecuTorch: 지원하지 않음Pose to TensorRT: 지원하지 않음Pose to OpenVINO: 지원하지 않음Pose to Paddle: 지원하지 않음Pose to MNN: 지원하지 않음Pose to RKNN: 지원하지 않음Pose to ncnn: 지원하지 않음Pose to TFLite: 지원하지 않음Pose to CoreML: 지원하지 않음Pose to Core AI: 지원하지 않음
Oriented boxesOriented boxes to ONNX: 지원함Oriented boxes to TorchScript: 지원함Oriented boxes to ExecuTorch: 지원하지 않음Oriented boxes to TensorRT: 지원하지 않음Oriented boxes to OpenVINO: 지원하지 않음Oriented boxes to Paddle: 지원하지 않음Oriented boxes to MNN: 지원하지 않음Oriented boxes to RKNN: 지원하지 않음Oriented boxes to ncnn: 지원하지 않음Oriented boxes to TFLite: 지원하지 않음Oriented boxes to CoreML: 지원하지 않음Oriented boxes to Core AI: 지원하지 않음
DepthDepth to ONNX: 지원함Depth to TorchScript: 지원함Depth to ExecuTorch: 지원하지 않음Depth to TensorRT: 지원하지 않음Depth to OpenVINO: 지원하지 않음Depth to Paddle: 지원하지 않음Depth to MNN: 지원하지 않음Depth to RKNN: 지원하지 않음Depth to ncnn: 지원하지 않음Depth to TFLite: 지원하지 않음Depth to CoreML: 지원하지 않음Depth to Core AI: 지원하지 않음
Semantic segmentationSemantic segmentation to ONNX: 지원함Semantic segmentation to TorchScript: 지원함Semantic segmentation to ExecuTorch: 지원하지 않음Semantic segmentation to TensorRT: 지원하지 않음Semantic segmentation to OpenVINO: 지원하지 않음Semantic segmentation to Paddle: 지원하지 않음Semantic segmentation to MNN: 지원하지 않음Semantic segmentation to RKNN: 지원하지 않음Semantic segmentation to ncnn: 지원하지 않음Semantic segmentation to TFLite: 지원하지 않음Semantic segmentation to CoreML: 지원하지 않음Semantic segmentation to Core AI: 지원하지 않음

ONNX and TorchScript are the two formats; any other raises NotImplementedError. Both produce a static FP32 graph, and dynamic=True or half=True raises a ValueError. Detection, instance segmentation, pose and depth export at a fixed square input, oriented boxes at 1024 by 1024, and semantic segmentation at a 1024 by 2048 canvas with the sliding windows inside the graph. Depth exports at batch 1. The recurrence exports as an ONNX Loop. For semantic segmentation, ONNX export skips graph simplification by default because it is slow on CPU and does not shrink the graph; pass simplify=True to run it anyway.

An exported artifact loads back through LibreYOLO() on its file suffix and returns the same Results.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreGTRs.pt", device="cpu")model.export(format="onnx")          # static FP32 graph, 640 x 640model.export(format="torchscript")
Use the exported file
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreGTRs.pt", device="cpu")path = model.export(format="onnx") # The factory routes on the file suffix, so the exported file loads# like a checkpoint and returns the same Results object.exported = LibreYOLO(path)result = exported(SAMPLE_IMAGE) print(result.boxes.xyxy)

Export setup lists format dependencies and loading exported artifacts.

ONNX inputs and outputs

LibreGTR detection, instance segmentation and pose

텐서images float32 [batch, 3, height, width]
색상RGB
스케일링픽셀 / 255
정규화평균 [0.485,0.456,0.406], 표준편차 [0.229,0.224,0.225]
크기 조정너비 x 높이로 늘림(패딩 없음, 종횡비 유지 안 함), Pillow bilinear
Pillow의 바이리니어 리사이즈를 재현하는 방법

LibreYOLO는 Pillow의 BILINEAR 필터(Image.resize)로 크기를 조정합니다. OpenCV의 INTER_LINEAR나 INTER_AREA가 아닙니다. 축소할 때 Pillow는 축소 배율만큼 필터를 넓히며, OpenCV의 리사이즈는 검출 결과를 바꾸고 상자를 몇 픽셀 옮깁니다. Pillow 없이 재현하려면 한 축을 리사이즈해 8비트로 반올림한 뒤, 다른 축을 리사이즈해 다시 반올림합니다. 축마다 s = in_size / out_size, f = max(s, 1)로 둡니다. 출력 픽셀 i의 중심은 c = (i + 0.5) * s이고, 원본 픽셀 j를 int(c - f + 0.5)부터 int(c + f + 0.5) - 1까지(이미지 범위로 제한) 읽으며, 각 가중치는 max(0, 1 - |j + 0.5 - c| / f)이고 가중치의 합으로 나눕니다. Pillow는 고정소수점으로 계산하고 이미지 모양에 따라 축 순서를 고르므로, 부동소수점 가중치는 일부 픽셀에서 한 단계 다를 수 있습니다. 이는 우리 검증 결과를 바꾸지 않습니다.

Square input only. Export rejects a non-square imgsz, and height and width are 640 by default.

Pillow computes in fixed point. For an exact match, multiply each weight by 2^22 and round it to an integer, halves away from zero. Start each output sum at 2^21, add pixel x weight in integers, shift right by 22 bits and clip to 0 to 255. Plain float weights differ from Pillow by a level or two on up to about 1 % of the pixels. At the default threshold that stays within the pass bar for every GTR task, but at conf 0.01 it adds two borderline OBB boxes.

Divide by 255 after the resize, then subtract the ImageNet mean and divide by the std per channel.

The export is static: LibreYOLO rejects dynamic=True and half=True for GTR. batch is 1 unless you export with batch=N. A batch=2 export decodes each image like a batch-1 run.

There is no nms=True variant. LibreYOLO rejects it for every GTR task, because embedded NMS export supports YOLO9 detection only. GTR needs no NMS.

Detection, 기본 내보내기
출력형태의미
pred_logits[batch, queries, nc]Raw class logits, sigmoid not applied. queries is 300.
pred_boxes[batch, queries, 4]cx, cy, w, h normalized 0 to 1 of the input. The input is a stretch of the whole image, so the same fractions hold on the original image.

후처리

  1. Apply sigmoid to pred_logits. Flatten the scores to queries x nc pairs and take the top max_det (300 by default) over all pairs, sorted by score. For flat index i, the query is i // nc and the class is i % nc, so one query can yield several classes.
  2. Keep the pairs whose score is above the confidence threshold (0.25 by default). There is no NMS, so the iou argument has no effect.
  3. Convert each kept box to x1, y1, x2, y2, then multiply x by the original image width and y by the original image height. LibreYOLO does not clip these boxes.
Instance segmentation, 기본 내보내기
출력형태의미
pred_logits[batch, queries, nc]Raw class logits, sigmoid not applied. queries is 300.
pred_boxes[batch, queries, 4]cx, cy, w, h normalized 0 to 1 of the input, as in detection.
pred_masks[batch, queries, mask_h, mask_w]Raw mask logits per query, sigmoid not applied. mask_h and mask_w are a quarter of the input side, 160 x 160 at 640 x 640.

후처리

  1. Select detections and map their boxes exactly as for detection: sigmoid, top 300 over queries x nc, keep score above 0.25, no NMS, x1, y1, x2, y2 times the original width and height, no clipping.
  2. Take the mask logits of each selected query and resize them straight to the original image size with plain bilinear interpolation (half-pixel centers, align_corners=False, no antialiasing). OpenCV INTER_LINEAR on the float logits does this.
  3. A pixel belongs to the instance when its resized logit is above 0. The mask is not cropped to the box.
Pose, 기본 내보내기
출력형태의미
pred_logits[batch, queries, 2]Two raw logits per query, sigmoid not applied. The person score is the last one, index 1. Index 0 is unused. queries is 60.
pred_keypoints[batch, queries, num_keypoints * 2]x0, y0, x1, y1 and so on, normalized 0 to 1 of the input. num_keypoints is 17, in COCO order. There is no box output and no keypoint confidence.

후처리

  1. The person score of a query is sigmoid of its logit at index 1.
  2. Sort the queries by score, take the top max_det (300 by default, so all 60) and keep those whose score is at or above the confidence threshold (0.25 by default). There is no NMS.
  3. Reshape the keypoints of each kept query to [num_keypoints, 2] and multiply x by the original image width and y by the original image height.
  4. LibreYOLO reports visibility 1.0 for every keypoint, because the graph predicts none.
  5. The box is the extent of the keypoints: min x, min y, max x, max y over the 17 points.

LibreGTR oriented boxes (OBB)

텐서images float32 [batch, 3, height, width]
색상RGB
스케일링픽셀 / 255
정규화평균 [0.485,0.456,0.406], 표준편차 [0.229,0.224,0.225]
크기 조정custom, Pillow bilinear
Pillow의 바이리니어 리사이즈를 재현하는 방법

LibreYOLO는 Pillow의 BILINEAR 필터(Image.resize)로 크기를 조정합니다. OpenCV의 INTER_LINEAR나 INTER_AREA가 아닙니다. 축소할 때 Pillow는 축소 배율만큼 필터를 넓히며, OpenCV의 리사이즈는 검출 결과를 바꾸고 상자를 몇 픽셀 옮깁니다. Pillow 없이 재현하려면 한 축을 리사이즈해 8비트로 반올림한 뒤, 다른 축을 리사이즈해 다시 반올림합니다. 축마다 s = in_size / out_size, f = max(s, 1)로 둡니다. 출력 픽셀 i의 중심은 c = (i + 0.5) * s이고, 원본 픽셀 j를 int(c - f + 0.5)부터 int(c + f + 0.5) - 1까지(이미지 범위로 제한) 읽으며, 각 가중치는 max(0, 1 - |j + 0.5 - c| / f)이고 가중치의 합으로 나눕니다. Pillow는 고정소수점으로 계산하고 이미지 모양에 따라 축 순서를 고르므로, 부동소수점 가중치는 일부 픽셀에서 한 단계 다를 수 있습니다. 이는 우리 검증 결과를 바꾸지 않습니다.

Square input only. Export rejects a non-square imgsz, and height and width are 1024 by default.

This is a letterbox with two differences from the usual one. Scale by r = min(height / h, width / w) and resize to (round(w * r), round(h * r)), where round is Python's round, which sends halves to the even integer. Then paste the result in the top-left corner of a canvas filled with 0 (black), not 114.

Resize with Pillow's BILINEAR filter, with the same per-axis formula and fixed point as the detection variant. OpenCV INTER_LINEAR is not a match when shrinking.

Divide the whole canvas by 255, then subtract the ImageNet mean and divide by the std per channel, padding included. Padded pixels are therefore not 0 in the tensor.

The export is static: LibreYOLO rejects dynamic=True and half=True for GTR. batch is 1 unless you export with batch=N. A batch=2 export decodes each image like a batch-1 run.

There is no nms=True variant. LibreYOLO rejects it for every GTR task, because embedded NMS export supports YOLO9 detection only. GTR needs no NMS.

Oriented boxes, 기본 내보내기
출력형태의미
pred_logits[batch, queries, nc]Raw class logits, sigmoid not applied. queries is 300. nc is 15 for the DOTA v1.0 checkpoints.
pred_boxes[batch, queries, 5]cx, cy, w, h normalized 0 to 1 of the input canvas, then the angle divided by pi, also 0 to 1.

후처리

  1. Apply sigmoid to pred_logits. Flatten the scores to queries x nc pairs and take the top max_det (300 by default) over all pairs, sorted by score. For flat index i, the query is i // nc and the class is i % nc, so one query can yield several classes.
  2. Keep the pairs whose score is above the confidence threshold (0.25 by default). There is no NMS, rotated or not.
  3. Map to the original image: multiply cx and w by width and cy and h by height, then divide all four by r. The padding is at the bottom and right, so there is no offset to subtract.
  4. The angle in radians is the fifth value times pi, so it lies in 0 to pi.
  5. Corners: each offset (dx, dy) in (-w/2, -h/2), (w/2, -h/2), (w/2, h/2), (-w/2, h/2) maps to x = cx + dx cos(angle) - dy sin(angle) and y = cy + dx sin(angle) + dy cos(angle). With y pointing down, a positive angle turns the box clockwise on screen.
  6. LibreYOLO's axis-aligned box is the box around those corners: cx plus or minus (|cos| w/2 + |sin| h/2), and cy plus or minus (|sin| w/2 + |cos| h/2). Nothing is clipped.

LibreGTR depth

텐서images float32 [batch, 3, height, width]
색상RGB
스케일링픽셀 / 255
정규화없음
크기 조정너비 x 높이로 늘림(패딩 없음, 종횡비 유지 안 함), Pillow bilinear
Pillow의 바이리니어 리사이즈를 재현하는 방법

LibreYOLO는 Pillow의 BILINEAR 필터(Image.resize)로 크기를 조정합니다. OpenCV의 INTER_LINEAR나 INTER_AREA가 아닙니다. 축소할 때 Pillow는 축소 배율만큼 필터를 넓히며, OpenCV의 리사이즈는 검출 결과를 바꾸고 상자를 몇 픽셀 옮깁니다. Pillow 없이 재현하려면 한 축을 리사이즈해 8비트로 반올림한 뒤, 다른 축을 리사이즈해 다시 반올림합니다. 축마다 s = in_size / out_size, f = max(s, 1)로 둡니다. 출력 픽셀 i의 중심은 c = (i + 0.5) * s이고, 원본 픽셀 j를 int(c - f + 0.5)부터 int(c + f + 0.5) - 1까지(이미지 범위로 제한) 읽으며, 각 가중치는 max(0, 1 - |j + 0.5 - c| / f)이고 가중치의 합으로 나눕니다. Pillow는 고정소수점으로 계산하고 이미지 모양에 따라 축 순서를 고르므로, 부동소수점 가중치는 일부 픽셀에서 한 단계 다를 수 있습니다. 이는 우리 검증 결과를 바꾸지 않습니다.

Square input only. Export rejects a non-square imgsz, and height and width are 640 by default.

Resize with Pillow's BILINEAR filter, with the same per-axis formula and fixed point as the detection variant. On the test image, OpenCV INTER_LINEAR input changes the depth by 4.5 % at the median pixel and by up to 45 % at some pixels.

Divide by 255 only. The graph applies the ImageNet mean and std itself.

Batch size 1 only. Export rejects batch values other than 1 for depth.

In LibreYOLO 1.7.0, LibreYOLO("model.onnx").predict resizes depth input with OpenCV INTER_LINEAR, so its depth maps differ from the .pt model's in the same way. Compare your implementation with LibreYOLO("model.pt").predict instead.

There is no nms=True variant.

Depth, 기본 내보내기
출력형태의미
depth[batch, 1, height, width]Inverse depth in 1 / metres at the input resolution, higher is closer. 1 / value is GTR's metric depth estimate in metres. Not normalized.

후처리

  1. Resize the map to the original image size with bilinear interpolation and align_corners=True: on each axis, source coordinate = destination coordinate x (in_size - 1) / (out_size - 1). OpenCV resize has no align_corners=True mode.
  2. LibreYOLO returns that map as is, as inverse depth with near high. Take 1 / value for metres.

LibreGTR semantic segmentation

텐서images float32 [batch, 3, height, width]
색상RGB
스케일링픽셀 / 255
정규화없음
크기 조정letterbox, bilinear, 패딩 값 114, 패딩 위치 topleft

height x width is 1024 x 2048 by default, the Cityscapes canvas. Height comes before width.

Scale by r = min(height / h, width / w), resize to (int(w * r), int(h * r)) with OpenCV INTER_LINEAR and paste it in the top-left corner of a canvas filled with 114.

Unlike the other GTR tasks, this resize is OpenCV, not Pillow. Pillow input drops the pixel agreement with LibreYOLO below 99.7 % on the test image.

Divide by 255 only. The graph applies the ImageNet mean and std itself.

The graph slides 1024 x 1024 windows with stride 768 over the canvas and averages their logits, so a 1024 x 2048 input runs three windows.

The export is static: LibreYOLO rejects dynamic=True and half=True for GTR. batch is 1 unless you export with batch=N. A batch=2 export decodes each image like a batch-1 run.

There is no nms=True variant.

Semantic segmentation, 기본 내보내기
출력형태의미
semantic_logits[batch, nc, height, width]Raw class logits at the input resolution, softmax not applied. nc is 19, the Cityscapes classes.

후처리

  1. Crop the image area: the top round(h * r) rows and the left round(w * r) columns, where round is Python's round.
  2. Resize the crop to the original image size with plain bilinear interpolation (half-pixel centers, align_corners=False, no antialiasing). OpenCV INTER_LINEAR on the float logits does this.
  3. The label of each pixel is the argmax over the nc classes. LibreYOLO applies no softmax and no threshold.

직접 구현한 코드를 확인하려면 같은 파일을 LibreYOLO로 실행하세요. LibreYOLO("model.onnx").predict("image.jpg")가 기준 결과를 반환합니다. LibreYOLO 1.7.0으로 검증함.

Checkpoints

Every published weight file for this family.

위의 모든 파일은 현재 LibreYOLO 조직에 있으며 처음 사용할 때 내려받습니다.

Licensing

내려받는 특정 가중치의 Hugging Face 저장소에서 라이선스를 확인하십시오. LibreYOLO 조직의 모든 체크포인트에는 라이선스가 있으며 한 계열 안에서도 항상 같지는 않습니다. 해당 저장소가 신뢰할 수 있는 기준입니다. 아래 요약은 이 페이지를 마지막으로 검증했을 때 적용된 내용을 설명합니다.

관련 라이선스에 관한 설명이며 법률 자문이 아닙니다. 상업적으로 중요한 사안이라면 라이선스를 직접 읽고 별도의 법률 자문을 받으십시오.

원작
GTR, Intellindust AI Lab
업스트림 라이선스
MIT
LibreYOLO 코드
MIT
가중치
MIT, huggingface.co/LibreYOLO에 다시 게시됨
해석
MIT is a permissive license, so this code and these weights can be used in commercial and closed-source products. It asks only that you keep the copyright and license notice with any copy you redistribute. The upstream GTR source is MIT, and the publisher's weight repository on Hugging Face declares MIT for the detection, instance segmentation, pose, oriented-box, depth and semantic segmentation checkpoints that LibreYOLO converts. Parts of the LibreYOLO port are derived from Apache-2.0 projects and keep that license; their notices are retained in libreyolo/models/gtr/NOTICE. Apache-2.0 is also permissive: redistributing that code means keeping its license text and notices, and it grants a patent license.

Citation

@article{gtr2026feng,
  title   = {GTR: Gated Token Recurrence for Efficient Dense Prediction},
  author  = {Feng, Zhe and Liu, Longfei and Liu, Wei and Chen, Kai and Kong, Jiangang and Zhou, Wei and Qian, Yifeng and Chen, Dexiong and Yu, Xuanlong and Shen, Xi},
  journal = {arXiv preprint arXiv:2609.26590},
  year    = {2026}
}

github.com/Intellindust-AI-Lab/GTR#citation에 있는 저자의 인용 블록에서 복사했습니다.

LibreYOLO v1.6.0에서 검증되었습니다. 이 페이지의 지원 표, 체크포인트, 벤치마크 수치는 출시된 라이브러리와 공개된 가중치에서 생성되며 수동으로 작성되지 않습니다.