def fcn(split, tops):
n = caffe.NetSpec()
n.color, n.hha, n.label = L.Python(module='nyud_layers',
layer='NYUDSegDataLayer', ntop=3,
param_str=str(dict(nyud_dir='../data/nyud', split=split,
tops=tops, seed=1337)))
n = modality_fcn(n, 'color', 'color')
n = modality_fcn(n, 'hha', 'hha')
n.score_fused = L.Eltwise(n.score_frcolor, n.score_frhha,
operation=P.Eltwise.SUM, coeff=[0.5, 0.5])
n.upscore = L.Deconvolution(n.score_fused,
convolution_param=dict(num_output=40, kernel_size=64, stride=32,
bias_term=False),
param=[dict(lr_mult=0)])
n.score = crop(n.upscore, n.color)
n.loss = L.SoftmaxWithLoss(n.score, n.label,
loss_param=dict(normalize=False, ignore_label=255))
return n.to_proto()
评论列表
文章目录