🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.dnn
クラス Dnn
- java.lang.Object
-
- org.opencv.dnn.Dnn
-
public class Dnn extends java.lang.Object
-
-
フィールドの要約
フィールド Modifier and Type Field Description static intDNN_BACKEND_CANNstatic intDNN_BACKEND_CUDAstatic intDNN_BACKEND_DEFAULTstatic intDNN_BACKEND_HALIDEstatic intDNN_BACKEND_INFERENCE_ENGINEstatic intDNN_BACKEND_OPENCVstatic intDNN_BACKEND_TIMVXstatic intDNN_BACKEND_VKCOMstatic intDNN_BACKEND_WEBNNstatic intDNN_LAYOUT_NCDHWstatic intDNN_LAYOUT_NCHWstatic intDNN_LAYOUT_NDstatic intDNN_LAYOUT_NDHWCstatic intDNN_LAYOUT_NHWCstatic intDNN_LAYOUT_PLANARstatic intDNN_LAYOUT_UNKNOWNstatic intDNN_PMODE_CROP_CENTERstatic intDNN_PMODE_LETTERBOXstatic intDNN_PMODE_NULLstatic intDNN_TARGET_CPUstatic intDNN_TARGET_CPU_FP16static intDNN_TARGET_CUDAstatic intDNN_TARGET_CUDA_FP16static intDNN_TARGET_FPGAstatic intDNN_TARGET_HDDLstatic intDNN_TARGET_MYRIADstatic intDNN_TARGET_NPUstatic intDNN_TARGET_OPENCLstatic intDNN_TARGET_OPENCL_FP16static intDNN_TARGET_VULKANstatic intSoftNMSMethod_SOFTNMS_GAUSSIANstatic intSoftNMSMethod_SOFTNMS_LINEAR
-
コンストラクタの要約
コンストラクタ Constructor Description Dnn()
-
メソッドの要約
全メソッド 静的メソッド 具象メソッド 非推奨メソッド Modifier and Type Method Description static MatblobFromImage​(Mat image)Creates 4-dimensional blob from image.static MatblobFromImage​(Mat image, double scalefactor)Creates 4-dimensional blob from image.static MatblobFromImage​(Mat image, double scalefactor, Size size)Creates 4-dimensional blob from image.static MatblobFromImage​(Mat image, double scalefactor, Size size, Scalar mean)Creates 4-dimensional blob from image.static MatblobFromImage​(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB)Creates 4-dimensional blob from image.static MatblobFromImage​(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop)Creates 4-dimensional blob from image.static MatblobFromImage​(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop, int ddepth)Creates 4-dimensional blob from image.static MatblobFromImages​(java.util.List<Mat> images)Creates 4-dimensional blob from series of images.static MatblobFromImages​(java.util.List<Mat> images, double scalefactor)Creates 4-dimensional blob from series of images.static MatblobFromImages​(java.util.List<Mat> images, double scalefactor, Size size)Creates 4-dimensional blob from series of images.static MatblobFromImages​(java.util.List<Mat> images, double scalefactor, Size size, Scalar mean)Creates 4-dimensional blob from series of images.static MatblobFromImages​(java.util.List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB)Creates 4-dimensional blob from series of images.static MatblobFromImages​(java.util.List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop)Creates 4-dimensional blob from series of images.static MatblobFromImages​(java.util.List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop, int ddepth)Creates 4-dimensional blob from series of images.static MatblobFromImagesWithParams​(java.util.List<Mat> images)Creates 4-dimensional blob from series of images with given params.static voidblobFromImagesWithParams​(java.util.List<Mat> images, Mat blob)static voidblobFromImagesWithParams​(java.util.List<Mat> images, Mat blob, Image2BlobParams param)static MatblobFromImagesWithParams​(java.util.List<Mat> images, Image2BlobParams param)Creates 4-dimensional blob from series of images with given params.static MatblobFromImageWithParams​(Mat image)Creates 4-dimensional blob from image with given params.static voidblobFromImageWithParams​(Mat image, Mat blob)static voidblobFromImageWithParams​(Mat image, Mat blob, Image2BlobParams param)static MatblobFromImageWithParams​(Mat image, Image2BlobParams param)Creates 4-dimensional blob from image with given params.static java.util.List<java.lang.Integer>getAvailableTargets​(int be)static java.lang.StringgetInferenceEngineBackendType()Deprecated.static java.lang.StringgetInferenceEngineCPUType()Returns Inference Engine CPU type.static java.lang.StringgetInferenceEngineVPUType()Returns Inference Engine VPU type.static voidimagesFromBlob​(Mat blob_, java.util.List<Mat> images_)Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure (std::vector<cv::Mat>).static voidNMSBoxes​(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices)Performs non maximum suppression given boxes and corresponding scores.static voidNMSBoxes​(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta)Performs non maximum suppression given boxes and corresponding scores.static voidNMSBoxes​(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)Performs non maximum suppression given boxes and corresponding scores.static voidNMSBoxesBatched​(MatOfRect2d bboxes, MatOfFloat scores, MatOfInt class_ids, float score_threshold, float nms_threshold, MatOfInt indices)Performs batched non maximum suppression on given boxes and corresponding scores across different classes.static voidNMSBoxesBatched​(MatOfRect2d bboxes, MatOfFloat scores, MatOfInt class_ids, float score_threshold, float nms_threshold, MatOfInt indices, float eta)Performs batched non maximum suppression on given boxes and corresponding scores across different classes.static voidNMSBoxesBatched​(MatOfRect2d bboxes, MatOfFloat scores, MatOfInt class_ids, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)Performs batched non maximum suppression on given boxes and corresponding scores across different classes.static voidNMSBoxesRotated​(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices)static voidNMSBoxesRotated​(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta)static voidNMSBoxesRotated​(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)static NetreadNet​(java.lang.String model)Read deep learning network represented in one of the supported formats.static NetreadNet​(java.lang.String model, java.lang.String config)Read deep learning network represented in one of the supported formats.static NetreadNet​(java.lang.String model, java.lang.String config, java.lang.String framework)Read deep learning network represented in one of the supported formats.static NetreadNet​(java.lang.String framework, MatOfByte bufferModel)Read deep learning network represented in one of the supported formats.static NetreadNet​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig)Read deep learning network represented in one of the supported formats.static NetreadNetFromCaffe​(java.lang.String prototxt)Reads a network model stored in <a href="http://caffe.berkeleyvision.org">Caffe</a> framework's format.static NetreadNetFromCaffe​(java.lang.String prototxt, java.lang.String caffeModel)Reads a network model stored in <a href="http://caffe.berkeleyvision.org">Caffe</a> framework's format.static NetreadNetFromCaffe​(MatOfByte bufferProto)Reads a network model stored in Caffe model in memory.static NetreadNetFromCaffe​(MatOfByte bufferProto, MatOfByte bufferModel)Reads a network model stored in Caffe model in memory.static NetreadNetFromDarknet​(java.lang.String cfgFile)Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.static NetreadNetFromDarknet​(java.lang.String cfgFile, java.lang.String darknetModel)Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.static NetreadNetFromDarknet​(MatOfByte bufferCfg)Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.static NetreadNetFromDarknet​(MatOfByte bufferCfg, MatOfByte bufferModel)Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.static NetreadNetFromModelOptimizer​(java.lang.String xml)Load a network from Intel's Model Optimizer intermediate representation.static NetreadNetFromModelOptimizer​(java.lang.String xml, java.lang.String bin)Load a network from Intel's Model Optimizer intermediate representation.static NetreadNetFromModelOptimizer​(MatOfByte bufferModelConfig, MatOfByte bufferWeights)Load a network from Intel's Model Optimizer intermediate representation.static NetreadNetFromONNX​(java.lang.String onnxFile)Reads a network model <a href="https://onnx.ai/">ONNX</a>.static NetreadNetFromONNX​(MatOfByte buffer)Reads a network model from <a href="https://onnx.ai/">ONNX</a> in-memory buffer.static NetreadNetFromTensorflow​(java.lang.String model)Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.static NetreadNetFromTensorflow​(java.lang.String model, java.lang.String config)Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.static NetreadNetFromTensorflow​(MatOfByte bufferModel)Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.static NetreadNetFromTensorflow​(MatOfByte bufferModel, MatOfByte bufferConfig)Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.static NetreadNetFromTFLite​(java.lang.String model)Reads a network model stored in <a href="https://www.tensorflow.org/lite">TFLite</a> framework's format.static NetreadNetFromTFLite​(MatOfByte bufferModel)Reads a network model stored in <a href="https://www.tensorflow.org/lite">TFLite</a> framework's format.static NetreadNetFromTorch​(java.lang.String model)Reads a network model stored in <a href="http://torch.ch">Torch7</a> framework's format.static NetreadNetFromTorch​(java.lang.String model, boolean isBinary)Reads a network model stored in <a href="http://torch.ch">Torch7</a> framework's format.static NetreadNetFromTorch​(java.lang.String model, boolean isBinary, boolean evaluate)Reads a network model stored in <a href="http://torch.ch">Torch7</a> framework's format.static MatreadTensorFromONNX​(java.lang.String path)Creates blob from .pb file.static MatreadTorchBlob​(java.lang.String filename)Loads blob which was serialized as torch.Tensor object of Torch7 framework.static MatreadTorchBlob​(java.lang.String filename, boolean isBinary)Loads blob which was serialized as torch.Tensor object of Torch7 framework.static voidreleaseHDDLPlugin()Release a HDDL plugin.static voidresetMyriadDevice()Release a Myriad device (binded by OpenCV).static java.lang.StringsetInferenceEngineBackendType​(java.lang.String newBackendType)Deprecated.static voidshrinkCaffeModel​(java.lang.String src, java.lang.String dst)Convert all weights of Caffe network to half precision floating point.static voidshrinkCaffeModel​(java.lang.String src, java.lang.String dst, java.util.List<java.lang.String> layersTypes)Convert all weights of Caffe network to half precision floating point.static voidsoftNMSBoxes​(MatOfRect bboxes, MatOfFloat scores, MatOfFloat updated_scores, float score_threshold, float nms_threshold, MatOfInt indices)Performs soft non maximum suppression given boxes and corresponding scores.static voidsoftNMSBoxes​(MatOfRect bboxes, MatOfFloat scores, MatOfFloat updated_scores, float score_threshold, float nms_threshold, MatOfInt indices, long top_k)Performs soft non maximum suppression given boxes and corresponding scores.static voidsoftNMSBoxes​(MatOfRect bboxes, MatOfFloat scores, MatOfFloat updated_scores, float score_threshold, float nms_threshold, MatOfInt indices, long top_k, float sigma)Performs soft non maximum suppression given boxes and corresponding scores.static voidwriteTextGraph​(java.lang.String model, java.lang.String output)Create a text representation for a binary network stored in protocol buffer format.
-
-
-
フィールドの詳細
-
DNN_BACKEND_DEFAULT
public static final int DNN_BACKEND_DEFAULT
- 関連項目:
- 定数フィールド値
-
DNN_BACKEND_HALIDE
public static final int DNN_BACKEND_HALIDE
- 関連項目:
- 定数フィールド値
-
DNN_BACKEND_INFERENCE_ENGINE
public static final int DNN_BACKEND_INFERENCE_ENGINE
- 関連項目:
- 定数フィールド値
-
DNN_BACKEND_OPENCV
public static final int DNN_BACKEND_OPENCV
- 関連項目:
- 定数フィールドの値
-
DNN_BACKEND_VKCOM
public static final int DNN_BACKEND_VKCOM
- 関連項目:
- 定数フィールドの値
-
DNN_BACKEND_CUDA
public static final int DNN_BACKEND_CUDA
- 関連項目:
- 定数フィールドの値
-
DNN_BACKEND_WEBNN
public static final int DNN_BACKEND_WEBNN
- 関連項目:
- 定数フィールドの値
-
DNN_BACKEND_TIMVX
public static final int DNN_BACKEND_TIMVX
- 関連項目:
- 定数フィールドの値
-
DNN_BACKEND_CANN
public static final int DNN_BACKEND_CANN
- 関連項目:
- 定数フィールドの値
-
DNN_LAYOUT_UNKNOWN
public static final int DNN_LAYOUT_UNKNOWN
- 関連項目:
- 定数フィールドの値
-
DNN_LAYOUT_ND
public static final int DNN_LAYOUT_ND
- 関連項目:
- 定数フィールドの値
-
DNN_LAYOUT_NCHW
public static final int DNN_LAYOUT_NCHW
- 関連項目:
- 定数フィールドの値
-
DNN_LAYOUT_NCDHW
public static final int DNN_LAYOUT_NCDHW
- 関連項目:
- 定数フィールドの値
-
DNN_LAYOUT_NHWC
public static final int DNN_LAYOUT_NHWC
- 関連項目:
- 定数フィールドの値
-
DNN_LAYOUT_NDHWC
public static final int DNN_LAYOUT_NDHWC
- 関連項目:
- 定数フィールドの値
-
DNN_LAYOUT_PLANAR
public static final int DNN_LAYOUT_PLANAR
- 関連項目:
- 定数フィールドの値
-
DNN_PMODE_NULL
public static final int DNN_PMODE_NULL
- 関連項目:
- 定数フィールドの値
-
DNN_PMODE_CROP_CENTER
public static final int DNN_PMODE_CROP_CENTER
- 関連項目:
- 定数フィールドの値
-
DNN_PMODE_LETTERBOX
public static final int DNN_PMODE_LETTERBOX
- 関連項目:
- 定数フィールドの値
-
SoftNMSMethod_SOFTNMS_LINEAR
public static final int SoftNMSMethod_SOFTNMS_LINEAR
- 関連項目:
- 定数フィールドの値
-
SoftNMSMethod_SOFTNMS_GAUSSIAN
public static final int SoftNMSMethod_SOFTNMS_GAUSSIAN
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_CPU
public static final int DNN_TARGET_CPU
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_OPENCL
public static final int DNN_TARGET_OPENCL
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_OPENCL_FP16
public static final int DNN_TARGET_OPENCL_FP16
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_MYRIAD
public static final int DNN_TARGET_MYRIAD
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_VULKAN
public static final int DNN_TARGET_VULKAN
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_FPGA
public static final int DNN_TARGET_FPGA
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_CUDA
public static final int DNN_TARGET_CUDA
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_CUDA_FP16
public static final int DNN_TARGET_CUDA_FP16
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_HDDL
public static final int DNN_TARGET_HDDL
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_NPU
public static final int DNN_TARGET_NPU
- 関連項目:
- 定数フィールドの値
-
DNN_TARGET_CPU_FP16
public static final int DNN_TARGET_CPU_FP16
- 関連項目:
- 定数フィールドの値
-
-
メソッドの詳細
-
getAvailableTargets
public static java.util.List<java.lang.Integer> getAvailableTargets​(int be)
-
readNetFromDarknet
public static Net readNetFromDarknet​(java.lang.String cfgFile, java.lang.String darknetModel)
Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.- 引数:
cfgFile- ネットワークアーキテクチャのテキスト記述を含む .cfg ファイルへのパス。darknetModel- 学習済みネットワークを含む .weights ファイルへのパス。- 戻り値:
- フォワード処理の準備が整ったネットワークオブジェクト。失敗時には例外をスローする。
-
readNetFromDarknet
public static Net readNetFromDarknet​(java.lang.String cfgFile)
Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.- 引数:
cfgFile- ネットワークアーキテクチャのテキスト記述を含む .cfg ファイルへのパス。- 戻り値:
- フォワード処理の準備が整ったネットワークオブジェクト。失敗時には例外をスローする。
-
readNetFromDarknet
public static Net readNetFromDarknet​(MatOfByte bufferCfg, MatOfByte bufferModel)
Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.- 引数:
bufferCfg- ネットワークアーキテクチャのテキスト記述を含む .cfg ファイルの内容を保持するバッファ。bufferModel- 学習済みネットワークを含む .weights ファイルの内容を保持するバッファ。- 戻り値:
- Net オブジェクト。
-
readNetFromDarknet
public static Net readNetFromDarknet​(MatOfByte bufferCfg)
Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.- 引数:
bufferCfg- ネットワークアーキテクチャのテキスト記述を含む .cfg ファイルの内容を保持するバッファ。- 戻り値:
- Net オブジェクト。
-
readNetFromCaffe
public static Net readNetFromCaffe​(java.lang.String prototxt, java.lang.String caffeModel)
Reads a network model stored in <a href="http://caffe.berkeleyvision.org">Caffe</a> framework's format.- 引数:
prototxt- ネットワークアーキテクチャのテキスト記述を含む .prototxt ファイルへのパス。caffeModel- 学習済みネットワークを含む .caffemodel ファイルへのパス。- 戻り値:
- Net オブジェクト。
-
readNetFromCaffe
public static Net readNetFromCaffe​(java.lang.String prototxt)
Reads a network model stored in <a href="http://caffe.berkeleyvision.org">Caffe</a> framework's format.- 引数:
prototxt- ネットワークアーキテクチャのテキスト記述を含む .prototxt ファイルへのパス。- 戻り値:
- Net オブジェクト。
-
readNetFromCaffe
public static Net readNetFromCaffe​(MatOfByte bufferProto, MatOfByte bufferModel)
Reads a network model stored in Caffe model in memory.- 引数:
bufferProto- .prototxt ファイルの内容を保持するバッファbufferModel- .caffemodel ファイルの内容を保持するバッファ- 戻り値:
- Net オブジェクト。
-
readNetFromCaffe
public static Net readNetFromCaffe​(MatOfByte bufferProto)
Reads a network model stored in Caffe model in memory.- 引数:
bufferProto- .prototxt ファイルの内容を保持するバッファ- 戻り値:
- Net オブジェクト。
-
readNetFromTensorflow
public static Net readNetFromTensorflow​(java.lang.String model, java.lang.String config)
Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.- 引数:
model- ネットワークアーキテクチャのバイナリ protobuf 記述を含む .pb ファイルへのパスconfig- protobuf 形式のテキストグラフ定義を含む .pbtxt ファイルへのパス。結果として得られる Net オブジェクトは、バイナリ側の重みを用いてテキストグラフから構築され、より柔軟に扱えるようになる。- 戻り値:
- Net オブジェクト。
-
readNetFromTensorflow
public static Net readNetFromTensorflow​(java.lang.String model)
Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.- 引数:
model- ネットワークアーキテクチャのバイナリ protobuf 記述を含む .pb ファイルへのパス。結果として得られる Net オブジェクトは、バイナリ側の重みを用いてテキストグラフから構築され、より柔軟に扱えるようになる。- 戻り値:
- Net オブジェクト。
-
readNetFromTensorflow
public static Net readNetFromTensorflow​(MatOfByte bufferModel, MatOfByte bufferConfig)
Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.- 引数:
bufferModel- pb ファイルの内容を保持するバッファbufferConfig- pbtxt ファイルの内容を保持するバッファ- 戻り値:
- Net オブジェクト。
-
readNetFromTensorflow
public static Net readNetFromTensorflow​(MatOfByte bufferModel)
Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.- 引数:
bufferModel- pb ファイルの内容を保持するバッファ- 戻り値:
- Net オブジェクト。
-
readNetFromTFLite
public static Net readNetFromTFLite​(java.lang.String model)
Reads a network model stored in <a href="https://www.tensorflow.org/lite">TFLite</a> framework's format.- 引数:
model- ネットワークアーキテクチャのバイナリ flatbuffers 記述を含む .tflite ファイルへのパス- 戻り値:
- Net オブジェクト。
-
readNetFromTFLite
public static Net readNetFromTFLite​(MatOfByte bufferModel)
Reads a network model stored in <a href="https://www.tensorflow.org/lite">TFLite</a> framework's format.- 引数:
bufferModel- tflite ファイルの内容を保持するバッファ- 戻り値:
- Net オブジェクト。
-
readNetFromTorch
public static Net readNetFromTorch​(java.lang.String model, boolean isBinary, boolean evaluate)
Reads a network model stored in <a href="http://torch.ch">Torch7</a> framework's format.- 引数:
model- torch.save() 関数を使って Torch からダンプしたファイルへのパス。isBinary- ネットワークが ascii モードとバイナリモードのどちらでシリアライズされたかを指定する。evaluate- ネットワークのテストフェーズを指定する。true の場合、Torch の evaluate() メソッドと同様の挙動になる。- 戻り値:
- Net オブジェクト。覚え書き: Torch シリアライザの ascii モードの方が望ましい。バイナリモードは C 言語の
long型を多用するが、この型はシステムによってビット長が異なるためである。読み込むファイルには、インポートするネットワークを含むシリアライズされた <a href="https://github.com/torch/nn/blob/master/doc/module.md">nn.Module</a> オブジェクトが含まれていなければならない。インポートエラーを避けるため、シリアライズデータからカスタムオブジェクトを排除するとよい。サポートされているレイヤー(すなわち Torch nn.Module クラスから派生したオブジェクトインスタンス)の一覧: - nn.Sequential - nn.Parallel - nn.Concat - nn.Linear - nn.SpatialConvolution - nn.SpatialMaxPooling, nn.SpatialAveragePooling - nn.ReLU, nn.TanH, nn.Sigmoid - nn.Reshape - nn.SoftMax, nn.LogSoftMax また、cunn, cudnn, fbcunn の同等クラスの一部も正常にインポートできる場合がある。
-
readNetFromTorch
public static Net readNetFromTorch​(java.lang.String model, boolean isBinary)
Reads a network model stored in <a href="http://torch.ch">Torch7</a> framework's format.- 引数:
model- torch.save() 関数を使って Torch からダンプしたファイルへのパス。isBinary- ネットワークが ascii モードとバイナリモードのどちらでシリアライズされたかを指定する。- 戻り値:
- Net オブジェクト。覚え書き: Torch シリアライザの ascii モードの方が望ましい。バイナリモードは C 言語の
long型を多用するが、この型はシステムによってビット長が異なるためである。読み込むファイルには、インポートするネットワークを含むシリアライズされた <a href="https://github.com/torch/nn/blob/master/doc/module.md">nn.Module</a> オブジェクトが含まれていなければならない。インポートエラーを避けるため、シリアライズデータからカスタムオブジェクトを排除するとよい。サポートされているレイヤー(すなわち Torch nn.Module クラスから派生したオブジェクトインスタンス)の一覧: - nn.Sequential - nn.Parallel - nn.Concat - nn.Linear - nn.SpatialConvolution - nn.SpatialMaxPooling, nn.SpatialAveragePooling - nn.ReLU, nn.TanH, nn.Sigmoid - nn.Reshape - nn.SoftMax, nn.LogSoftMax また、cunn, cudnn, fbcunn の同等クラスの一部も正常にインポートできる場合がある。
-
readNetFromTorch
public static Net readNetFromTorch​(java.lang.String model)
Reads a network model stored in <a href="http://torch.ch">Torch7</a> framework's format.- 引数:
model- torch.save() 関数を使って Torch からダンプしたファイルへのパス。- 戻り値:
- Net オブジェクト。覚え書き: Torch シリアライザの ascii モードの方が望ましい。バイナリモードは C 言語の
long型を多用するが、この型はシステムによってビット長が異なるためである。読み込むファイルには、インポートするネットワークを含むシリアライズされた <a href="https://github.com/torch/nn/blob/master/doc/module.md">nn.Module</a> オブジェクトが含まれていなければならない。インポートエラーを避けるため、シリアライズデータからカスタムオブジェクトを排除するとよい。サポートされているレイヤー(すなわち Torch nn.Module クラスから派生したオブジェクトインスタンス)の一覧: - nn.Sequential - nn.Parallel - nn.Concat - nn.Linear - nn.SpatialConvolution - nn.SpatialMaxPooling, nn.SpatialAveragePooling - nn.ReLU, nn.TanH, nn.Sigmoid - nn.Reshape - nn.SoftMax, nn.LogSoftMax また、cunn, cudnn, fbcunn の同等クラスの一部も正常にインポートできる場合がある。
-
readNet
public static Net readNet​(java.lang.String model, java.lang.String config, java.lang.String framework)
Read deep learning network represented in one of the supported formats.- 引数:
model- 学習済みの重みを含むバイナリファイル。フレームワークごとのモデルでは以下のファイル拡張子が想定される: **.caffemodel(Caffe, http://caffe.berkeleyvision.org/) **.pb(TensorFlow, https://www.tensorflow.org/) **.t7|*.net(Torch, http://torch.ch/) **.weights(Darknet, https://pjreddie.com/darknet/) **.bin|*.onnx(OpenVINO, https://software.intel.com/openvino-toolkit) **.onnx(ONNX, https://onnx.ai/)config- ネットワーク構成を含むテキストファイル。以下の拡張子のファイルが該当する: **.prototxt(Caffe, http://caffe.berkeleyvision.org/) **.pbtxt(TensorFlow, https://www.tensorflow.org/) **.cfg(Darknet, https://pjreddie.com/darknet/) **.xml(OpenVINO, https://software.intel.com/openvino-toolkit)framework- フォーマットを判別するための明示的なフレームワーク名のタグ。- 戻り値:
- Net オブジェクト。この関数は学習済みモデルの元フレームワークを自動的に検出し、REF: readNetFromCaffe、REF: readNetFromTensorflow、REF: readNetFromTorch、REF: readNetFromDarknet などの適切な関数を呼び出す。
modelとconfigの引数の順序は問わない。
-
readNet
public static Net readNet​(java.lang.String model, java.lang.String config)
Read deep learning network represented in one of the supported formats.- 引数:
model- 学習済みの重みを含むバイナリファイル。フレームワークごとのモデルでは以下のファイル拡張子が想定される: **.caffemodel(Caffe, http://caffe.berkeleyvision.org/) **.pb(TensorFlow, https://www.tensorflow.org/) **.t7|*.net(Torch, http://torch.ch/) **.weights(Darknet, https://pjreddie.com/darknet/) **.bin|*.onnx(OpenVINO, https://software.intel.com/openvino-toolkit) **.onnx(ONNX, https://onnx.ai/)config- ネットワーク構成を含むテキストファイル。以下の拡張子のファイルが該当する: **.prototxt(Caffe, http://caffe.berkeleyvision.org/) **.pbtxt(TensorFlow, https://www.tensorflow.org/) **.cfg(Darknet, https://pjreddie.com/darknet/) **.xml(OpenVINO, https://software.intel.com/openvino-toolkit)- 戻り値:
- Net オブジェクト。この関数は学習済みモデルの元フレームワークを自動的に検出し、REF: readNetFromCaffe、REF: readNetFromTensorflow、REF: readNetFromTorch、REF: readNetFromDarknet などの適切な関数を呼び出す。
modelとconfigの引数の順序は問わない。
-
readNet
public static Net readNet​(java.lang.String model)
Read deep learning network represented in one of the supported formats.- 引数:
model- 学習済みの重みを含むバイナリファイル。フレームワークごとのモデルでは以下のファイル拡張子が想定される: **.caffemodel(Caffe, http://caffe.berkeleyvision.org/) **.pb(TensorFlow, https://www.tensorflow.org/) **.t7|*.net(Torch, http://torch.ch/) **.weights(Darknet, https://pjreddie.com/darknet/) **.bin|*.onnx(OpenVINO, https://software.intel.com/openvino-toolkit) **.onnx(ONNX, https://onnx.ai/) 以下の拡張子のファイル: **.prototxt(Caffe, http://caffe.berkeleyvision.org/) **.pbtxt(TensorFlow, https://www.tensorflow.org/) **.cfg(Darknet, https://pjreddie.com/darknet/) **.xml(OpenVINO, https://software.intel.com/openvino-toolkit)- 戻り値:
- Net オブジェクト。この関数は学習済みモデルの元フレームワークを自動的に検出し、REF: readNetFromCaffe、REF: readNetFromTensorflow、REF: readNetFromTorch、REF: readNetFromDarknet などの適切な関数を呼び出す。
modelとconfigの引数の順序は問わない。
-
readNet
public static Net readNet​(java.lang.String framework, MatOfByte bufferModel, MatOfByte bufferConfig)
Read deep learning network represented in one of the supported formats. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.- 引数:
framework- 元フレームワークの名前。bufferModel- 重みを含むバイナリファイルの内容を格納したバッファ。bufferConfig- ネットワーク構成を含むテキストファイルの内容を格納したバッファ。- 戻り値:
- Net オブジェクト。
-
readNet
public static Net readNet​(java.lang.String framework, MatOfByte bufferModel)
Read deep learning network represented in one of the supported formats. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.- 引数:
framework- 元フレームワークの名前。bufferModel- 重みを含むバイナリファイルの内容を格納したバッファ。- 戻り値:
- Net オブジェクト。
-
readTorchBlob
public static Mat readTorchBlob​(java.lang.String filename, boolean isBinary)
Loads blob which was serialized as torch.Tensor object of Torch7 framework. WARNING: This function has the same limitations as readNetFromTorch().- 引数:
filename- 自動生成isBinary- 自動生成- 戻り値:
- 自動生成
-
readTorchBlob
public static Mat readTorchBlob​(java.lang.String filename)
Loads blob which was serialized as torch.Tensor object of Torch7 framework. WARNING: This function has the same limitations as readNetFromTorch().- 引数:
filename- 自動生成- 戻り値:
- 自動生成
-
readNetFromModelOptimizer
public static Net readNetFromModelOptimizer​(java.lang.String xml, java.lang.String bin)
Load a network from Intel's Model Optimizer intermediate representation.- 引数:
xml- ネットワークのトポロジーを記述した XML 構成ファイル。bin- 学習済みの重みを含むバイナリファイル。- 戻り値:
- Net オブジェクト。Intel の Model Optimizer からインポートされたネットワークは、Intel の Inference Engine バックエンドで実行される。
-
readNetFromModelOptimizer
public static Net readNetFromModelOptimizer​(java.lang.String xml)
Load a network from Intel's Model Optimizer intermediate representation.- 引数:
xml- ネットワークのトポロジーを記述した XML 構成ファイル。- 戻り値:
- Net オブジェクト。Intel の Model Optimizer からインポートされたネットワークは、Intel の Inference Engine バックエンドで実行される。
-
readNetFromModelOptimizer
public static Net readNetFromModelOptimizer​(MatOfByte bufferModelConfig, MatOfByte bufferWeights)
Load a network from Intel's Model Optimizer intermediate representation.- 引数:
bufferModelConfig- ネットワークのトポロジーを記述した XML 構成を含むバッファ。bufferWeights- 学習済みの重みのバイナリデータを含むバッファ。- 戻り値:
- Net オブジェクト。Intel の Model Optimizer からインポートされたネットワークは、Intel の Inference Engine バックエンドで実行される。
-
readNetFromONNX
public static Net readNetFromONNX​(java.lang.String onnxFile)
Reads a network model <a href="https://onnx.ai/">ONNX</a>.- 引数:
onnxFile- ネットワークアーキテクチャのテキスト記述を含む .onnx ファイルへのパス。- 戻り値:
- フォワード処理の準備が整ったネットワークオブジェクト。失敗時には例外をスローする。
-
readNetFromONNX
public static Net readNetFromONNX​(MatOfByte buffer)
Reads a network model from <a href="https://onnx.ai/">ONNX</a> in-memory buffer.- 引数:
buffer- ONNX モデルのバイト列を格納したメモリ上のバッファ。- 戻り値:
- フォワード処理の準備が整ったネットワークオブジェクト。失敗時には例外をスローする。
-
readTensorFromONNX
public static Mat readTensorFromONNX​(java.lang.String path)
Creates blob from .pb file.- 引数:
path- 入力テンソルを含む .pb ファイルへのパス。- 戻り値:
- Mat。
-
blobFromImage
public static Mat blobFromImage​(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop, int ddepth)
Creates 4-dimensional blob from image. Optionally resizes and cropsimagefrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
image- 入力画像(1、3、または 4 チャンネル)。scalefactor-imagesの値に対する乗数。size- 出力画像の空間サイズ。mean- 各チャンネルから減算される平均値を表すスカラ。imageが BGR 順でswapRBが true の場合、値は (mean-R, mean-G, mean-B) の順であることが想定される。swapRB- 3 チャンネル画像において最初と最後のチャンネルを入れ替える必要があることを示すフラグ。crop- リサイズ後に画像を切り抜くかどうかを示すフラグ。ddepth- 出力 blob のビット深度。CV_32F または CV_8U を選択する。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImage
public static Mat blobFromImage​(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop)
Creates 4-dimensional blob from image. Optionally resizes and cropsimagefrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
image- 入力画像(1、3、または 4 チャンネル)。scalefactor-imagesの値に対する乗数。size- 出力画像の空間サイズ。mean- 各チャンネルから減算される平均値を表すスカラ。imageが BGR 順でswapRBが true の場合、値は (mean-R, mean-G, mean-B) の順であることが想定される。swapRB- 3 チャンネル画像において最初と最後のチャンネルを入れ替える必要があることを示すフラグ。crop- リサイズ後に画像を切り抜くかどうかを示すフラグ。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImage
public static Mat blobFromImage​(Mat image, double scalefactor, Size size, Scalar mean, boolean swapRB)
Creates 4-dimensional blob from image. Optionally resizes and cropsimagefrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
image- 入力画像(1、3、または 4 チャンネル)。scalefactor-imagesの値に対する乗数。size- 出力画像の空間サイズ。mean- 各チャンネルから減算される平均値を表すスカラ。imageが BGR 順でswapRBが true の場合、値は (mean-R, mean-G, mean-B) の順であることが想定される。swapRB- 3 チャンネル画像において最初と最後のチャンネルを入れ替える必要があることを示すフラグ。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImage
public static Mat blobFromImage​(Mat image, double scalefactor, Size size, Scalar mean)
Creates 4-dimensional blob from image. Optionally resizes and cropsimagefrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
image- 入力画像(1、3、または 4 チャンネル)。scalefactor-imagesの値に対する乗数。size- 出力画像の空間サイズ。mean- 各チャンネルから減算される平均値を表すスカラ。imageが BGR 順でswapRBが true の場合、値は (mean-R, mean-G, mean-B) の順であることが想定される。3 チャンネル画像において必要となる。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImage
public static Mat blobFromImage​(Mat image, double scalefactor, Size size)
Creates 4-dimensional blob from image. Optionally resizes and cropsimagefrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
image- 入力画像(1、3、または 4 チャンネル)。scalefactor-imagesの値に対する乗数。size- 出力画像の空間サイズ。imageが BGR 順でswapRBが true の場合、(mean-R, mean-G, mean-B) の順であることが想定される。3 チャンネル画像において必要となる。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImage
public static Mat blobFromImage​(Mat image, double scalefactor)
Creates 4-dimensional blob from image. Optionally resizes and cropsimagefrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
image- 入力画像(1、3、または 4 チャンネル)。scalefactor-imagesの値に対する乗数。imageが BGR 順でswapRBが true の場合、(mean-R, mean-G, mean-B) の順であることが想定される。3 チャンネル画像において必要となる。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImage
public static Mat blobFromImage​(Mat image)
Creates 4-dimensional blob from image. Optionally resizes and cropsimagefrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
image- 入力画像(1、3、または 4 チャンネル)。imageが BGR 順でswapRBが true の場合、(mean-R, mean-G, mean-B) の順であることが想定される。3 チャンネル画像において必要となる。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImages
public static Mat blobFromImages​(java.util.List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop, int ddepth)
Creates 4-dimensional blob from series of images. Optionally resizes and cropsimagesfrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
images- 入力画像群(いずれも 1、3、または 4 チャンネル)。size- 出力画像の空間サイズ。mean- 各チャンネルから減算される平均値を表すスカラ。imageが BGR 順でswapRBが true の場合、値は (mean-R, mean-G, mean-B) の順であることが想定される。scalefactor-imagesの値に対する乗数。swapRB- 3 チャンネル画像において最初と最後のチャンネルを入れ替える必要があることを示すフラグ。crop- リサイズ後に画像を切り抜くかどうかを示すフラグ。ddepth- 出力 blob のビット深度。CV_32F または CV_8U を選択する。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImages
public static Mat blobFromImages​(java.util.List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB, boolean crop)
Creates 4-dimensional blob from series of images. Optionally resizes and cropsimagesfrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
images- 入力画像群(いずれも 1、3、または 4 チャンネル)。size- 出力画像の空間サイズ。mean- 各チャンネルから減算される平均値を表すスカラ。imageが BGR 順でswapRBが true の場合、値は (mean-R, mean-G, mean-B) の順であることが想定される。scalefactor-imagesの値に対する乗数。swapRB- 3 チャンネル画像において最初と最後のチャンネルを入れ替える必要があることを示すフラグ。crop- リサイズ後に画像を切り抜くかどうかを示すフラグ。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImages
public static Mat blobFromImages​(java.util.List<Mat> images, double scalefactor, Size size, Scalar mean, boolean swapRB)
Creates 4-dimensional blob from series of images. Optionally resizes and cropsimagesfrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
images- 入力画像群(いずれも 1、3、または 4 チャンネル)。size- 出力画像の空間サイズ。mean- 各チャンネルから減算される平均値を表すスカラ。imageが BGR 順でswapRBが true の場合、値は (mean-R, mean-G, mean-B) の順であることが想定される。scalefactor-imagesの値に対する乗数。swapRB- 3 チャンネル画像において最初と最後のチャンネルを入れ替える必要があることを示すフラグ。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImages
public static Mat blobFromImages​(java.util.List<Mat> images, double scalefactor, Size size, Scalar mean)
Creates 4-dimensional blob from series of images. Optionally resizes and cropsimagesfrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
images- 入力画像群(いずれも 1、3、または 4 チャンネル)。size- 出力画像の空間サイズ。mean- 各チャンネルから減算される平均値を表すスカラ。imageが BGR 順でswapRBが true の場合、値は (mean-R, mean-G, mean-B) の順であることが想定される。scalefactor-imagesの値に対する乗数。3 チャンネル画像において必要となる。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImages
public static Mat blobFromImages​(java.util.List<Mat> images, double scalefactor, Size size)
Creates 4-dimensional blob from series of images. Optionally resizes and cropsimagesfrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
images- 入力画像群(いずれも 1、3、または 4 チャンネル)。size- 出力画像の空間サイズ。imageが BGR 順でswapRBが true の場合、(mean-R, mean-G, mean-B) の順であることが想定される。scalefactor-imagesの値に対する乗数。3 チャンネル画像において必要となる。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImages
public static Mat blobFromImages​(java.util.List<Mat> images, double scalefactor)
Creates 4-dimensional blob from series of images. Optionally resizes and cropsimagesfrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
images- 入力画像群(いずれも 1、3、または 4 チャンネル)。imageが BGR 順でswapRBが true の場合、(mean-R, mean-G, mean-B) の順であることが想定される。scalefactor-imagesの値に対する乗数。3 チャンネル画像において必要となる。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImages
public static Mat blobFromImages​(java.util.List<Mat> images)
Creates 4-dimensional blob from series of images. Optionally resizes and cropsimagesfrom center, subtractmeanvalues, scales values byscalefactor, swap Blue and Red channels.- 引数:
images- 入力画像群(いずれも 1、3、または 4 チャンネル)。imageが BGR 順でswapRBが true の場合、(mean-R, mean-G, mean-B) の順であることが想定される。3 チャンネル画像において必要となる。cropが true の場合、入力画像はリサイズ後の一辺がsizeの対応する次元と等しくなり、もう一辺がそれと等しいか大きくなるようにリサイズされる。その後、中央から切り抜きが行われる。cropが false の場合、切り抜きは行わず、アスペクト比を保持せずに直接リサイズが行われる。- 戻り値:
- NCHW の次元順序を持つ 4 次元の Mat。覚え書き:
scalefactorとmeanの順序および用法は (input - mean) * scalefactor である。
-
blobFromImageWithParams
public static Mat blobFromImageWithParams​(Mat image, Image2BlobParams param)
Creates 4-dimensional blob from image with given params. This function is an extension of REF: blobFromImage to meet more image preprocess needs. Given input image and preprocessing parameters, and function outputs the blob.- 引数:
image- 入力画像(いずれも 1、3、または 4 チャンネル)。param- Image2BlobParams 構造体。画像から blob への処理に必要なすべての引数を含む。- 戻り値:
- 4 次元の Mat。
-
blobFromImageWithParams
public static Mat blobFromImageWithParams​(Mat image)
Creates 4-dimensional blob from image with given params. This function is an extension of REF: blobFromImage to meet more image preprocess needs. Given input image and preprocessing parameters, and function outputs the blob.- 引数:
image- 入力画像(いずれも 1、3、または 4 チャンネル)。- 戻り値:
- 4 次元の Mat。
-
blobFromImageWithParams
public static void blobFromImageWithParams​(Mat image, Mat blob, Image2BlobParams param)
-
blobFromImageWithParams
public static void blobFromImageWithParams​(Mat image, Mat blob)
-
blobFromImagesWithParams
public static Mat blobFromImagesWithParams​(java.util.List<Mat> images, Image2BlobParams param)
Creates 4-dimensional blob from series of images with given params. This function is an extension of REF: blobFromImages to meet more image preprocess needs. Given input image and preprocessing parameters, and function outputs the blob.- 引数:
images- 入力画像(いずれも 1、3、または 4 チャンネル)。param- Image2BlobParams 構造体。画像から blob への処理に必要なすべての引数を含む。- 戻り値:
- 4 次元の Mat。
-
blobFromImagesWithParams
public static Mat blobFromImagesWithParams​(java.util.List<Mat> images)
Creates 4-dimensional blob from series of images with given params. This function is an extension of REF: blobFromImages to meet more image preprocess needs. Given input image and preprocessing parameters, and function outputs the blob.- 引数:
images- 入力画像(いずれも 1、3、または 4 チャンネル)。- 戻り値:
- 4 次元の Mat。
-
blobFromImagesWithParams
public static void blobFromImagesWithParams​(java.util.List<Mat> images, Mat blob, Image2BlobParams param)
-
blobFromImagesWithParams
public static void blobFromImagesWithParams​(java.util.List<Mat> images, Mat blob)
-
imagesFromBlob
public static void imagesFromBlob​(Mat blob_, java.util.List<Mat> images_)
Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure (std::vector<cv::Mat>).- 引数:
blob_- 画像を抽出したい元となる、浮動小数点精度 (CV_32F) の 4 次元配列 (images, channels, height, width)。images_- blob から抽出した画像を浮動小数点精度 (CV_32F) で格納した 2D Mat の配列。これらは正規化も平均加算もされていない。返される画像の数は blob の最初の次元(バッチサイズ)に等しい。各画像のチャンネル数は blob の 2 番目の次元(ビット深度)に等しい。
-
shrinkCaffeModel
public static void shrinkCaffeModel​(java.lang.String src, java.lang.String dst, java.util.List<java.lang.String> layersTypes)Convert all weights of Caffe network to half precision floating point.- 引数:
src- 単精度浮動小数点の重みを含む Caffe フレームワークの元モデルへのパス(通常は.caffemodel拡張子を持つ)。dst- 更新された重みを持つ出力先モデルへのパス。layersTypes- 引数を変換するレイヤー型の集合。デフォルトでは、Convolutional レイヤーと Fully-Connected レイヤーの重みのみを変換する。覚え書き: 縮小されたモデルは元の float32 の重みを持たないため、元の Caffe フレームワークではもう使用できない。ただしデータ構造は NVidia の Caffe フォーク (https://github.com/NVIDIA/caffe) から取られているため、結果のモデルはそこで使用できる場合がある。
-
shrinkCaffeModel
public static void shrinkCaffeModel​(java.lang.String src, java.lang.String dst)Convert all weights of Caffe network to half precision floating point.- 引数:
src- 単精度浮動小数点の重みを含む Caffe フレームワークの元モデルへのパス(通常は.caffemodel拡張子を持つ)。dst- 更新された重みを持つ出力先モデルへのパス。デフォルトでは、Convolutional レイヤーと Fully-Connected レイヤーの重みのみを変換する。覚え書き: 縮小されたモデルは元の float32 の重みを持たないため、元の Caffe フレームワークではもう使用できない。ただしデータ構造は NVidia の Caffe フォーク (https://github.com/NVIDIA/caffe) から取られているため、結果のモデルはそこで使用できる場合がある。
-
writeTextGraph
public static void writeTextGraph​(java.lang.String model, java.lang.String output)Create a text representation for a binary network stored in protocol buffer format.- 引数:
model- バイナリネットワークへのパス。output- 作成する出力テキストファイルへのパス。覚え書き: 出力ファイルサイズを削減するため、学習済みの重みは含まれない。
-
NMSBoxes
public static void NMSBoxes​(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)
Performs non maximum suppression given boxes and corresponding scores.- 引数:
bboxes- NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS 後に保持された bboxes のインデックス。eta- 適応的しきい値の式における係数: \(nms\_threshold_{i+1}=eta\cdot nms\_threshold_i\)。top_k->0の場合、最大でtop_k個の選択されたインデックスを保持する。
-
NMSBoxes
public static void NMSBoxes​(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta)
Performs non maximum suppression given boxes and corresponding scores.- 引数:
bboxes- NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS 後に保持された bboxes のインデックス。eta- 適応的しきい値の式における係数: \(nms\_threshold_{i+1}=eta\cdot nms\_threshold_i\)。
-
NMSBoxes
public static void NMSBoxes​(MatOfRect2d bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices)
Performs non maximum suppression given boxes and corresponding scores.- 引数:
bboxes- NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS 後に保持された bboxes のインデックス。
-
NMSBoxesRotated
public static void NMSBoxesRotated​(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)
-
NMSBoxesRotated
public static void NMSBoxesRotated​(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices, float eta)
-
NMSBoxesRotated
public static void NMSBoxesRotated​(MatOfRotatedRect bboxes, MatOfFloat scores, float score_threshold, float nms_threshold, MatOfInt indices)
-
NMSBoxesBatched
public static void NMSBoxesBatched​(MatOfRect2d bboxes, MatOfFloat scores, MatOfInt class_ids, float score_threshold, float nms_threshold, MatOfInt indices, float eta, int top_k)
Performs batched non maximum suppression on given boxes and corresponding scores across different classes.- 引数:
bboxes- NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。class_ids- 対応するクラス ID の集合。ID は整数で、通常は 0 から始まる。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS 後に保持された bboxes のインデックス。eta- 適応的しきい値の式における係数: \(nms\_threshold_{i+1}=eta\cdot nms\_threshold_i\)。top_k->0の場合、最大でtop_k個の選択されたインデックスを保持する。
-
NMSBoxesBatched
public static void NMSBoxesBatched​(MatOfRect2d bboxes, MatOfFloat scores, MatOfInt class_ids, float score_threshold, float nms_threshold, MatOfInt indices, float eta)
Performs batched non maximum suppression on given boxes and corresponding scores across different classes.- 引数:
bboxes- NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。class_ids- 対応するクラス ID の集合。ID は整数で、通常は 0 から始まる。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS 後に保持された bboxes のインデックス。eta- 適応的しきい値の式における係数: \(nms\_threshold_{i+1}=eta\cdot nms\_threshold_i\)。
-
NMSBoxesBatched
public static void NMSBoxesBatched​(MatOfRect2d bboxes, MatOfFloat scores, MatOfInt class_ids, float score_threshold, float nms_threshold, MatOfInt indices)
Performs batched non maximum suppression on given boxes and corresponding scores across different classes.- 引数:
bboxes- NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。class_ids- 対応するクラス ID の集合。ID は整数で、通常は 0 から始まる。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS 後に保持された bboxes のインデックス。
-
softNMSBoxes
public static void softNMSBoxes​(MatOfRect bboxes, MatOfFloat scores, MatOfFloat updated_scores, float score_threshold, float nms_threshold, MatOfInt indices, long top_k, float sigma)
Performs soft non maximum suppression given boxes and corresponding scores. Reference: https://arxiv.org/abs/1704.04503- 引数:
bboxes- Soft NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。updated_scores- 対応する更新後の確信度の集合。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS 後に保持された bboxes のインデックス。top_k- 最大でtop_k個の選択されたインデックスを保持する。sigma- ガウス重み付けのパラメータ。 SEE: SoftNMSMethod
-
softNMSBoxes
public static void softNMSBoxes​(MatOfRect bboxes, MatOfFloat scores, MatOfFloat updated_scores, float score_threshold, float nms_threshold, MatOfInt indices, long top_k)
Performs soft non maximum suppression given boxes and corresponding scores. Reference: https://arxiv.org/abs/1704.04503- 引数:
bboxes- Soft NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。updated_scores- 対応する更新後の確信度の集合。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS 後に保持された bboxes のインデックス。top_k- 選択するインデックスを最大でtop_k個に保持する。 SEE: SoftNMSMethod
-
softNMSBoxes
public static void softNMSBoxes​(MatOfRect bboxes, MatOfFloat scores, MatOfFloat updated_scores, float score_threshold, float nms_threshold, MatOfInt indices)
Performs soft non maximum suppression given boxes and corresponding scores. Reference: https://arxiv.org/abs/1704.04503- 引数:
bboxes- Soft NMS を適用するバウンディングボックスの集合。scores- 対応する確信度の集合。updated_scores- 対応する更新後の確信度の集合。score_threshold- スコアによってボックスをフィルタリングするために使用するしきい値。nms_threshold- non maximum suppression で使用するしきい値。indices- NMS適用後に保持されたバウンディングボックスのインデックス。 SEE: SoftNMSMethod
-
getInferenceEngineBackendType
@Deprecated public static java.lang.String getInferenceEngineBackendType()
Deprecated.Returns Inference Engine internal backend API. See values ofCV_DNN_BACKEND_INFERENCE_ENGINE_*macros.OPENCV_DNN_BACKEND_INFERENCE_ENGINE_TYPEruntime parameter (environment variable) is ignored since 4.6.0.- 戻り値:
- 自動生成
-
setInferenceEngineBackendType
@Deprecated public static java.lang.String setInferenceEngineBackendType​(java.lang.String newBackendType)
Deprecated.Specify Inference Engine internal backend API. See values ofCV_DNN_BACKEND_INFERENCE_ENGINE_*macros.- 引数:
newBackendType- 自動生成- 戻り値:
- 内部バックエンド API の以前の値
-
resetMyriadDevice
public static void resetMyriadDevice()
Release a Myriad device (binded by OpenCV). Single Myriad device cannot be shared across multiple processes which uses Inference Engine's Myriad plugin.
-
getInferenceEngineVPUType
public static java.lang.String getInferenceEngineVPUType()
Returns Inference Engine VPU type. See values ofCV_DNN_INFERENCE_ENGINE_VPU_TYPE_*macros.- 戻り値:
- 自動生成
-
getInferenceEngineCPUType
public static java.lang.String getInferenceEngineCPUType()
Returns Inference Engine CPU type. Specify OpenVINO plugin: CPU or ARM.- 戻り値:
- 自動生成
-
releaseHDDLPlugin
public static void releaseHDDLPlugin()
Release a HDDL plugin.
-
-