Skip to content

730 retinal oct rpd segmentation #748

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

Draft
wants to merge 15 commits into
base: dev
Choose a base branch
from

Conversation

ybagdasa
Copy link

Fixes # .

Description

This is a proposed segmentation model to add to the model zoo.

Status

Ready for review/work in progress.

Please ensure all the checkboxes:

  • Codeformat tests passed locally by running ./runtests.sh --codeformat.
  • In-line docstrings updated.
  • Update version and changelog in metadata.json if changing an existing bundle.
  • [ x] Please ensure the naming rules in config files meet our requirements (please refer to: CONTRIBUTING.md).
  • [x ] Ensure versions of packages such as monai, pytorch and numpy are correct in metadata.json.
  • [x ] Descriptions should be consistent with the content, such as eval_metrics of the provided weights and TorchScript modules.
  • [x ] Files larger than 25MB are excluded and replaced by providing download links in large_file.yml.
  • [ x] Avoid using path that contains personal information within config files (such as use /home/your_name/ for "bundle_root").

@ybagdasa
Copy link
Author

@yiheng-wang-nv here is my draft PR

@@ -0,0 +1,3 @@
# ensure that using evironment with python==3.9
pip install -r ./docs/requirements.txt #includes monai
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @ybagdasa , could you fix the commit for the detectron2 installation?

Copy link
Author

Choose a reason for hiding this comment

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

@yiheng-wang-nv Thanks for considering the contribution. For the detectron2 installation, what is the command I should run to replicate the error you're getting? I know that the install works for python<3.10. Could this be the source of the issue for the ci install checks?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @ybagdasa ,

