-
Notifications
You must be signed in to change notification settings - Fork 2
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
Implement gale shapley algorithm for label-matching #24
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.
Hi Johannes @jo-mueller ,
wow, cool stuff you're adding here. I have mostly questions about documentation.
Thanks!
Robert
Co-authored-by: Robert Haase <haesleinhuepf@users.noreply.github.com>
Co-authored-by: Robert Haase <haesleinhuepf@users.noreply.github.com>
@haesleinhuepf I think tests should now cover the new algorithm and the docstrings are in order for good documentation. Feel free to merge if you think it's fit. |
Hi @jo-mueller we have now conflicts with the documentation. Could you try to fix it and/or tell me how to do this? |
Hey @haesleinhuepf , in this case the conflicts came from rather minor differences in the docstrings of some functions. I think the easiest approach to address these conflicts is the following:
I fixed it for this case. |
For future reference: I think this is also a good reason why it could make sense to keep the documentation on a separate branch (github offers to default to |
Hi Johannes @jo-mueller , awesome! I just created issue #29 so that we keep track of the documentation issue. Otherwise, I would merge. Do you think it's ready? |
Yes :) |
Co-authored-by: Robert Haase <haesleinhuepf@users.noreply.github.com>
Merged. Thanks for sharing this amazing algorithm Johannes @jo-mueller ! |
Description
The preiously implemented strategy for label-matching based on picking the label with the respective highest intersection over union did not perform so nicely for complicated arrangements of overlapping labels. I implemented the Gale-Shapley algorithm to deal with such situations and I think it performs reasonably fast and well.
The previous version also removed the entries in the similarity matrix referring to the background. For the implementation of above algorithm it was easier to force-match the background in both images with wach other (setting
similarity_matrix[0,0]=1.0
instead of performing matching operations onsimilarity_matrix[1:, 1:]
. This required minor changes in the previous implementation ofmax_similarity(...)
matching.Note: The current implementation is rather long in terms of code - if you have suggestions for better implementations, let me know, I'll make this a draft in the meantime.
@zoccoler, feel free to have a look at the new code as well :)
Type of change
Tests
Final checks