portrait_matting
portrait_matting copied to clipboard
problem about code
# Increase gradient of the probability
prob = F.softmax(score, axis=1)
prob = prob - 0.5
prob = self.prob_scale(prob)
prob = F.clip(prob, -0.5, 0.5)
prob = prob + 0.5
#in __init__():
self.prob_scale = L.Scale(W_shape=(1,))
self.prob_scale.W.copydata(np.array([100.0]))
why you scale prob 100?
Why do you think its a problem @Devin147 ?
it is wrong. when you scale the prob, so after clip, all the prob are zero. i have check it. so i am sure it was wrong
@GuideWsp could you share solution to this problem. If it was found.
I change it as : prob = F.softmax(score, axis=1) prob = prob - 0.5 prob = F.clip(prob, -0.5, 0.5) prob = prob + 0.5
finaly, i have to abandon this algorithm because i really can't produce the result as the paper show. i email to the author, but got no answers.
Ok, thanks. I will try to fix it. Or.... Did you find other realizations of matting?
you can try "Deep Image Matting". if you give a relative good trimap, it will give a good results. but it isn't an automatic algorithm. i nearly give up this topic for som reasons. recently, i focus on semantic segmentation and the related topics.
I found the problem. This is due to the initialization of weights. fcn8s.py: kwargs = { 'initialW': chainer.initializers.Zeros(), 'initial_bias': chainer.initializers.Zerosl(), } fixed: kwargs = { 'initialW': chainer.initializers.Normal(), 'initial_bias': chainer.initializers.Normal(), }
maybe it's right. can you tell me when you get the results as the paper shown? thanks
Ok. I'll let you know when I get the results.
How to fixed this problem ? self.prob_scale.W.copydata(np.array([100.0])) @dsArtem
@dsArtem Hi, do you get a good result? I just cant't make the training convergence...
Brother, my three modes of training: $ python scripts/train.py --mode seg $ python scripts/train.py --mode seg+ $ python scripts/train.py --mode seg_tri
The training part looks normal, but the test was very bad and found: mode=seg mode=seg+ The test result is a gray picture
mode = seg_tri The test result is a white picture
My test command is:
$ python scripts/train.py --mode {seg,seg+,seg_tri} --model_path './result/model_best' -i
Can you see where I am using the error? such as:
- Is the model path I loaded correct?
- Like you said W B needs to be changed to standardized initialization
- Testing or training There is a particularly critical detail to note?
If you see a reply, I will be very grateful and happy!
@takiyu
@dsArtem
@Raj-08
@Devin147
@GuideWsp
@assertdebug
Hey @dsArtem is there a way to reach you by email? I think we could share some knowledge regarding this subject
Does anybody get the results as the paper shown?
@kkkmax why don't you try the last mode "mat"?