-
Notifications
You must be signed in to change notification settings - Fork 168
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
findFeaturesSegment.py script fixes #5565
Conversation
@@ -134,7 +134,7 @@ def segment(img_path : Path, nlines : int = MAX_LEN): | |||
|
|||
def generate_cnet(params, images): | |||
|
|||
match_segment_n = images["match"]["Segment"] | |||
match_segment_n = images["match"][0]["Segment"] |
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.
Is this needed every time? Or only sometimes? I find it odd that it seemed to be working in some cases. Sometimes you have to check both cases.
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.
Hm very true, I'll have to add some sort of check then. Good catch.
@@ -197,7 +197,7 @@ def generate_cnet(params, images): | |||
log.debug(f"overlap stats: {ret.stdout}") | |||
|
|||
# first, throw it out if there is no overlap whatsoever | |||
is_pair_overlapping = not any([k[1].get("NoOverlap", "") == new_params["MATCH"] for k in stats]) | |||
is_pair_overlapping = any([k[1].get("NoOverlap", "") == new_params["MATCH"] for k in stats]) |
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.
bruh that's a pretty bad bug you caught there
x = match_segments.values() | ||
y = from_segments.values() | ||
x,y = (x,y) if len(x) > len(y) else (y,x) | ||
image_cartesian = list(itertools.product(x, y)) | ||
image_sets = [] | ||
for i in image_cartesian: | ||
if i[0][0]["Segment"] >= i[1]["Segment"]: | ||
image_sets.append(i) |
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.
How was this tested? There is some difference between the example I gave in the issue and how it would be implemented here. Just want to make sure it is working.
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.
So I added some print statements with the old image_sets
and image_sets
after this for loop for the two areas Lynn mentioned in here (I can point you to the data areas too) and the results are attached as image_set_sort_before.txt and image_set_sort_after.txt. It looks like both examples show the removal of a redundant pair, going from (1,1), (1,2), (2,1), (2,2)
to (1,1), (2,1), (2,2)
.
The updates were tested against post #5489 but did not produce a network when it should have. See comments there. |
The build and test suite have started for your pull request. View build logs for results. |
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5565". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
03bd425
to
238cdb4
Compare
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5565". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5565". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5565". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5565". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5565". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
False alarm, Lynn still wants to test some more |
Despite observations made via open post #5540, I think the latest version of the script is worth releasing. It's a great improvement over prior versions and further attempts to find the most suitable use cases will be easier for a user to try with the updated script and xml (containing reference to the new workdir parameter). It's a little difficult testing because of the xml disconnect. I think moving the segmented cub files from the working directory to /tmp (really not feasible due to NAC file sizes) or a specified workdir needs to be reverted, but that needs to be a new post. I think there is still an issue with creating a final network in some cases, but that needs another look and a new post. Barring running the script on very large dataset with images having many, many overlaps, I think the script is doing what it should better than before and could be useful for specific use cases. It would be nice to have access to the updates in the latest release if you all agree. |
The build and test suite have started for your pull request. To view your build log, please reference the build with source version: "PR_5565". Additionally, check the latest "dev" source version to identify existing test failures. Please note that you are not responsible for the test failures that exist on both your PR and the dev branch. |
@Kelvinrr Build looks good, test failures match dev's. |
Description
The process to retrieve the
from_segments
in this linefrom a
FROMLIST
that contains only one cube outputs this format:so accessing each segment as a list caused a
TypeError
.Added an if/else statement to account for
img_list = 1
sofrom_segments
ultimately outputs this:To reduce redundant overlapping image pairs, I implemented an iteration of @Kelvinrr's generic code with the change in the way the segments are accessed.
Related Issue
Addresses #5489 & #5540
How Has This Been Validated?
Types of changes
Checklist:
Licensing
This project is mostly composed of free and unencumbered software released into the public domain, and we are unlikely to accept contributions that are not also released into the public domain. Somewhere near the top of each file should have these words: