-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update? #23
Comments
Hi @rsignell-usgs! I've worked last week on implementing a way to export the doodles to SVG, I still need to finish this up and push it to the repo. Another work I've started to address and discuss with Philipp is to add Orthogonal to these tasks is the task to hand over this repo/project to you. One thing to note is the segmentation code that this repo has is pretty much the code that lives in https://github.com/Doodleverse/dash_doodler, I just had to refactor it a little to avoid parts of the dash dashboard features leaking into the segmentation functions. Ideally we wouldn't have this code duplication. How would you like this transition to happen? If the dash and holo doodler apps are both meant to be in use, it'd make sense to have the segmentation code live in its own repo (and eventually published as a package). @jbednar and @dbuscombe-usgs, happy to get your input on this matter! |
I agree that the doodler "engine" should probably live in its own repo and eventually published as a standalone package. I could work on this. I am familiar with packaging for pip |
another outstanding issue is the pydensecrf conda-forge build being quite old, which (from memory) is limiting us to python 3.6. https://anaconda.org/conda-forge/pydensecrf @rsignell-usgs am I correct in thinking that you were responsible for this conda-forge build? (It was for the 2018 CDI class that I taught) |
Ok, sounds good. We'll hand over the task of extracting the "engine" and dealing with pydensecrf to you, and should have a final report later this week (though we can still engage on questions and smaller changes after that). |
On - pip:
- git+https://github.com/li-plus/pydensecrf.git@0d53acbcf5123d4c88040fe68fbb9805fc5b2fb9 Other solutions include:
Thanks Dan for suggesting to take care of creating the core segmentation package! You can see in the code in this repo how I've interfaced the app to the core segmentation. I'm basically just using two functions from the core: from .segmentation.annotations_to_segmentations import label_to_colors
from .segmentation.image_segmentation import segmentation And use them as follows: def _compute_segmentation(self):
# Get the doodles from the drawer component
doodles = self.doodle_drawer.doodles
# Rescale the vectorized doodles from their [(0,1),(0,1)] space to pixels
img_height, img_width, _ = self.input_image.array.shape
projected_doodles = project_doodles(
doodles,
x_cur_range=self.input_image.plot.range('x'),
y_cur_range=self.input_image.plot.range('y'),
x_target_range=(0, img_width),
y_target_range=(0, img_height),
)
# Turn the vectorized doodles into a mask array (this is using Pillow)
self._mask_doodles = doodles_as_array(
projected_doodles,
img_width=img_width,
img_height=img_height,
colormap=self.doodle_drawer.colormap,
)
# Compute the segmentation using core
self._segmentation = segmentation(
img=self.input_image.array,
mask=self._mask_doodles,
**self.settings.as_dict(),
)
# Colorize the segmentation using core
self._segmentation_color = label_to_colors(
self._segmentation,
self.input_image.array[:, :, 0] == 0,
colormap=self.doodle_drawer.colormap,
color_class_offset=-1,
)
# Display the colorized segmentation on top of the image
hv_segmentation_color = hv.RGB(self._segmentation_color, bounds=(-1, -1, 1, 1)).opts(alpha=0.5)
self._img_pane.object = self._img_pane.object * hv_segmentation_color I don't know to which extent the core in this repo has diverged from the core in dash_doodler. What I remember:
I'll be available to test the new core when it is in a repo/released. |
@maximlt can you give us an update on where we are?
The project was supposed to be over by now and we are running into problems with the funds.
Also we could really use the tool!
The text was updated successfully, but these errors were encountered: