DexiNed
DexiNed(Dense Extreme Inception Network)は、1枚のRGB画像から密なエッジ確率マップを予測する畳み込みネットワークです。LibreYOLOはそのアーキテクチャをエッジ検出専用でラップし、チェックポイントはライブラリに付属しません。
- タスク
- edge
- サイズ
- b at 352 px
- インストール
pip install libreyolo- サポートティア
- 推論のみ、v以降。推論、検証、エクスポートのみです。学習機能は対象外です。
- ライセンス
- コード:MIT、重み:MIT。商用利用
インストール
DexiNedに任意の追加パッケージは必要ありません。インポートするものはすべて基本 インストールに含まれます。
pip install libreyolo推論
LibreYOLOはDexiNedチェックポイントを提供しません。公式に公開された重みはBIPEDで学習されており、
公開済みのデータセット規約が利用を非商用目的に制限するため、LibreYOLOはミラーしません。
ライセンスを保有するチェックポイントをweights/convert_dexined_weights.pyで変換してください。この
scriptは、LibreYOLOが直接読み込めるファイルを書き出す前に、テンソルkeyとランタイムアーキテクチャを照合します。
python weights/convert_dexined_weights.py upstream.pth weights/LibreDexiNedb-edge.pt --verifyfrom libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("weights/LibreDexiNedb-edge.pt")result = model(SAMPLE_IMAGE, save=True) edges = result.edgesprint(edges.array.shape) # (H, W) float32、範囲[0, 1]print(edges.binary(0.5).sum()) # しきい値処理後のエッジピクセル数libreyolo predict model=weights/LibreDexiNedb-edge.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True結果はresult.edgesに入ります。[0, 1]範囲の(H, W)形状のfloat32配列で、
.binary(threshold)はbooleanのエッジマスクを返します。ボックスはないため、conf、iou、
max_detに効果はありません。入力ソース、ストリーミング、結果の処理については
推論を参照してください。
バリアント
DexiNedはLibreYOLOで1サイズを提供します。LibreYOLOのベンチマークharnessはこのファミリーを 測定していないため、比較できる公開数値はありません。
検証
val()は、対応するエッジデータセットに対してBSDS形式のODSおよびOIS F-measureを報告します。
画像と同じstemのエッジマップを並べ、任意の有効性マスクによりpaddingされたピクセルを除外できます。
imgszはネットワークのdownsample strideで割り切れる必要があり、そうでない場合はLibreYOLOが
明確なエラーを発生させます。
from libreyolo import LibreYOLO model = LibreYOLO("weights/LibreDexiNedb-edge.pt")metrics = model.val(data="my-dataset.yaml", imgsz=352) print(metrics["metrics/ODS"]) # データセット全体で最適なF-measureprint(metrics["metrics/OIS"]) # 画像ごとに最適なF-measurelibreyolo val model=weights/LibreDexiNedb-edge.pt data=my-dataset.yaml imgsz=352エクスポート
| タスク | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| edge | edge to ONNX:対応 | edge to TorchScript:対応 | edge to ExecuTorch:対応 | edge to TensorRT:対応 | edge to OpenVINO:対応 | edge to Paddle:非対応 | edge to MNN:非対応 | edge to RKNN:非対応 | edge to ncnn:非対応 | edge to TFLite:対応 | edge to CoreML:非対応 | edge to Core AI:非対応 |
エッジのエクスポートは固定解像度、バッチ1のランタイム契約を使います。dynamicと1以外の
batchは拒否され、エクスポートしたグラフは1個のfused probability mapを出力します。
エクスポートした成果物はファイル接尾辞に基づいてLibreYOLO()から再読み込みされます。そのため、
.onnxファイルはチェックポイントと同様に動作し、同じResultsを返します。
from libreyolo import LibreYOLO model = LibreYOLO("weights/LibreDexiNedb-edge.pt")model.export(format="onnx", imgsz=352)model.export(format="tensorrt", imgsz=352, half=True)libreyolo export model=weights/LibreDexiNedb-edge.pt format=onnx imgsz=352libreyolo export model=weights/LibreDexiNedb-edge.pt format=tensorrt imgsz=352 half=Truefrom libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("weights/LibreDexiNedb-edge.onnx")result = model(SAMPLE_IMAGE) print(result.edges.array.shape)ライセンス
ダウンロードする特定の重みについて、Hugging Faceリポジトリのライセンスを確認してください。LibreYOLO orgの各チェックポイントにはライセンスが付与されており、同じファミリー内でも常に同一とは限りません。そのリポジトリが正式な情報源です。以下の概要は、このページを最後に検証した時点で適用されていた内容を示します。
これは関連するライセンスの説明であり、法的助言ではありません。商用上重要な場合は、自分でライセンスを読み、専門家の助言を受けてください。
- 原著作物
- DexiNed, Xavier Soria
- アップストリームのライセンス
- MIT
- アップストリームのソース
- github.com/xavysp/DexiNed
- LibreYOLOのコード
- MIT
- 重み
- MIT、著者が配布。LibreYOLOではホストもミラーもしていません。
- 解釈
- MIT is a permissive license, so the DexiNed architecture LibreYOLO ports can be used in commercial and closed-source products, with the license text and copyright notice kept alongside any copy you redistribute. LibreYOLO ships no checkpoint for this family: the officially released weights are trained on BIPED, whose published dataset terms restrict use to non-commercial purposes, and mirroring them would carry that restriction into a nominally MIT-licensed download. Convert a checkpoint you hold a license for with `weights/convert_dexined_weights.py`; the MIT code license does not change the terms attached to whatever checkpoint you convert.
LibreYOLOはDexiNedチェックポイントを公開しません。LibreYOLO組織の下には何もミラーされません。
代わりに、ライセンスを保有するチェックポイントをweights/convert_dexined_weights.pyで変換してください。
引用
@INPROCEEDINGS {xsoria2020dexined,
author = {X. Soria and E. Riba and A. Sappa},
booktitle = {2020 IEEE Winter Conference on Applications of Computer Vision (WACV)},
title = {Dense Extreme Inception Network: Towards a Robust CNN Model for Edge Detection},
year = {2020},
volume = {},
issn = {},
pages = {1912-1921},
keywords = {image edge detection;convolution;training;feeds;machine learning;task analysis;kernel},
doi = {10.1109/WACV45572.2020.9093290},
url = {https://doi.ieeecomputersociety.org/10.1109/WACV45572.2020.9093290},
publisher = {IEEE Computer Society},
address = {Los Alamitos, CA, USA},
month = {mar}
}
@article{soria2023dexined_ext,
title = {Dense extreme inception network for edge detection},
journal = {Pattern Recognition},
volume = {139},
pages = {109461},
year = {2023},
issn = {0031-3203},
doi = {https://doi.org/10.1016/j.patcog.2023.109461},
url = {https://www.sciencedirect.com/science/article/pii/S0031320323001619},
author = {Xavier Soria and Angel Sappa and Patricio Humanante and Arash Akbarinia},
keywords = {Edge detection, Deep learning, CNN, Contour detection, Boundary detection, Segmentation}
}著者によるgithub.com/xavysp/DexiNed#citationの引用ブロックからコピーしています。