Downloads · 30 days
0
ShiniShiho/koharu-layout-rfdetr-seg-2xl-1152-onnx
koharu-layout-rfdetr-seg-2xl-1152-onnx is a image segmentation model from ShiniShiho. Use it for the image segmentation task on the model card, and read the license before you ship it in a product. It is set up for onnxruntime. The card lists the license as other.
Validated FP32 ONNX export of mayocream/koharu-layout-rfdetr-seg-2xl-1152. It predicts bounding boxes and instance masks for manga page layout analysis.
Downloads · 30 days
0
Access
Public
Updated Jul 30, 2026
Repo size
148 MB
Likes
1
Public
Click a slice to open those files.
.onnx148 MB · 100%
From the Hugging Face model README
Validated FP32 ONNX export of
mayocream/koharu-layout-rfdetr-seg-2xl-1152.
It predicts bounding boxes and instance masks for manga page layout analysis.
| ID | Class |
|---|---|
| 0 | text |
| 1 | onomatopoeia |
| 2 | bubble |
| 3 | panel |
The model does not perform OCR or reading-order prediction.
rfdetr-seg-2xlarge.onnx — static-batch FP32 ONNX graph, opset 17onnx_config.json — tensor, preprocessing, class, and threshold contractonnx_validation.json — PyTorch/ONNX Runtime parity reportpip install huggingface_hub numpy onnxruntime pillow
from huggingface_hub import hf_hub_download
from PIL import Image
import numpy as np
import onnxruntime as ort
repo_id = "ShiniShiho/koharu-layout-rfdetr-seg-2xl-1152-onnx"
model_path = hf_hub_download(repo_id=repo_id, filename="rfdetr-seg-2xlarge.onnx")
session = ort.InferenceSession(model_path)
image = Image.open("page.jpg").convert("RGB")
array = np.asarray(
image.resize((1152, 1152), Image.Resampling.BILINEAR),
dtype=np.float32,
) / 255.0
array = (array - np.asarray([0.485, 0.456, 0.406], dtype=np.float32)) / np.asarray(
[0.229, 0.224, 0.225], dtype=np.float32
)
input_tensor = array.transpose(2, 0, 1)[None].astype(np.float32)
boxes_cxcywh, class_logits, mask_logits = session.run(
["dets", "labels", "masks"],
{"input": input_tensor},
)
class_scores = 1.0 / (1.0 + np.exp(-class_logits[..., :4]))
class_ids = class_scores.argmax(axis=-1)
confidences = class_scores.max(axis=-1)
The graph has a fixed float32 NCHW input shape of [1, 3, 1152, 1152].
dets contains 300 normalized cx, cy, width, height boxes. labels
contains four class logits plus a final no-object channel; apply sigmoid to the
first four channels. masks contains 300 masks at 288 × 288; resize mask logits
bilinearly to the target image size and threshold at zero.
Recommended confidence thresholds are 0.25 for text, 0.20 for onomatopoeia, and 0.50 for bubbles and panels.
The graph passed ONNX's full model checker and was compared with the source PyTorch graph on a deterministic input:
2.25e-50.999799bf6d2cbd7793c956d8c857bb1672a396eb7f100eb0682f86830d05e31168efb7cc10d4316371946b8441da3512261a8e148b129abcdb0ea6235ed1d1d06d351The export uses rfdetr==1.7.0, ONNX opset 17, and a static batch size of 1.
See onnx_validation.json for environment and raw-output error statistics.
RF-DETR software is Apache-2.0. The source model was fine-tuned using Manga109
images, which are distributed separately under Manga109's academic-use terms.
This repository does not redistribute Manga109 images. The model therefore
retains the source repository's custom/other license designation; users are
responsible for complying with Manga109 and third-party content terms.