本帖最后由 freekun139com 于 2024-9-20 11:40 编辑
https://github.com/bubbliiiing/unet-pytorch
参照PyTorch实现搭建分割网络模型, 有兴趣的参考一下
*默认图像大小WHC(512 * 512 * 1)
create_dl_layer_input ('segmentation_image_target', [ImageWidth,ImageHeight,ImageDepth], [], [], DLLayerImageTarget)
create_dl_layer_class_id_conversion (DLLayerImageTarget, 'target_internal', 'from_class_id', [], [], DLLayerTargetInternal)
create_dl_layer_input ('image', [ImageWidth,ImageHeight,ImageDepth], [], [], DLLayerImage)
create_dl_layer_input ('weight_image', [ImageWidth,ImageHeight,ImageDepth], [], [], DLLayerWeight)
**************************************** DW_SAMPLE ****************************************
*下采样第一次操作
*[512, 512, 3, 1] ==> [512, 512, 64, 1]
create_dl_layer_convolution (DLLayerImage, 'dw_sample_block1_conv1', 3, 1, 1, 64, 1, 1, 'relu', ['weight_filler'], ['const'], DLLayerConvolution)
*[512, 512, 64, 1] ==> [512, 512, 64, 1]
create_dl_layer_convolution (DLLayerConvolution, 'dw_sample_block1_conv2', 3, 1, 1, 64, 1, 1, 'relu', ['weight_filler'], ['const'], DLLayerConvolution1)
*下采样第二次操作
*[512, 512, 64, 1] ==> [256, 256, 64, 1]
create_dl_layer_pooling (DLLayerConvolution1, 'dw_sample_block2_pool', 2, 2, 'none', 'maximum', [], [], DLLayerPooling)
*[256, 256, 64, 1] ==> [256, 256, 128, 1]
create_dl_layer_convolution (DLLayerPooling, 'dw_sample_block2_conv1', 3, 1, 1, 128, 1, 1, 'relu', ['weight_filler'], ['const'], DLLayerConvolution2)
*[256, 256, 128, 1] ==> [256, 256, 128, 1]
create_dl_layer_convolution (DLLayerConvolution2, 'dw_sample_block2_conv2', 3, 1, 1, 128, 1, 1, 'relu', ['weight_filler'], ['const'], DLLayerConvolution3)
|