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

Support SAM2 (Inference only) as base model for all the apps #1777

Merged
merged 10 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,13 @@ jobs:
MONAI_ZOO_AUTH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: clean up
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
- name: Build
run: |
rm -rf /opt/hostedtoolcache
./runtests.sh --clean
docker system prune -f
DOCKER_BUILDKIT=1 docker build -t projectmonai/monailabel:${{ github.event.inputs.tag || 'latest' }} -f Dockerfile .
- name: Verify
run: |
./runtests.sh --clean
docker run --rm -i --ipc=host --net=host -v $(pwd):/workspace projectmonai/monailabel:${{ github.event.inputs.tag || 'latest' }} /workspace/runtests.sh --net
- name: Publish
run: |
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- if: runner.os == 'Linux'
name: Cleanup (Linux only)
run: |
rm -rf /opt/hostedtoolcache
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
Expand All @@ -59,6 +63,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
rm -rf /opt/hostedtoolcache
sudo apt-get install openslide-tools -y
python -m pip install --upgrade pip wheel
pip install -r requirements-dev.txt
Expand Down Expand Up @@ -107,9 +112,10 @@ jobs:
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install dependencies
run: |
rm -rf /opt/hostedtoolcache
sudo apt-get install openslide-tools -y
python -m pip install --user --upgrade pip setuptools wheel
python -m pip install torch>=1.7 torchvision
python -m pip install torch torchvision
- name: Build Package
run: |
./runtests.sh --clean
Expand Down Expand Up @@ -144,7 +150,7 @@ jobs:
MONAI_ZOO_AUTH_TOKEN: ${{ github.token }}
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Set up Python
Expand All @@ -165,6 +171,7 @@ jobs:
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install dependencies
run: |
rm -rf /opt/hostedtoolcache
sudo apt-get install openslide-tools -y
python -m pip install --upgrade pip wheel
python -m pip install -r docs/requirements.txt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ jobs:
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
- name: Install dependencies
run: |
rm -rf /opt/hostedtoolcache
sudo apt-get install openslide-tools -y
python -m pip install --user --upgrade pip setuptools wheel
python -m pip install torch>=1.7 torchvision
python -m pip install torch torchvision
- name: Build Package
run: |
rm -rf /opt/hostedtoolcache
./runtests.sh --clean
BUILD_OHIF=true python setup.py sdist bdist_wheel --build-number $(date +'%Y%m%d%H%M')
ls -l dist
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ In addition, you can find a table of the basic supported fields, modalities, vie
<li>Segmentation</li>
<li>DeepGrow</li>
<li>DeepEdit</li>
<li>SAM2 (2D/3D)</li>
</ul>
</td>
<td>
Expand Down Expand Up @@ -114,6 +115,7 @@ In addition, you can find a table of the basic supported fields, modalities, vie
<li>NuClick</li>
<li>Segmentation</li>
<li>Classification</li>
<li>SAM2 (2D)</li>
</ul>
</td>
<td>
Expand Down Expand Up @@ -143,6 +145,7 @@ In addition, you can find a table of the basic supported fields, modalities, vie
<li>DeepEdit</li>
<li>Tooltracking</li>
<li>InBody/OutBody</li>
<li>SAM2 (2D)</li>
</ul>
</td>
<td>
Expand All @@ -164,6 +167,12 @@ In addition, you can find a table of the basic supported fields, modalities, vie
<tr>
</table>

> [**SAM2**](https://github.com/facebookresearch/sam2/)
>
> By default, SAM2 is included for all the above Apps only when **_python >= 3.10_**
> - **sam_2d**: for any organ or tissue and others over a given slice/2D image.
> - **sam_3d**: to support SAM2 propagation over multiple slices (Radiology/MONAI-Bundle).

# Getting Started with MONAI Label
### MONAI Label requires a few steps to get started:
- Step 1: [Install MONAI Label](#step-1-installation)
Expand Down
Empty file added monailabel/sam2/__init__.py
Empty file.
Loading
Loading