🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。

クラス Model

    • フィールドの詳細

      • nativeObj

        protected final long nativeObj
    • コンストラクタの詳細

      • Model

        protected Model​(long addr)
      • Model

        public Model​(java.lang.String model,
                     java.lang.String config)
        Create model from deep learning network represented in one of the supported formats. An order of model and config arguments does not matter.
        引数:
        model - 学習済み重みを含むバイナリファイル。
        config - ネットワーク構成を含むテキストファイル。
      • Model

        public Model​(java.lang.String model)
        Create model from deep learning network represented in one of the supported formats. An order of model and config arguments does not matter.
        引数:
        model - 学習済み重みを含むバイナリファイル。
      • Model

        public Model​(Net network)
        Create model from deep learning network.
        引数:
        network - Net オブジェクト。
    • メソッドの詳細

      • getNativeObjAddr

        public long getNativeObjAddr()
      • __fromPtr__

        public static Model __fromPtr__​(long addr)
      • setInputSize

        public Model setInputSize​(Size size)
        Set input size for frame.
        引数:
        size - 新しい入力サイズ。 覚え書き: 新しいblobの形状が0未満の場合、フレームサイズは変更されない。
        戻り値:
        自動生成
      • setInputSize

        public Model setInputSize​(int width,
                                  int height)
        引数:
        width - 新しい入力幅。
        height - 新しい入力高さ。
        戻り値:
        自動生成
      • setInputMean

        public Model setInputMean​(Scalar mean)
        Set mean value for frame.
        引数:
        mean - 各チャンネルから減算される平均値を持つScalar。
        戻り値:
        自動生成
      • setInputScale

        public Model setInputScale​(Scalar scale)
        Set scalefactor value for frame.
        引数:
        scale - フレーム値に対する乗数。
        戻り値:
        自動生成
      • setInputCrop

        public Model setInputCrop​(boolean crop)
        Set flag crop for frame.
        引数:
        crop - リサイズ後に画像を切り抜くかどうかを示すフラグ。
        戻り値:
        自動生成
      • setInputSwapRB

        public Model setInputSwapRB​(boolean swapRB)
        Set flag swapRB for frame.
        引数:
        swapRB - 最初と最後のチャンネルを入れ替えることを示すフラグ。
        戻り値:
        自動生成
      • setOutputNames

        public Model setOutputNames​(java.util.List<java.lang.String> outNames)
        Set output names for frame.
        引数:
        outNames - 出力レイヤの名前。
        戻り値:
        自動生成
      • setInputParams

        public void setInputParams​(double scale,
                                   Size size,
                                   Scalar mean,
                                   boolean swapRB,
                                   boolean crop)
        Set preprocessing parameters for frame.
        引数:
        size - 新しい入力サイズ。
        mean - 各チャンネルから減算される平均値を持つScalar。
        scale - フレーム値に対する乗数。
        swapRB - 最初と最後のチャンネルを入れ替えることを示すフラグ。
        crop - リサイズ後に画像を切り抜くかどうかを示すフラグ。 blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )
      • setInputParams

        public void setInputParams​(double scale,
                                   Size size,
                                   Scalar mean,
                                   boolean swapRB)
        Set preprocessing parameters for frame.
        引数:
        size - 新しい入力サイズ。
        mean - 各チャンネルから減算される平均値を持つScalar。
        scale - フレーム値に対する乗数。
        swapRB - 最初と最後のチャンネルを入れ替えることを示すフラグ。 blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )
      • setInputParams

        public void setInputParams​(double scale,
                                   Size size,
                                   Scalar mean)
        Set preprocessing parameters for frame.
        引数:
        size - 新しい入力サイズ。
        mean - 各チャンネルから減算される平均値を持つScalar。
        scale - フレーム値に対する乗数。 blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )
      • setInputParams

        public void setInputParams​(double scale,
                                   Size size)
        Set preprocessing parameters for frame.
        引数:
        size - 新しい入力サイズ。
        scale - フレーム値に対する乗数。 blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )
      • setInputParams

        public void setInputParams​(double scale)
        Set preprocessing parameters for frame.
        引数:
        scale - フレーム値に対する乗数。 blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )
      • setInputParams

        public void setInputParams()
        Set preprocessing parameters for frame. blob(n, c, y, x) = scale * resize( frame(y, x, c) ) - mean(c) )
      • predict

        public void predict​(Mat frame,
                            java.util.List<Mat> outs)
        Given the input frame, create input blob, run net and return the output blobs.
        引数:
        outs - 確保された出力blob。計算結果を格納する。
        frame - 自動生成
      • setPreferableBackend

        public Model setPreferableBackend​(int backendId)
      • setPreferableTarget

        public Model setPreferableTarget​(int targetId)
      • enableWinograd

        public Model enableWinograd​(boolean useWinograd)