iinfer (Image Inference Application)
- onnx又はmmlabフォーマットのAIモデルファイルを実行するアプリケーションです。
- ドキュメントはこちら。
- このアプリケーションはcmdboxをベースにしています。
- iinferを使用することで、AIモデルを簡単に実行することが出来ます。
- 動作確認したモデルは動作確認済みモデルに記載しています。
- 主なAIタスクは、画像分類、物体検知、領域検知、顔検知、顔認識です。
- 複数の
iinferコマンドの入出力をつなげる、パイプライン処理を行うことが出来ます。 - GUIモードを使用することで、
iinferコマンド操作を簡単に行うことが出来ます。
iinferの動作イメージ
- iinfer client は imageファイル や camera から画像を取得し、 推論結果 predict.json を出力します。
- iinfer server は推論を行うサーバーです。 iinfer client からの要求に応えて、推論結果を iinfer client に返します。
- iinfer server は予め ai model をロードしておくことで、推論を高速化します。
- iinfer client と iinfer server は Redis 経由で通信します。
- iinfer server と Redis は dockerコンテナ を使用して起動させることが出来ます。
インストール方法
- 次のコマンドで iinfer をインストールしてください。
- また、Docker 版の Redis サーバーもインストールしてください。
- 詳細なインストール方法は こちら を参照してください。
docker run -p 6379:6379 --name redis -e REDIS_PASSWORD=password -it ubuntu/redis:latest
pip install iinfer
iinfer -v
- WebモードでSAMLを使用する場合、依存関係のあるモジュールをインストールしてください。
pip install iinfer[saml]
apt-get install -y pkg-config libxml2-dev libxmlsec1-dev libxmlsec1-openssl build-essential libopencv-dev
- Webモードで
--agent useを使用する場合、依存関係のあるモジュールをインストールしてください。
pip install "pydantic>=2.0.0,<3.0.0"
pip install "fastmcp>=2.14.0" "mcp>=1.10.0,<2.0.0"
pip install "google-adk>=1.21.0" "litellm"
iinferの使用方法
iinferを使用するには、次のコマンドを実行します:
- guiモードで利用する場合:
iinfer -m gui -c start
-
コマンドモードで利用する場合
- AIモデルのデプロイ:
# 画像AIモデルのデプロイ # 推論タイプはモデルのAIタスクやアルゴリズムに合わせて指定する。指定可能なキーワードは"iinfer -m client -c predict_type_list"コマンド参照。 iinfer -m client -c deploy -n <任意のモデル名> -f \ --model_file <モデルファイル> \ --model_conf_file <モデル設定ファイル> \ --predict_type <推論タイプ> \ --label_file <ラベルファイル> # デプロイされている画像AIモデルの一覧 iinfer -m client -c deploy_list -f
- AIモデルのセッションを開始:
# 画像AIモデルを起動させて推論可能な状態に(セッションを確保)する # use_trackを指定するとObjectDetectionタスクの結果に対して、MOT(Multi Object Tracking)を実行しトラッキングIDを出力する。 iinfer -m client -c start -n <モデル名> -f \ --use_track
- 推論を実行:
# 推論を実行する # output_previewを指定するとimshowで推論結果画像を表示する(GUI必要) iinfer -m client -c predict -n <モデル名> -f \ -i <推論させる画像ファイル> \ -o <推論結果の画像ファイル> \ --output_preview # カメラキャプチャー画像を元に推論を実行し、クラススコアが0.8以上の物体のみを検出する # --stdin --image_type capture で標準入力のキャプチャー画像を推論する iinfer -m client -c capture | \ iinfer -m client -c predict -n <モデル名> \ --stdin \ --image_type capture \ --nodraw | \ iinfer -m postprocess -c det_filter -f -P \ --stdin \ --score_th 0.8
- AIモデルのセッションを開放:
# 画像AIモデルを停止させてセッションを開放 iinfer -m client -c stop -n <モデル名> -f
Lisence
This project is licensed under the MIT License, see the LICENSE file for details
Metadata
Release files for iinfer 0.13.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iinfer-0.13.3.tar.gz | 693.0 kB | Without provenance | Details for iinfer-0.13.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iinfer-0.13.3-py3-none-any.whl | Python 3 | none | any | Details for iinfer-0.13.3-py3-none-any.whl |
Total release size: 1.9 MB
Release files / iinfer-0.13.3.tar.gz
| Download URL | iinfer-0.13.3.tar.gz |
|---|---|
| Size | 693.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b93f1c6e6effd8198abe2099b23b59f461a69e7557cd3b88d86d5eaf529e0910
|
|
BLAKE2b-256 checksum How to use checksums |
cb05d63f1f6ea829def78268b0d92712b1fcf52a828db7cd7186f7e9f80d014d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.8
|
Release files / iinfer-0.13.3-py3-none-any.whl
| Download URL | iinfer-0.13.3-py3-none-any.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8d044f243b12f77b4e24cb89f8146f6b1c67998ac84e467001f46224bd2e978f
|
|
BLAKE2b-256 checksum How to use checksums |
1b9649a134edf7c34b2e4e3e67ba5eda2feb87821a4feae7e40207351cd5435b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.8
|
Security for iinfer 0.13.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.