For the comment of this line (python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'),
based on https://github.com/Project-MONAI/model-zoo/pull/748/files#diff-6d26dc7c0d9fa894d66c944bd9d0a7c970f95371163c70631b8d6b0ed790fc81R19 detectron2 0.6 is used, thus here we can modify the install command into:

python -m pip install 'git+https://github.com/facebookresearch/detectron2.git@v0.6'

Otherwise, the command will install the latest commit, which may have incompatible issues in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For the python version, can you confirm if python 3.9 is necessary?
I'm not 100% sure, but based on https://detectron2.readthedocs.io/en/latest/tutorials/install.html#requirements , it only requires to use python >= 3.7.

Currently, our repo uses python 3.10 in default for CI tests. If we do need python 3.9 for this bundle, I may consider some changes in the CI to support multiple python versions.

Copy link
Collaborator

Choose a reason for hiding this comment

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

For the CI error: https://github.com/Project-MONAI/model-zoo/actions/runs/14742610327/job/42137993317?pr=748#step:7:510 Let me push a commit to your branch to fix it. Since detectron2 cannot simply be installed via pip install detectron2, we should consider some changes in:
https://github.com/Project-MONAI/model-zoo/blob/dev/ci/get_bundle_requirements.py#L54

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since I don't have the permission to push to your forked repo directly, I pushed the changes into: https://github.com/Project-MONAI/model-zoo/tree/730-retinalOCT_RPD_segmentation, could you help to merge it?
The branch also fixed the pre-commit ci errors.

Then we can see if there are other issues in the dependencies.

Copy link
Author

Choose a reason for hiding this comment

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

For the python version, can you confirm if python 3.9 is necessary? I'm not 100% sure, but based on https://detectron2.readthedocs.io/en/latest/tutorials/install.html#requirements , it only requires to use python >= 3.7.

Currently, our repo uses python 3.10 in default for CI tests. If we do need python 3.9 for this bundle, I may consider some changes in the CI to support multiple python versions.

My attempts to build the detectron2 wheel failed with python 3.10 and it unfortunately seems to be a common issue with their repo: facebookresearch/detectron2#5445

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks, let me enable py3.9 in the CI

@yiheng-wang-nv
Copy link
Collaborator

Hi @ybagdasa , thanks for the PR contribution. For pre-commit CI errors, could you fix them? The auto-push seems cannot work since the branch is pushed from an organization account.

@yiheng-wang-nv
Copy link
Collaborator

@yiheng-wang-nv
Copy link
Collaborator

I will look at this PR later this week

@ybagdasa
Copy link
Author

Format test can be fixed according to: https://github.com/Project-MONAI/model-zoo/actions/runs/14742610314/job/42137993243?pr=748#step:7:67

@yiheng-wang-nv When running flake8 on the code it flags a lot of mixed-case naming conventions (N800 flags). A lot of the naming comes from the pycocotools api which used mixed-case naming for functions and variables. Having everything lowercase will probably hinder the readability of the code at this point. Is this a strict requirement or can I somehow skip it?

@@ -0,0 +1,3 @@
# ensure that using evironment with python==3.9
pip install -r ./docs/requirements.txt #includes monai
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may not need the requirements.txt file in the bundle, it's content is included in the metadata.json.
Our CI can generate the requirements file directly via: https://github.com/Project-MONAI/model-zoo/blob/dev/ci/get_bundle_requirements.py#L54

Signed-off-by: Yiheng Wang <vennw@nvidia.com>
@yiheng-wang-nv
Copy link
Collaborator

Format test can be fixed according to: https://github.com/Project-MONAI/model-zoo/actions/runs/14742610314/job/42137993243?pr=748#step:7:67

@yiheng-wang-nv When running flake8 on the code it flags a lot of mixed-case naming conventions (N800 flags). A lot of the naming comes from the pycocotools api which used mixed-case naming for functions and variables. Having everything lowercase will probably hinder the readability of the code at this point. Is this a strict requirement or can I somehow skip it?

Hi @ybagdasa , sorry I cannot see the error you mentioned, the error I saw is from isort, could you fix it first? Then we can see the other checks like black and flake8

@ybagdasa
Copy link
Author

@yiheng-wang-nv
I merged your changes with my fixes on my organization repo and gave you write privileges for the repo. I fixed all the formatting issues detected by runtests.sh except for the mixed-case ones from flake8. I also added torchvision to metadata.json since that is required.

Signed-off-by: Yiheng Wang <vennw@nvidia.com>
@yiheng-wang-nv
Copy link
Collaborator

Hi @ybagdasa , thanks for the updates and providing me the permissions. I pushed a commit to fix the black and pre-commit issues. Now, our CI can reach to the flake8 errors: https://github.com/Project-MONAI/model-zoo/actions/runs/15105923819/job/42454628204?pr=748

I think we can skip N802, N803 and N806 errors, but others may need to be solved

Signed-off-by: Yiheng Wang <vennw@nvidia.com>
@yiheng-wang-nv
Copy link
Collaborator

Hi @ybagdasa , thanks for the updates and providing me the permissions. I pushed a commit to fix the black and pre-commit issues. Now, our CI can reach to the flake8 errors: https://github.com/Project-MONAI/model-zoo/actions/runs/15105923819/job/42454628204?pr=748

I think we can skip N802, N803 and N806 errors, but others may need to be solved

Hi @ybagdasa , I updated, and could you help to resolve other issues? Like line too long (https://github.com/Project-MONAI/model-zoo/actions/runs/15106735909/job/42456940644?pr=748)

@ybagdasa
Copy link
Author

Hi @ybagdasa , thanks for the updates and providing me the permissions. I pushed a commit to fix the black and pre-commit issues. Now, our CI can reach to the flake8 errors: https://github.com/Project-MONAI/model-zoo/actions/runs/15105923819/job/42454628204?pr=748
I think we can skip N802, N803 and N806 errors, but others may need to be solved

Hi @ybagdasa , I updated, and could you help to resolve other issues? Like line too long (https://github.com/Project-MONAI/model-zoo/actions/runs/15106735909/job/42456940644?pr=748)

@yiheng-wang-nv I was able to do ./runtests.sh up through pytype. The error popped up here:
[163/167] check models.maisi_ct_generative.scripts.rectified_flow

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