Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/multimodal-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- cron: "0 4 * * *" # every day at 4 AM UTC

env:
pythonVersion: 3.7
pythonVersion: "3.10"
folder: hi-ml-multimodal
HIML_TENANT_ID: ${{ secrets.HIML_TENANT_ID }}
HIML_RESOURCE_GROUP: ${{ secrets.HIML_RESOURCE_GROUP }}
Expand Down
2 changes: 1 addition & 1 deletion hi-ml-multimodal/.mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version=3.7
python_version=3.10
scripts_are_modules=True
namespace_packages=True
show_traceback=True
Expand Down
1 change: 0 additions & 1 deletion hi-ml-multimodal/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
include LICENSE
include requirements_run.txt
include README.md
14 changes: 4 additions & 10 deletions hi-ml-multimodal/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
## Package management

# Create a Conda environment for this folder only
env:
conda env create --file environment.yml
pip install -r requirements_test.txt
pip install -r requirements_build.txt

# pip upgrade
pip_upgrade:
python -m pip install --upgrade pip

# pip upgrade and install build requirements
pip_build: pip_upgrade
pip install -r requirements_build.txt
pip install .[build]

# pip upgrade and install test requirements
pip_test: pip_upgrade
pip install -r requirements_test.txt
pip install .[test]

pip_publish: pip_upgrade
pip install --upgrade build twine
Expand All @@ -26,7 +20,8 @@ pip_local:
pip install -e .

# pip install everything for local development and testing
pip: pip_build pip_test pip_local
pip:
pip install -e .[dev]

## Actions

Expand All @@ -48,7 +43,6 @@ flake8:

# run mypy, assuming test requirements already installed
mypy:
mypy --install-types --show-error-codes --non-interactive setup.py
mypy --install-types --show-error-codes --non-interactive src
mypy --install-types --show-error-codes --non-interactive test_multimodal

Expand Down
2 changes: 1 addition & 1 deletion hi-ml-multimodal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The code is available on [GitHub][1] and [Hugging Face 🤗][6].
## Getting started

The best way to get started is by running the [phrase grounding notebook][2].
All the dependencies will be installed upon execution, so Python 3.7 and [Jupyter][3] are the only requirements to get started.
All the dependencies will be installed upon execution, so [Jupyter][3] is the only requirements to get started.

The notebook can also be run on [Binder][4], without the need to download any code or install any libraries:

Expand Down
14 changes: 0 additions & 14 deletions hi-ml-multimodal/environment.yml

This file was deleted.

5 changes: 5 additions & 0 deletions hi-ml-multimodal/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = [
"setuptools>=42",
]
build-backend = "setuptools.build_meta"
9 changes: 0 additions & 9 deletions hi-ml-multimodal/requirements_build.txt

This file was deleted.

8 changes: 0 additions & 8 deletions hi-ml-multimodal/requirements_run.txt

This file was deleted.

13 changes: 0 additions & 13 deletions hi-ml-multimodal/requirements_test.txt

This file was deleted.

74 changes: 74 additions & 0 deletions hi-ml-multimodal/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[metadata]
name = hi-ml-multimodal
version = 0.1.2
author = Biomedical Imaging Team @ Microsoft Health Futures
author_email = innereyedev@microsoft.com
url = https://github.com/microsoft/hi-ml
description = Microsoft Health Futures package to work with multi-modal health data
long_description = file: README.md
long_description_content_type = text/markdown
license_file = MIT License
platforms = OS Independent
classifiers =
Intended Audience :: Science/Research
Natural Language :: English
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Artificial Intelligence
Topic :: Scientific/Engineering :: Image Processing
Topic :: Scientific/Engineering :: Medical Science Apps.
Typing :: Typed
Development Status :: 3 - Alpha
License :: OSI Approved :: MIT License

[options]
install_requires =
huggingface-hub
matplotlib
pillow
pydicom
scikit-image
SimpleITK
torch
torchvision
transformers
python_requires = >=3.10,<3.11
include_package_data = True
zip_safe = False

[options.packages.find]
where = src

[options.extras_require]
dev =
%(build)s
%(test)s
bump2version
pre-commit
build =
docutils
myst-parser
sphinx
sphinx-autodoc-typehints
sphinx-automodapi
sphinx-rtd-theme
twine
test =
coverage
flake8
ipykernel
ipython
mypy
papermill
pycobertura
pytest
pytest-cov
pytest-rerunfailures
pytest-timeout

[bdist_wheel]
universal = 1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tempfile
from enum import Enum, unique
from pathlib import Path
from typing import List, Tuple, Union
from typing import List, Optional, Tuple, Union

import requests
from torchvision.datasets.utils import check_integrity
Expand Down Expand Up @@ -46,7 +46,7 @@ def _get_default_text_prompts_for_pneumonia() -> Tuple[List, List]:
return pos_query, neg_query


def save_img_from_url(image_url: str, local_path: Union[str, Path], md5: str = None) -> None:
def save_img_from_url(image_url: str, local_path: Union[str, Path], md5: Optional[str] = None) -> None:
"""
Pull an image from a URL and save it to a local path
"""
Expand Down
2 changes: 1 addition & 1 deletion readthedocs_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r build_requirements.txt
-r hi-ml/run_requirements.txt
-r hi-ml-azure/run_requirements.txt
-r hi-ml-multimodal/requirements_run.txt
./hi-ml-multimodal