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

Added option for SimpleInferer #428

Merged
merged 8 commits into from Jul 6, 2023
Merged

Conversation

vikashg
Copy link
Collaborator

@vikashg vikashg commented May 19, 2023

Added an option for SimpleInferer on monai_seg_inference_operator.py

@vikashg vikashg requested a review from MMelQin May 19, 2023 13:33
@vikashg
Copy link
Collaborator Author

vikashg commented Jun 1, 2023

@MMelQin Including StrEnum gives me an error for testing. If you can have a look that will be really helpful. Maybe I am using it wrong.

@MMelQin
Copy link
Collaborator

MMelQin commented Jun 1, 2023

@MMelQin Including StrEnum gives me an error for testing. If you can have a look that will be really helpful. Maybe I am using it wrong.

Yes, needs to define the class of type StrEnum before using it. Will suggest some code.

@vikashg
Copy link
Collaborator Author

vikashg commented Jun 2, 2023

Hi @MMelQin,
So I looked up Enum which is similar to StrEnum. There are existing examples like
image

But I don't know how this will help or enhance the existing code. Please let me know and I will fix it.
Thanks
Vikash

@MMelQin
Copy link
Collaborator

MMelQin commented Jun 3, 2023

Hi @MMelQin, So I looked up Enum which is similar to StrEnum. There are existing examples like image

But I don't know how this will help or enhance the existing code. Please let me know and I will fix it. Thanks Vikash

Another issue is that the MD App SDK requires Python version >= 3.7, for which the StrEnum is NOT available. This is why MONAI Core had its impl of StrEnum, as Eric mentioned.

For our use case, the relevant magic strings had not been used in the App SDK or app code, I think we can safely use Enum or IntEnum for now. However, the monai.utils.enums.py has already ported the StrEnum and noticed this class is already imported and used in this change, we'll use StrEnum.

I have pushed a couple changes to define and use the InfererType StrEnum along with updating a couple more arguments, as well as updating the app code to demonstrate the use of the InfererType. Please also try out the update with your simple inference application.

Vikash Gupta and others added 6 commits June 2, 2023 20:09
Signed-off-by: Vikash Gupta <gupta.vikash@mayo.edu>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: Vikash Gupta <gupta.vikash@mayo.edu>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: Vikash Gupta <gupta.vikash@mayo.edu>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: Vikash Gupta <gupta.vikash@mayo.edu>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Signed-off-by: M Q <mingmelvinq@nvidia.com>
@MMelQin MMelQin force-pushed the vikash/seg_inference_operator branch from b751c60 to 3437977 Compare June 3, 2023 03:09
@MMelQin MMelQin self-assigned this Jun 3, 2023
Signed-off-by: M Q <mingmelvinq@nvidia.com>
Copy link
Collaborator

@MMelQin MMelQin left a comment

Choose a reason for hiding this comment

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

LGTM

monai/deploy/operators/monai_seg_inference_operator.py Outdated Show resolved Hide resolved
monai/deploy/operators/monai_seg_inference_operator.py Outdated Show resolved Hide resolved
Signed-off-by: M Q <mingmelvinq@nvidia.com>
@sonarcloud
Copy link

sonarcloud bot commented Jun 3, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@MMelQin MMelQin merged commit 1437309 into main Jul 6, 2023
5 of 6 checks passed
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.

None yet

2 participants