DeepLabv3

Ein Netz für semantische Segmentierung, das Features parallel bei mehreren Dilatationsraten poolt (Atrous Spatial Pyramid Pooling), bevor es jedes Pixel klassifiziert. LibreYOLO liefert es ausschließlich für die semantische Segmentierung aus.

Aufgaben
semantic
Größen
Installation
pip install libreyolo
Supportstufe
Nur Inferenz, seit v. Nur Vorhersage, Validierung und Export. Trainingsfunktionen sind nicht verfügbar.
Upstream
DeepLabv3 von PyTorch, BSD-3-Clause. Publikation, Quelle
Lizenzen
Code BSD-3-Clause, Gewichte BSD-3-Clause. Kommerzielle Nutzung

Installation

DeepLabv3 braucht kein optionales Extra. Alles, was es importiert, steckt in der Basisinstallation.

bash
pip install libreyolo

Vorhersage

Die Gewichte werden beim ersten Aufruf von Hugging Face geladen und lokal zwischengespeichert. Das Suffix -sem im Dateinamen ist für diese Familie Pflicht.

Python
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreDeepLabv3r50-sem.pt")result = model(SAMPLE_IMAGE, save=True) mask = result.semantic_maskprint(mask.data.shape)   # (H, W) Klassen-IDsprint(mask.classes)      # sortierte Klassen-IDs im Bild
CLI
libreyolo predict model=LibreDeepLabv3r50-sem.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True

Die semantische Segmentierung liefert eine Klassen-ID pro Pixel und keine Boxen, deshalb trägt result.semantic_mask ein (H, W)-Array in .data und die Liste der im Bild vorhandenen Klassen-IDs in .classes. conf, iou und max_det werden aus Gründen der API-Parität akzeptiert, haben aber keine Wirkung: Das Modell weist jedem Pixel per Argmax eine Klasse zu, ohne Schwellenwert für die Confidence und ohne NMS-Schritt. Siehe Vorhersage für Quellen, Streaming und den Umgang mit Ergebnissen.

Varianten

Drei Backbones: dilatiertes ResNet-50, dilatiertes ResNet-101 und dilatiertes MobileNetV3-Large. Das ist DeepLabv3, nicht DeepLabv3+, es gibt also keine Decoder-Stufe und keine CRF-Verfeinerung, passend zur Implementierung von torchvision statt zum Referenzcode des Papers selbst.

LibreYOLO trainiert DeepLabv3 nicht: train() löst für diese Familie NotImplementedError aus, was die Support-Stufe weiter oben als reine Inferenz kennzeichnet. Die drei veröffentlichten Checkpoints sind torchvisions eigene Gewichte, auf COCO mit den VOC-Labels trainiert und für den Loader von LibreYOLO konvertiert.

Validierung

val() liefert metrics/mIoU und metrics/pixel_accuracy, gemessen an jedem Datensatz in dem Format, mit dem du trainiert hast.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreDeepLabv3r50-sem.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mIoU"])print(metrics["metrics/pixel_accuracy"])
CLI
libreyolo val model=LibreDeepLabv3r50-sem.pt data=my-dataset.yaml

Export

AufgabeONNXTorchScriptExecuTorchTensorRTOpenVINOPaddleMNNRKNNncnnTFLiteCoreMLCore AI
semanticsemantic to ONNX: unterstütztsemantic to TorchScript: unterstütztsemantic to ExecuTorch: nicht unterstütztsemantic to TensorRT: unterstütztsemantic to OpenVINO: unterstütztsemantic to Paddle: nicht unterstütztsemantic to MNN: nicht unterstütztsemantic to RKNN: nicht unterstütztsemantic to ncnn: nicht unterstütztsemantic to TFLite: nicht unterstütztsemantic to CoreML: nicht unterstütztsemantic to Core AI: nicht unterstützt

Ein exportiertes Artefakt lädt über LibreYOLO() anhand seiner Dateiendung wieder, eine .onnx- oder .engine-Datei verhält sich also wie ein Checkpoint und liefert dieselben Results. Export listet die Argumente auf, die jedes Format akzeptiert.

Python
from libreyolo import LibreYOLO model = LibreYOLO("LibreDeepLabv3r50-sem.pt")model.export(format="onnx")model.export(format="tensorrt", half=True)
CLI
libreyolo export model=LibreDeepLabv3r50-sem.pt format=onnxlibreyolo export model=LibreDeepLabv3r50-sem.pt format=tensorrt half=True
Die exportierte Datei nutzen
from libreyolo import LibreYOLO, SAMPLE_IMAGE # Die Factory entscheidet anhand der Dateiendung: ein exportiertes# Artefakt lädt wie jeder Checkpoint und liefert dasselbe Results.model = LibreYOLO("LibreDeepLabv3r50-sem.onnx")result = model(SAMPLE_IMAGE) print(result.semantic_mask.data.shape)

Checkpoints

Jede veröffentlichte Gewichtsdatei für diese Familie.

DateiEingabe (px)Lizenz der Gewichte
semantic
LibreDeepLabv3r50-sem.ptbsd-3-clause
LibreDeepLabv3r101-sem.ptbsd-3-clause
LibreDeepLabv3mv3-sem.ptbsd-3-clause

Jede oben aufgeführte Datei ist heute in der LibreYOLO-Organisation verfügbar und wird bei der ersten Verwendung heruntergeladen.

Lizenzierung

Prüfe die Lizenz im Hugging-Face-Repository der konkreten Gewichte, die du herunterlädst. Jeder Checkpoint in der LibreYOLO-Organisation hat eine Lizenz, und sie ist innerhalb einer Familie nicht immer gleich. Dieses Repository ist die maßgebliche Quelle. Die Zusammenfassung unten beschreibt den Stand bei der letzten Verifizierung dieser Seite.

Dies ist eine Beschreibung der beteiligten Lizenzen und keine Rechtsberatung. Wenn die Antwort kommerziell relevant ist, lies die Lizenzen selbst und hole eigenen Rechtsrat ein.

Originalarbeit
DeepLabv3, PyTorch
Upstream-Lizenz
BSD-3-Clause
LibreYOLO-Code
MIT
Gewichte
BSD-3-Clause, erneut unter huggingface.co/LibreYOLO veröffentlicht
Einordnung
BSD-3-Clause is a permissive license, so this code and these weights can be used in commercial and closed-source products. It asks you to keep the copyright notice, license text and a non-endorsement clause with any copy you redistribute. LibreYOLO's inference graph is torchvision's ASPP head over its ResNet-50, ResNet-101 and MobileNetV3-Large backbones; it is DeepLabv3, not DeepLabv3+, so there is no decoder or CRF, and the paper's training-only auxiliary FCN classifier is excluded. The three published checkpoints are torchvision's official COCO-with-VOC-label weights; their separate LibreYOLO Hugging Face mirrors carry BSD-3-Clause on an implied basis disclosed by torchvision rather than an explicit checkpoint-specific grant, and torchvision's own documentation notes that pretrained-model terms can depend on the training data, leaving that determination to the user.

Mit LibreYOLO v1.5.0 verifiziert. Supporttabellen, Checkpoints und Benchmarkwerte auf dieser Seite werden aus der veröffentlichten Bibliothek und den publizierten Gewichten generiert und nicht von Hand geschrieben.