Skip to content

create_dl_layer_zoom_factorCreateDlLayerZoomFactorCreateDlLayerZoomFactorcreate_dl_layer_zoom_factorT_create_dl_layer_zoom_factor🔗

説明🔗

create_dl_layer_zoom_factorCreateDlLayerZoomFactorCreateDlLayerZoomFactorcreate_dl_layer_zoom_factorT_create_dl_layer_zoom_factor — サイズファクターを使用しズームレイヤーを作成する。

書式🔗

create_dl_layer_zoom_factor( dl_layer DLLayerInput, string LayerName, number ScaleWidth, number ScaleHeight, string Interpolation, string AlignCorners, attribute.name GenParamName, attribute.value GenParamValue, out dl_layer DLLayerZoom )void CreateDlLayerZoomFactor( const HTuple& DLLayerInput, const HTuple& LayerName, const HTuple& ScaleWidth, const HTuple& ScaleHeight, const HTuple& Interpolation, const HTuple& AlignCorners, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* DLLayerZoom )static void HOperatorSet.CreateDlLayerZoomFactor( HTuple DLLayerInput, HTuple layerName, HTuple scaleWidth, HTuple scaleHeight, HTuple interpolation, HTuple alignCorners, HTuple genParamName, HTuple genParamValue, out HTuple DLLayerZoom )def create_dl_layer_zoom_factor( dllayer_input: HHandle, layer_name: str, scale_width: Union[int, float], scale_height: Union[int, float], interpolation: str, align_corners: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[int, float, str]] ) -> HHandle

Herror T_create_dl_layer_zoom_factor( const Htuple DLLayerInput, const Htuple LayerName, const Htuple ScaleWidth, const Htuple ScaleHeight, const Htuple Interpolation, const Htuple AlignCorners, const Htuple GenParamName, const Htuple GenParamValue, Htuple* DLLayerZoom )

