mmagic.models.editors.inst_colorization.weight_layer
¶
Module Contents¶
Classes¶
Weight layer of the fusion_net. A small neural network with three |
Functions¶
|
Gets the normalization layer. |
- mmagic.models.editors.inst_colorization.weight_layer.get_norm_layer(norm_type='instance')[源代码]¶
Gets the normalization layer.
- 参数
norm_type (str) – Type of the normalization layer.
- 返回
normalization layer. Default: instance
- 返回类型
norm_layer (BatchNorm2d or InstanceNorm2d or None)
- class mmagic.models.editors.inst_colorization.weight_layer.WeightLayer(input_ch, inner_ch=16)[源代码]¶
Bases:
mmengine.model.BaseModule
Weight layer of the fusion_net. A small neural network with three convolutional layers to predict full-image weight map and perinstance weight map.
- 参数
input_ch (int) – Number of channels in the input image.
inner_ch (int) – Number of channels produced by the convolution. Default: True
- resize_and_pad(feauture_maps, info_array)[源代码]¶
Resize the instance feature as well as the weight map to match the size of full-image and do zero padding on both of them.
- 参数
feauture_maps (tensor) – Feature map
info_array (tensor) – The bounding box
- 返回
Feature maps after resize and padding
- 返回类型
feauture_maps (tensor)