/ Модель

Характеристики

Лицензия
AGPL 3.0
Библиотека
ultralytics
Опубликована
11 сен 2026

logicdrawer-yolo26s

Поиск объектовИзображение → bounding_boxes3 профессии
24скачиваний за 30 дней2лайкавеса обновлены11 сен 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Модель YOLO26s обнаруживает семь типов логических вентилей на фотографиях и изображениях схем.

LogicDrawer YOLO26s — модель обнаружения объектов, разработанная для распознавания символов логических вентилей на схемах. Она находит семь классов: AND, NAND, NOR, NOT, OR, XNOR и XOR; обучена с нуля на архитектуре Ultralytics YOLO26s. Модель содержит 9,95 млн параметров и принимает изображение размером 640 × 640 пикселей. Репозиторий включает веса PyTorch и ONNX; ONNX-модель возвращает готовые рамки и оценки уверенности без отдельного этапа NMS.

Модель предназначена для анализа нарисованных от руки, отсканированных и созданных в графических редакторах схем. На тестовой выборке из 224 изображений достигнут mAP50 0,961; ошибки чаще возникают на плотных сканах и при различении символов с инверсией. Входы следует предварительно преобразовать в градации серого. Данные для рукописных схем ограничены, а провода, соединения, входы и выходы модель не распознаёт. Лицензия — AGPL-3.0.

Сценарии применения

  • поиск логических вентилей на фотографиях нарисованных от руки схем
  • обнаружение символов вентилей на сканах печатных схем
  • распознавание элементов логических схем в графических редакторах

Ограничения

Входные изображения следует преобразовать в градации серого; провода, соединения, входы и выходы не распознаются. Рукописные примеры составляют небольшую часть данных, а на сложных изображениях возможны пропуски и путаница между вентилями с инверсией и без неё.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

LogicDrawer YOLO26s gate detector

Detects hand-drawn and printed logic gate symbols in circuit drawings. Seven classes: AND, NAND, NOR, NOT, OR, XNOR, XOR. Trained from random initialization with Ultralytics YOLO26s.

ArchitectureYOLO26s, no NMS, direct box regression
Parameters / FLOPs9.95 M / 22.8 GFLOPs at 640 (fused: 9.47 M / 20.8)
Input640 px, grayscale content (3-channel)
Checkpointlogicdrawer_yolo26s.pt, logicdrawer_yolo26s.onnx (opset 18, input 1x3x640x640, output 1x300x6)
Training235 epochs (best at 135, early stop), 1.26 h on an RTX 4050 Laptop 6 GB
Inference6.8 ms / image at batch 16 fp16 on the RTX 4050

Usage

pip install "ultralytics>=8.4.146" huggingface_hub
from huggingface_hub import hf_hub_download
from ultralytics import YOLO
from PIL import Image, ImageOps

weights = hf_hub_download("KaanAydinli/logicdrawer-yolo26s", "logicdrawer_yolo26s.pt")
model = YOLO(weights)
im = ImageOps.exif_transpose(Image.open("circuit.jpg")).convert("L").convert("RGB")
result = model.predict(im, imgsz=640, conf=0.25)[0]
for box in result.boxes:
    print(model.names[int(box.cls)], round(float(box.conf), 3), box.xyxy[0].tolist())
result.save("circuit_pred.jpg")

The training data was converted to grayscale, so convert inputs to grayscale before inference as shown. The .pt needs an ultralytics version that supports YOLO26 (8.4.x). To fetch the files without Python: hf download KaanAydinli/logicdrawer-yolo26s --local-dir logicdrawer-yolo26s.

ONNX

logicdrawer_yolo26s.onnx returns final detections, no NMS needed.

  • Input images: float32 [1, 3, 640, 640], RGB, values 0 to 1, image letterboxed to 640x640 with aspect ratio preserved and gray (114) padding.
  • Output output0: float32 [1, 300, 6], rows of x1, y1, x2, y2, confidence, class_id in letterboxed pixel coordinates, sorted by confidence. Keep rows above your confidence threshold, subtract the padding offsets and divide by the resize scale to map boxes back to the original image.
import numpy as np, onnxruntime as ort, cv2
from huggingface_hub import hf_hub_download
from PIL import Image, ImageOps

im = np.array(ImageOps.exif_transpose(Image.open("circuit.jpg")).convert("L").convert("RGB"))
h, w = im.shape[:2]
r = 640 / max(h, w)
nh, nw = round(h * r), round(w * r)
canvas = np.full((640, 640, 3), 114, np.uint8)
top, left = (640 - nh) // 2, (640 - nw) // 2
canvas[top:top + nh, left:left + nw] = cv2.resize(im, (nw, nh))
x = canvas.transpose(2, 0, 1)[None].astype(np.float32) / 255.0

