Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boundary loss #112

Open
minushuang opened this issue Oct 24, 2024 · 3 comments
Open

boundary loss #112

minushuang opened this issue Oct 24, 2024 · 3 comments

Comments

@minushuang
Copy link

Hi, I find the ContourLoss weight value is 0 in both the matting and segment task.
can I set it to a positive value to strength the learning process for the edges when training the matting task or segment?

@ZhengPeng7
Copy link
Owner

Of course, but I'm not sure about its performance on your tasks. It didn't bring improvement on the DIS task I did.

@minushuang
Copy link
Author

ok thank u, I will have a try.

and an other question about the grad_map loss, I noticed that in the code, BCE loss is used for calculating gradient loss in default.

If I am training for matting, would it be better to use MSE instead?

the source code in train.py is

if config.out_ref:
    self.criterion_gdt = nn.BCELoss() if not config.use_fp16 else nn.BCEWithLogitsLoss()

for matting, may change to

if config.out_ref:
    self.criterion_gdt = nn.MSELoss() #config.use_fp16=False

I'm not sure if this is better, please could you provide some advice?

@ZhengPeng7
Copy link
Owner

Sure, it makes sense. You can try it. I am very glad to hear from you about the results!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants