-
Notifications
You must be signed in to change notification settings - Fork 1
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
add mask to loss #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marouaneamz please see inline comments
I try to adapt the pipeline if there is no mask , but I can't do your method because we add the labels with the first if (if we haven't hardcoded the tasks here ), and in this block we add the labels and the maks we go through the whole results list and not all of them at once |
for k, v in results.items(): | ||
if k.endswith('_img_label'): | ||
task = k[:-10] | ||
gt_label[task] = to_tensor(v) | ||
elif k.endswith('_mask'): | ||
task = k[:-5] | ||
gt_mask[task] = v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for k, v in results.items(): | |
if k.endswith('_img_label'): | |
task = k[:-10] | |
gt_label[task] = to_tensor(v) | |
elif k.endswith('_mask'): | |
task = k[:-5] | |
gt_mask[task] = v | |
for k, v in results.items(): | |
if k.endswith('_img_label'): | |
task = k[:-10] | |
if task not in gt_label: | |
gt_label[task] = dict() | |
gt_label[task]['label'] = to_tensor(v) | |
elif k.endswith('_mask'): | |
task = k[:-5] | |
if task not in gt_label: | |
gt_label[task] = dict() | |
gt_label[task]['mask'] = v |
this pull request adds option of the mask to the loss which allows not to take into account images in the loss if they do not have labels for certain task