EfficientDet
EfficientDetはEfficientNetバックボーンと、反復するbi-directional feature pyramid network(BiFPN)を組み合わせ、5種類のサイズにわたって深さ、幅、解像度を同時にスケーリングします。LibreYOLOは推論専用の検出器として提供します。
- タスク
- detection
- サイズ
- インストール
pip install libreyolo- サポートティア
- 推論のみ、v以降。推論、検証、エクスポートのみです。学習機能は対象外です。
- ライセンス
- コード:Apache-2.0、重み:Apache-2.0。商用利用
インストール
EfficientDetに任意の追加パッケージは必要ありません。インポートするものはすべて基本 インストールに含まれます。
pip install libreyolo推論
重みは初回使用時にHugging Faceからダウンロードされ、ローカルにキャッシュされます。
from libreyolo import LibreYOLO, SAMPLE_IMAGE model = LibreYOLO("LibreEfficientDetd0.pt")result = model(SAMPLE_IMAGE, save=True) for box in result.boxes: print(box.cls, box.conf, box.xyxy)libreyolo predict model=LibreEfficientDetd0.pt source=https://raw.githubusercontent.com/LibreYOLO/libreyolo/release/libreyolo/assets/parkour.jpg save=True返されるResultsオブジェクトはすべてのファミリーで共通のため、別の検出器への切り替えは
1行の変更だけで済みます。EfficientDetはアンカーベースの候補をデコードした後、クラス単位の
non-maximum suppressionを実行します。そのため、conf、iou、max_detはすべて実際に
効果があります。入力ソース、ストリーミング、結果の処理については推論を参照してください。
バリアント
サイズはD0〜D4の5種類です。サイズを1段階上げるたびに、より大きなEfficientNetバックボーンと、 より深く幅広いBiFPNおよび深い推論ヘッドを組み合わせます。そのため、論文のcompound-scaling 規則に従ってパラメータ数と計算量が同時に増えます。
検証
val()は、学習に使った形式の任意のデータセットに対して測定した適合率、再現率、mAP 50、
mAP 50-95を含むmetrics/キーの辞書を返します。
from libreyolo import LibreYOLO model = LibreYOLO("LibreEfficientDetd0.pt")metrics = model.val(data="my-dataset.yaml") print(metrics["metrics/mAP50-95"])print(metrics["metrics/mAP50"])libreyolo val model=LibreEfficientDetd0.pt data=my-dataset.yamlエクスポート
| タスク | ONNX | TorchScript | ExecuTorch | TensorRT | OpenVINO | Paddle | MNN | RKNN | ncnn | TFLite | CoreML | Core AI |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Detection | Detection to ONNX:対応 | Detection to TorchScript:対応 | Detection to ExecuTorch:対応 | Detection to TensorRT:対応 | Detection to OpenVINO:対応 | Detection to Paddle:非対応 | Detection to MNN:非対応 | Detection to RKNN:非対応 | Detection to ncnn:対応 | Detection to TFLite:非対応 | Detection to CoreML:非対応 | Detection to Core AI:非対応 |
エクスポートした成果物はファイル接尾辞に基づいてLibreYOLO()から再読み込みされます。そのため、
.onnxまたは.engineファイルはチェックポイントと同様に動作し、同じResultsを返します。
from libreyolo import LibreYOLO model = LibreYOLO("LibreEfficientDetd0.pt")model.export(format="onnx")model.export(format="tensorrt", half=True)libreyolo export model=LibreEfficientDetd0.pt format=onnxlibreyolo export model=LibreEfficientDetd0.pt format=tensorrt half=Truefrom libreyolo import LibreYOLO # ファクトリがファイル接尾辞で振り分けるため、エクスポートした成果物も# 通常のチェックポイントと同様に読み込まれ、同じResultsオブジェクトを返すmodel = LibreYOLO("LibreEfficientDetd0.onnx")result = model(SAMPLE_IMAGE) print(result.boxes.xyxy)チェックポイント
このファミリーで公開されているすべての重みファイルです。
| ファイル | 入力(px) | 重みのライセンス |
|---|---|---|
| Detection | ||
| LibreEfficientDetd0.pt | apache-2.0 | |
| LibreEfficientDetd1.pt | apache-2.0 | |
| LibreEfficientDetd2.pt | apache-2.0 | |
| LibreEfficientDetd3.pt | apache-2.0 | |
| LibreEfficientDetd4.pt | apache-2.0 | |
上記のすべてのファイルは現在LibreYOLO orgにあり、初回使用時にダウンロードされます。
ライセンス
ダウンロードする特定の重みについて、Hugging Faceリポジトリのライセンスを確認してください。LibreYOLO orgの各チェックポイントにはライセンスが付与されており、同じファミリー内でも常に同一とは限りません。そのリポジトリが正式な情報源です。以下の概要は、このページを最後に検証した時点で適用されていた内容を示します。
これは関連するライセンスの説明であり、法的助言ではありません。商用上重要な場合は、自分でライセンスを読み、専門家の助言を受けてください。
- 原著作物
- EfficientDet, Google Research
- アップストリームのライセンス
- Apache-2.0
- アップストリームのソース
- github.com/rwightman/efficientdet-pytorch
- LibreYOLOのコード
- MIT
- 重み
- Apache-2.0、huggingface.co/LibreYOLOで再公開
- 解釈
- Apache-2.0 is a permissive license, so these weights can be used in commercial and closed-source products. It asks you to keep its license text and attribution notices with any copy of the weights you redistribute, and it grants a patent license. It places no obligation on your own application code. LibreYOLO's D0-D4 checkpoints are converted from Google's official TensorFlow-trained release assets through the Apache-2.0 rwightman/efficientdet-pytorch project; those release assets carry no separate per-checkpoint license, so redistribution here rests on Apache-2.0 implied by the releasing project, the same basis rwightman/efficientdet-pytorch itself uses for its own converted weights.
LibreYOLOのD0〜D4チェックポイントは、Apache-2.0のrwightman/efficientdet-pytorch プロジェクトを通じて変換されています。このプロジェクト自体は、google/automlの公式TensorFlow 学習済み重みを学習済みテンソルを変更せずにミラーします。LGPLライセンスの zylo117/Yet-Another-EfficientDet-Pytorchプロジェクトのソースは参照も使用もしていません。