ONNX 模型库
返回模型

说明文档

Cyan Sketch - 白板形状检测器

用于检测白板/流程图图像中形状和连接符的 YOLOv8n 模型。

模型详情

  • 架构: YOLOv8n (nano)
  • 格式: ONNX
  • 输入尺寸: 640x640
  • 类别: 30 种形状类型

性能

指标 数值
mAP50 0.592
mAP50-95 0.339

各类别性能 (前 10)

类别 mAP50
rounded_rectangle 0.995
stick_figure 0.995
cloud 0.980
rectangle 0.857
sticky_note 0.857
cylinder 0.823
text_label 0.774
circle 0.738
oval 0.735
diamond 0.713

类别 (30)

rectangle, rounded_rectangle, oval, circle, diamond, triangle,
cylinder, cloud, hexagon, parallelogram, sticky_note, stick_figure,
solid_arrow, dashed_arrow, bidirectional_arrow, line, curved_arrow,
start_dot, end_dot, text_label, ellipse, square,
curved_bidirectional_arrow, dashed_line, dotted_line, dotted_arrow,
solid_circle, double_solid_line, dashed_oval, curved_line

使用方法

import onnxruntime as ort
import cv2
import numpy as np

# 加载模型
session = ort.InferenceSession("best.onnx")

# 加载类别
with open("classes.txt") as f:
    classes = [l.strip() for l in f]

# 预处理图像
img = cv2.imread("whiteboard.jpg")
resized = cv2.resize(img, (640, 640))
blob = cv2.cvtColor(resized, cv2.COLOR_BGR2RGB).astype(np.float32) / 255.0
blob = np.transpose(blob, (2, 0, 1))[None, ...]

# 运行推理
outputs = session.run(None, {"images": blob})[0]

# 解析检测结果 (置信度 > 0.3)
for i in range(outputs.shape[2]):
    scores = outputs[0, 4:, i]
    class_id = np.argmax(scores)
    conf = scores[class_id]
    if conf > 0.3:
        print(f"{classes[class_id]}: {conf:.2f}")

文件

  • best.onnx - ONNX 模型 (6MB)
  • classes.txt - 类别名称
  • ocr_dictionary.json - 用于 OCR 纠正的领域术语

许可证

商业源代码许可证 - 详见 LICENSE 文件

blockxaero/cyan-sketch

作者 blockxaero

object-detection onnxruntime
↓ 0 ♥ 0

创建时间: 2025-12-13 01:59:42+00:00

更新时间: 2025-12-15 05:01:51+00:00

在 Hugging Face 上查看

文件 (5)

.gitattributes
README.md
SKILL.md
classes.txt
cyan-sketch.onnx ONNX