Skip to content

Commit cab7adb

Browse files
14 Update readme and adjust the directory (#15)
* update readme and adjust the directory * add file size requirements in template * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update readme according to reviews * rename deepedit * update model naming requirements * add more naming examples * Update README.md update the contribute part Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 3dc730b commit cab7adb

File tree

21 files changed

+48
-53
lines changed

21 files changed

+48
-53
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ A few sentences describing the changes proposed in this pull request.
1313
- [ ] Update `version` and `changelog` in `metadata.json`.
1414
- [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`.
1515
- [ ] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules.
16+
- [ ] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`.

README.md

Lines changed: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,46 @@
11
# MONAI Model Zoo
22

33
MONAI Model Zoo hosts a collection of medical imaging models in the [MONAI Bundle](https://docs.monai.io/en/latest/bundle_intro.html) format.
4+
All source code of models (bundles) are tracked in `models/`, and for each distinct version of a bundle, it will be archived as a `.zip` file (named in the form of `bundle_name_version.zip`) and stored in `Releases`.
45

5-
## Model Storage
6-
Github limits the size of files allowed in the repository (see [About size limits on GitHub](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github)). Therefore, MONAI Model Zoo suggests to use Git Large File Storage (LFS) to store large files for any single file that is larger than **25MB**.
6+
## Model naming
77

8-
### Example of install Git LFS on Linux AMD64
9-
There are multiple ways to install Git LFS. For example, you can download [a suitable binary package](https://github.com/git-lfs/git-lfs/releases) and run `./install.sh` inside the downloaded package.
8+
The name of a bundle is suggested to contain its characteristics, such as include the task type and data type. The following are some of the examples:
109

11-
Takes the Linux AMD64 environment for instance, the commands are like the following (until May 11th 2022, the latest release is v3.1.4. The following commands may need to update for later releases):
1210
```
13-
wget https://github.com/git-lfs/git-lfs/releases/download/v3.1.4/git-lfs-linux-amd64-v3.1.4.tar.gz
14-
tar -xvf git-lfs-linux-amd64-v3.1.4.tar.gz
15-
bash install.sh
11+
spleen_deepedit_annotation
12+
spleen_ct_segmentation
13+
chest_xray_classification
14+
pathology_metastasis_detection
1615
```
17-
Please refer to the [official installing guide](https://github.com/git-lfs/git-lfs#installing) for more details.
1816

19-
### Example of push large files with Git LFS
17+
## Model storage
2018

21-
Usually, we use `git add` to add files for a commit. For a large file, we need to track it first, then `.gitattributes` will automatically be changed, and also need to be added. The following steps are the same as usual. The total commands are like the following:
19+
Github limits the size of files allowed in the repository (see [About size limits on GitHub](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github)). Therefore, MONAI Model Zoo limits each single file to be no larger than **25MB**.
20+
21+
### Prepare a config file for large files
22+
23+
If a bunlde has large files, please upload those files into a publicly accessible source, and provide a config file called `large_file.yml` (or `.yaml`, `.json`) that contains the corresponding download links. During the pull request, only the config file should be included (large files should be excluded). Please put the config file within the root directory of the bundle, and it should contain the following information:
24+
25+
1. `path`, relative path of the large file in the bundle.
26+
2. `url`, URL link that can download the file.
27+
3. `hash_val`, (**optional**) expected hash value of the file.
28+
4. `hash_type`, (**optional**) hash type. Supprted hash type includes "md5", "sha1", "sha256" and "sha512".
29+
30+
The template is as follow:
2231
```
23-
git lfs track "example_large_model.pt"
24-
git add .gitattributes
25-
git add example_large_model.pt
26-
git commit --signoff
27-
...
32+
large_files:
33+
- path: "models/large-file-1.pt"
34+
url: "url-of-large-file-1.pt"
35+
hash_val: ""
36+
hash_type: ""
37+
- path: "models/large-file-2.ts"
38+
url: "url-of-large-file-2.ts"
2839
```
29-
Please refer to the [official example usage](https://github.com/git-lfs/git-lfs#example-usage) for more details.
40+
41+
### Validate and release
42+
43+
As for a pull request, a CI program will try to download all large files if mentioned and do several validations. If the pull request is approved and merged, the full bundle (with all large files if exists) will be archived and send to [Releases](https://github.com/Project-MONAI/model-zoo/releases).
3044

3145
## Contributing
3246

@@ -41,15 +55,14 @@ Please refer to [MONAI Bundle Specification](https://docs.monai.io/en/latest/mb_
4155
All code changes to the dev branch must be done via [pull requests](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/proposing-changes-to-your-work-with-pull-requests).
4256
1. Please create a new ticket from [the issue list][monai model zoo issue list].
4357
1. [create a new branch in your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork)
44-
of the codebase named `[ticket_id]-[task_name]`.
58+
(**So far, as the internal used private repository, please create a new branch during this repository directly**) of the codebase named `[ticket_id]-[task_name]`.
4559
Ideally, the new branch should be based on the latest `dev` branch.
4660
1. Make changes to the branch ([use detailed commit messages if possible](https://chris.beams.io/posts/git-commit/)).
4761
1. [Create a new pull request](https://help.github.com/en/desktop/contributing-to-projects/creating-a-pull-request) from the task branch to the dev branch, with detailed descriptions of the purpose of this pull request.
48-
1. For any large files inside the bundle, please use [Git LFS commands](https://github.com/git-lfs/git-lfs/edit/main/README.md#example-usage) to track them properly.
49-
2. A pull request template is provided, and please address all related palces in the checklist.
50-
3. Wait for reviews; if there are reviews, make point-to-point responses, make further code changes if needed.
51-
4. If there are conflicts between the pull request branch and the dev branch, pull the changes from the dev and resolve the conflicts locally.
52-
5. Reviewer and contributor may have discussions back and forth until all comments addressed.
53-
6. Wait for the pull request to be merged.
62+
1. For any large files inside the bundle, please exclude them and provide the download links instead. Please follow the instructions mentioned above to prepare the necessary `large_file.yml`.
63+
1. Wait for reviews; if there are reviews, make point-to-point responses, make further code changes if needed.
64+
1. If there are conflicts between the pull request branch and the dev branch, pull the changes from the dev and resolve the conflicts locally.
65+
1. Reviewer and contributor may have discussions back and forth until all comments addressed.
66+
1. Wait for the pull request to be merged.
5467

5568
[monai model zoo issue list]: https://github.com/Project-MONAI/model-zoo/issues

models/annotation/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/annotation/deepedit/models/model.pt

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/annotation/deepedit/models/model.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/automl/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/classification/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/detection/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

models/federated_learning/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)