onnx_path = hf_hub_download("KaanAydinli/logicdrawer-yolo26s", "logicdrawer_yolo26s.onnx")
session = ort.InferenceSession(onnx_path)
det = session.run(None, {"images": x})[0][0]
names = ["AND", "NAND", "NOR", "NOT", "OR", "XNOR", "XOR"]
for x1, y1, x2, y2, conf, cls in det[det[:, 4] > 0.25]:
    box = [(x1 - left) / r, (y1 - top) / r, (x2 - left) / r, (y2 - top) / r]
    print(names[int(cls)], round(float(conf), 3), [round(float(v), 1) for v in box])

Data

1,495 grayscale images of logic gate drawings, longest side 640 px, split 1,047 / 224 / 224 (train / valid / test) with 16,868 boxes. The set mixes phone photos of hand-drawn circuits with scanned and rendered schematics; hand-drawn photos are about 8 % of the training images. Per-class, per-source and box-size statistics are in dataset_stats.json.

Training recipe

yolo26s.yaml, pretrained=False, imgsz 640, batch 16, 400 epochs planned with early-stop patience 100, AMP fp16, seed 0, deterministic. Optimizer MuSGD (Muon for conv and matrix weights, Nesterov SGD for the rest), lr0 0.01 with linear decay, momentum 0.9, weight decay 5e-4, warmup 3 epochs. Loss gains box 7.5, cls 0.5, dfl 1.5.

Augmentation: mosaic 1.0, scale ±0.5, translate 0.1, rotation ±5°, horizontal flip 0.5, brightness (hsv_v) 0.4, hue and saturation 0 (grayscale input), no mixup / cutmix / copy-paste. Every setting used is in training_args.yaml.

Training stopped at epoch 235 because validation fitness had not improved for 100 epochs; the best checkpoint is from epoch 135. mAP50 passed 0.95 by epoch 15.

Results

Metrics from best.pt at 640 px. Validation and test splits have the same source mix as train.

SplitImagesBoxesPrecisionRecallmAP50mAP75mAP50-95
valid2242,9540.9520.9800.9900.8420.699
test2242,7230.9150.9600.9610.7850.659

Per-class test AP:

ClassAP50AP50-95ClassAP50AP50-95
AND0.9750.716OR0.9640.627
NAND0.9630.660XNOR0.9300.661
NOR0.9720.621XOR0.9760.666
NOT0.9490.663

Test split by image type:

Image typeImagesmAP50mAP50-95
hand-drawn photos410.9330.667
printed or rendered schematics1830.9610.659

Errors are mostly missed gates in dense scans and background false positives.

results test confusion matrix

Sample predictions

Figure 1

Figure 1

Figure 2

Figure 2

Limitations

  • Hand-drawn photos are a small part of the data and the test photos come from few drawing sessions, so the hand-drawn numbers are optimistic. On messy drawings the model confuses bubbled and non-bubbled variants (AND vs NAND, OR vs NOR) and confidences drop to 0.3 to 0.7.
  • Box tightness (mAP50-95 about 0.66) is limited by the many ~30 px gates and by inconsistent box padding between annotation sources.
  • Inputs are expected in grayscale; colour drawings should be converted first.
  • Gates drawn right-to-left or bottom-to-top are rare in the data; horizontal flip augmentation was used, vertical flip was not.
  • Detects gate symbols only. Wires, junctions, inputs and outputs are not modelled.

Files

  • logicdrawer_yolo26s.pt, logicdrawer_yolo26s.onnx: weights.
  • training_args.yaml: every Ultralytics training argument used.
  • metadata.json: environment, model, training curve, valid / test / per-source metrics, confusion matrices, speed.
  • dataset_stats.json: split, class, box-size and source-group statistics.
  • figures/: training curves, PR curves, confusion matrix, label distribution, two sample photos with their annotated predictions.

Environment

Python 3.12.3, torch 2.11.0+cu128, ultralytics 8.4.146, NVIDIA GeForce RTX 4050 Laptop GPU (6 GB), Intel i7-13700H.

License and attribution

Model weights are released under AGPL-3.0, following the Ultralytics license. Trained by KaanAydinli for the LogicDrawer project.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · ultralytics

Нельзя запустить

Модели Ultralytics YOLO требуют отдельного рантайма.

Ревизия весов
dda29c2

0 моделей