HDlLayer HDlLayer::CreateDlLayerZoomFactor( const HString& LayerName, const HTuple& ScaleWidth, const HTuple& ScaleHeight, const HString& Interpolation, const HString& AlignCorners, const HTuple& GenParamName, const HTuple& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerZoomFactor( const HString& LayerName, double ScaleWidth, double ScaleHeight, const HString& Interpolation, const HString& AlignCorners, const HString& GenParamName, const HString& GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerZoomFactor( const char* LayerName, double ScaleWidth, double ScaleHeight, const char* Interpolation, const char* AlignCorners, const char* GenParamName, const char* GenParamValue ) const

HDlLayer HDlLayer::CreateDlLayerZoomFactor( const wchar_t* LayerName, double ScaleWidth, double ScaleHeight, const wchar_t* Interpolation, const wchar_t* AlignCorners, const wchar_t* GenParamName, const wchar_t* GenParamValue ) const (Windows only)

HDlLayer HDlLayer.CreateDlLayerZoomFactor( string layerName, HTuple scaleWidth, HTuple scaleHeight, string interpolation, string alignCorners, HTuple genParamName, HTuple genParamValue )

HDlLayer HDlLayer.CreateDlLayerZoomFactor( string layerName, double scaleWidth, double scaleHeight, string interpolation, string alignCorners, string genParamName, string genParamValue )

説明🔗

create_dl_layer_zoom_factorCreateDlLayerZoomFactor はサイズファクターを使用してズームレイヤーを作成し、 そのレイヤーハンドルをDLLayerZoomDLLayerZoomdllayer_zoomで返します。

DLLayerInputDLLayerInputdllayer_input は入力レイヤーを決定し、レイヤーハンドルを値として受け取ります。

LayerNamelayerNamelayer_name は個々のレイヤー名を設定します。 ただし、create_dl_modelCreateDlModel を使用してモデルを作成する際には、 ネットワークの各レイヤーに固有の名前を付ける必要があります。

ScaleWidthscaleWidthscale_width と ScaleHeightscaleHeightscale_height は出力と対応する入力サイズの比率を指定します。 これらは共にズームレイヤーDLLayerZoomDLLayerZoomdllayer_zoomの出力サイズを定義しています。

Interpolationinterpolationinterpolation は補間モードを定義します。 現時点では 'bilinear'"bilinear"と 'nearest_neighbor'"nearest_neighbor"補間がサポートされています。

AlignCornersalignCornersalign_corners は出力画像から入力画像への座標変換方法を定義します。 また、代わりにパラメータ 'coordinate_transformation_mode'"coordinate_transformation_mode"を指定することもできます。 両パラメーターの仕様は互いに矛盾しない事に注意してください:

  • AlignCornersalignCornersalign_corners = 'true'"true" または 'coordinate_transformation_mode'"coordinate_transformation_mode" = 'align_corners'"align_corners": 変換は、HALCON非標準のデカルト座標系が適用されます。 (エッジ中心, 左上コーナー原点, Transformations / 2D Transformations参照ください。) 例として\(x\)軸を使用すると、次のようになります。:

    \[\begin{eqnarray*} x_{input} = x_{output} * (length_{input} - 1) / (length_{output} - 1) \end{eqnarray*}\]
  • AlignCornersalignCornersalign_corners = 'false'"false":

    • 'coordinate_transformation_mode'"coordinate_transformation_mode" = 'half_pixel'"half_pixel" (default): 変換は、HALCON標準座標系が適用されます。 (ピクセル中心, 左上ピクセル中心が原点, Transformations / 2D Transformations参照ください。) \(x\)軸を例にすると、これは次のようになります:

      \[\begin{eqnarray*} x_{input} = (x_{output} + 0.5) * length_{input} / length_{output} - 0.5 \end{eqnarray*}\]
    • 'coordinate_transformation_mode'"coordinate_transformation_mode" = 'pytorch_half_pixel'"pytorch_half_pixel":

      \[\begin{eqnarray*} x_{input} = length_{output} > 1 ? (x_{output} + 0.5) * length_{input} / length_{output} - 0.5 : 0.0 \end{eqnarray*}\]
    • 'coordinate_transformation_mode'"coordinate_transformation_mode" = 'asymmetric'"asymmetric": 変換は非対称に適用されます。 \(x\) 軸を例にすると、これは次のようになります:

      \[\begin{eqnarray*} x_{input} = x_{output} * length_{input} / length_{output} \end{eqnarray*}\]

以下のGenParamNamegenParamNamegen_param_name とそれに対応する値 GenParamValuegenParamValuegen_param_valueがサポートされています。

  • 'coordinate_transformation_mode'"coordinate_transformation_mode": 出力画像から入力画像への座標変換方法を定義します。 指定されていない場合、変換はパラメータ AlignCornersalignCornersalign_corners で決定されます。

    初期値: 'half_pixel'"half_pixel"

  • 'nearest_mode'"nearest_mode": 入力画像中の「最も近い」ピクセルの取得方法を定義します。 このパラメータは、Interpolationinterpolationinterpolation が 'nearest_neighbor'"nearest_neighbor"に 設定されている場合にのみ適用されます。

    推奨値: 'round_prefer_floor'"round_prefer_floor", 'round_prefer_ceil'"round_prefer_ceil", 'floor'"floor", 'ceil'"ceil"

    初期値: 'round_prefer_floor'"round_prefer_floor"

  • 'is_inference_output'"is_inference_output": オペレーター apply_dl_modelApplyDlModel がOutputsoutputsoutputs でこのレイヤを指定していない場合であっても、 ディクショナリ DLResultBatchDLResultBatchdlresult_batch に、このレイヤーの出力を含む('true'"true")か 含まない ('false'"false")かを決定します。

    初期値: 'false'"false"

create_dl_layer_zoom_factorCreateDlLayerZoomFactor で作成したレイヤーの一部パラメータは 他のオペレーターを使用して設定や取得ができます。 次の表は、どのパラメータが set_dl_model_layer_paramSetDlModelLayerParam で設定でき、 どのパラメータが get_dl_model_layer_paramGetDlModelLayerParam またはget_dl_layer_paramGetDlLayerParamで取得できるかを示しています。 なお、 set_dl_model_layer_paramSetDlModelLayerParam と get_dl_model_layer_paramGetDlModelLayerParam は create_dl_modelCreateDlModelで作成されたモデルが必要です。

レイヤーパラメーター set get
'align_corners'"align_corners" (AlignCornersalignCornersalign_corners) x x
'coordinate_transformation_mode'"coordinate_transformation_mode" x x
'input_layer'"input_layer" (DLLayerInputDLLayerInputdllayer_input) x
'interpolation_mode'"interpolation_mode" (Interpolationinterpolationinterpolation) x
'name'"name" (LayerNamelayerNamelayer_name) x x
'nearest_mode'"nearest_mode" x x
'output_layer'"output_layer" (DLLayerZoomDLLayerZoomdllayer_zoom) x
'scale_params'"scale_params" (ScaleWidthscaleWidthscale_width and ScaleHeightscaleHeightscale_height) x
'shape'"shape" x
'type'"type" x
汎用レイヤーパラメーター set get
'is_inference_output'"is_inference_output" x x
'num_trainable_params'"num_trainable_params" x

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

DLLayerInputDLLayerInputdllayer_input (input_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (handle)

(作成時に入力として)与えられるレイヤー

LayerNamelayerNamelayer_name (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

アウトプットレイヤーの名前

ScaleWidthscaleWidthscale_width (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

レイヤーの出力/入力比率の幅

初期値: 2.02.0

ScaleHeightscaleHeightscale_height (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

レイヤーの出力/入力比率の高さ

初期値: 2.02.0

Interpolationinterpolationinterpolation (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

補間のモード

初期値: 'bilinear'"bilinear"
値のリスト: 'bilinear', 'nearest_neighbor'"bilinear", "nearest_neighbor"

AlignCornersalignCornersalign_corners (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

アウトプット/インプット画像間の座標変換の種類

初期値: 'false'"false"
値のリスト: 'false', 'true'"false", "true"

GenParamNamegenParamNamegen_param_name (input_control) attribute.name(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

汎用パラメータの名前

初期値: [][]
値のリスト: 'coordinate_transformation_mode', 'is_inference_output', 'nearest_mode'"coordinate_transformation_mode", "is_inference_output", "nearest_mode"

GenParamValuegenParamValuegen_param_value (input_control) attribute.value(-array) → (string / integer / real)HTuple (HString / Hlong / double)HTuple (string / int / long / double)MaybeSequence[Union[int, float, str]]Htuple (char* / Hlong / double)

汎用パラメータの値

初期値: [][]
推奨値: 'align_corners', 'asymmetric', 'pytorch_half_pixel', 'half_pixel', 'true', 'false', 'ceil', 'floor', 'round_prefer_ceil', 'round_prefer_floor'"align_corners", "asymmetric", "pytorch_half_pixel", "half_pixel", "true", "false", "ceil", "floor", "round_prefer_ceil", "round_prefer_floor"

DLLayerZoomDLLayerZoomdllayer_zoom (output_control) dl_layer → (handle)HTuple (HHandle)HDlLayer, HTuple (IntPtr)HHandleHtuple (handle)

ズームレイヤー

他のオペレーターとの組み合わせ🔗

組み合わせ

他の選択候補

create_dl_layer_zoom_sizeCreateDlLayerZoomSize, create_dl_layer_zoom_to_layer_sizeCreateDlLayerZoomToLayerSize

モジュール🔗

Deep Learning Professional