Skip to content
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 nice widgets callbacks #149

Merged
merged 16 commits into from
Apr 14, 2023
Merged

Conversation

lorenzocerrone
Copy link
Collaborator

@lorenzocerrone lorenzocerrone commented Apr 13, 2023

  • Add few magicguis callbacks to improve the user experience
  • Setup good default for widgets
  • Fix minor bug in headless
  • Check version at start and notify if there is a newer version (to be improved) Notify if a new plantseg release is out #145

@lorenzocerrone lorenzocerrone changed the title Add nices widgets callbacks Add nice widgets callbacks Apr 13, 2023
@lorenzocerrone
Copy link
Collaborator Author

fixes #142

Copy link
Collaborator

@wolny wolny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few minor points. looks great overall 👍

@@ -55,7 +55,7 @@ confocal_2D_unet_ovules_ds2x:
description: "2D Unet trained on z-slices of confocal images of Arabidopsis Ovules (1/2-resolution in XY) with BCEDiceLoss."
dimensionality: "2D"
modality: "confocal"
recommended_patch_size: [ 80, 170, 170 ]
recommended_patch_size: [ 1, 170, 170 ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here we should use [1, 256, 256]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, plus [ 80, 170, 170 ] > [ 80, 160, 160 ], because 170 sounds like a weird choice to me :)

@@ -101,7 +101,7 @@ lightsheet_2D_unet_root_ds1x:
description: "2D Unet trained on z-slices of light-sheet images of Lateral Root Primordia on original resolution with BCEDiceLoss."
dimensionality: "2D"
modality: "light-sheet"
recommended_patch_size: [ 80, 170, 170 ]
recommended_patch_size: [ 1, 170, 170 ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -119,7 +119,7 @@ lightsheet_2D_unet_root_nuclei_ds1x:
description: "2D Unet trained on z-slices of light-sheet images of Lateral Root Primordia nuclei on original resolution with BCEDiceLoss. The network predicts 2 channels: nuclei mask in the 1st channel, nuclei boundaries in the 2nd channel"
dimensionality: "2D"
modality: "light-sheet"
recommended_patch_size: [ 80, 170, 170 ]
recommended_patch_size: [ 1, 170, 170 ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

latest_version = response['tag_name']
latest_version_numeric = int(latest_version.replace('.', ''))
plantseg_version_numeric = int(current_version.replace('.', ''))
if latest_version_numeric > plantseg_version_numeric:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might not always work though :)
v2.0 > v1.5.1, but this code will convert it to 20 > 151 which is not correct. But assuming we always have major.minor.patch from the bumpversion this should be fine

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually true, also 1.5.11 > 1.6.0. I change it to make it much more robust

@@ -15,6 +15,8 @@ def parser():


def main():
from plantseg.utils import check_version
check_version()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be good to surround this with try-except clause in case there is a problem with github/network. We should not fail if external service is down

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it

@lorenzocerrone lorenzocerrone merged commit 3987240 into master Apr 14, 2023
@lorenzocerrone lorenzocerrone deleted the add_nices_widgets_callbacks branch April 14, 2023 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants