-
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
point features will save as rasters #6
Conversation
Tested with
and
Exited cleanly, no exceptions raised. f1 scores were |
src/pipeline_steps.py
Outdated
io.saveGeoTiff(filepath, feature_mask, map_data.georef.crs, map_data.georef.transform) | ||
if feature.type == MapUnitType.POLYGON: | ||
if map_data.poly_segmentation_mask is None: | ||
#pipeline_manager.log(logging.WARNING, f'Can\'t validate feature {feature.label}. No predicted segmentation mask present.') |
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.
You can use both types of quotes in this case.
#pipeline_manager.log(logging.WARNING, f'Can\'t validate feature {feature.label}. No predicted segmentation mask present.') | |
#pipeline_manager.log(logging.WARNING, f"Can't validate feature {feature.label}. No predicted segmentation mask present.") |
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.
LGTM some small comments.
src/pipeline_steps.py
Outdated
feature_mask[map_data.poly_segmentation_mask == legend_index] = 1 | ||
filepath = os.path.join(output_dir, sanitize_filename(f'{map_data.name}_{feature.label}.tif')) | ||
io.saveGeoTiff(filepath, feature_mask, map_data.georef.crs, map_data.georef.transform) | ||
pipeline_manager.log(logging.DEBUG, f'{map_data.name}, {feature.label} {feature.type}') |
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.
do we still need this line?
filepath = os.path.join(output_dir, sanitize_filename(f'{map_data.name}_{feature.label}.tif')) | ||
io.saveGeoTiff(filepath, feature_mask, map_data.georef.crs, map_data.georef.transform) | ||
pipeline_manager.log(logging.DEBUG, f'{map_data.name}, {feature.label} {feature.type}') | ||
if feature.type == MapUnitType.POINT: |
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.
looks like most of the code is the same would it make sense to just use:
if feature.type == MapUnitType.POINT: | |
if feature.type == MapUnitType.POINT or feature.type == MapUnitType.POLYGON: |
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.
There was a small difference between the two blocks. map_data.poly_segmentation_mask
vs. map_data.point_segmentation_mask
. But there was redundant code in them too. Take a look now, I've made some adjustments.
No description provided.