Metadata-Version: 2.3
Name: mdai
Version: 0.16.0
Summary: MD.ai Python client library
License: Apache-2.0
Author: MD.ai
Author-email: github@md.ai
Requires-Python: >=3.9
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: PyYAML (>=6.0.2,<7.0.0)
Requires-Dist: arrow (>=1.3.0,<2.0.0)
Requires-Dist: dicom2nifti (<2.6.0) ; python_version < "3.10"
Requires-Dist: dicom2nifti (>=2.6.0) ; python_version >= "3.10"
Requires-Dist: matplotlib (>=3.9.0,<4.0.0)
Requires-Dist: nibabel (>=5.3.0,<6.0.0)
Requires-Dist: numpy (>=2.0.0,<3.0.0)
Requires-Dist: opencv-python (>=4.10.0.84,<5.0.0.0)
Requires-Dist: pandas (>=2.2.0,<3.0.0)
Requires-Dist: pillow (>=11.0.0,<12.0.0)
Requires-Dist: pydicom (>=2.4.4)
Requires-Dist: requests (>=2.32.0,<3.0.0)
Requires-Dist: retrying (>=1.3.4,<2.0.0)
Requires-Dist: scikit-image (>=0.22.0,<1.0.0)
Requires-Dist: tqdm (>=4.66.5,<5.0.0)
Project-URL: Documentation, https://docs.md.ai/annotator/python/installation/
Project-URL: Homepage, https://github.com/mdai/mdai-client-py
Project-URL: Repository, https://github.com/mdai/mdai-client-py
Description-Content-Type: text/markdown

# MD.ai Python Client Library

The python client library is designed to work with the datasets and annotations generated by the [MD.ai](https://www.md.ai/) Medical AI platform.

You can download datasets consisting of images and annotations (i.e., JSON file), create train/validation/test datasets, integrate with various machine learing libraries (e.g., TensorFlow/Keras, Fast.ai) for developing machine learning algorithms.

To get started, check out the examples in the [notebooks section](notebooks), or our [intro to deep learning for medical imaging lessons](https://github.com/mdai/ml-lessons/).

## Installation

Requires Python 3.9+. Install and update using [pip](https://pip.pypa.io/en/stable/getting-started/):

```sh
pip install --upgrade mdai
```

## Documentation

Documentation is available at: https://docs.md.ai/annotator/python/installation/

## MD.ai Annotator

The MD.ai annotator is a powerful web based application, to store and view anonymized medical images (e.g, DICOM) on the cloud, create annotations collaboratively, in real-time, and export annotations, images and labels for training. The MD.ai python client library can be used to download images and annotations, prepare the datasets, and then used to train and evaluate deep learning models.

- MD.ai Annotator Documentation and Videos: https://docs.md.ai/annotator/
- MD.ai Annotator Example Project: https://public.md.ai/annotator/project/aGq4k6NW/workspace

## MD.ai Annotation JSON Format

More detailed information regarding the annotation JSON export format, see: https://docs.md.ai/annotator/data/json/

## Example Notebooks

- [HelloWorld Keras Notebook](notebooks/hello-world-keras.ipynb)
- [HelloWorld TFRecords Notebook](notebooks/hello-world-tfrecords-VGG16.ipynb)
- [HelloWorld Fast.ai](notebooks/hello-world-fastai.ipynb)

## Introductory lessons to Deep Learning for medical imaging by [MD.ai](https://www.md.ai)

The following are several Jupyter notebooks covering the basics of downloading and parsing annotation data, and training and evaluating different deep learning models for classification, semantic and instance segmentation and object detection problems in the medical imaging domain. The notebooks can be run on Google's colab with GPU (see instruction below).

- Lesson 1. Classification of chest vs. adominal X-rays using TensorFlow/Keras [Github](https://github.com/mdai/ml-lessons/blob/master/lesson1-xray-images-classification.ipynb) | [Annotator](https://public.md.ai/annotator/project/PVq9raBJ)
- Lesson 2. Lung X-Rays Semantic Segmentation using UNets. [Github](https://github.com/mdai/ml-lessons/blob/master/lesson2-lung-xrays-segmentation.ipynb) |
  [Annotator](https://public.md.ai/annotator/project/aGq4k6NW/workspace)
- Lesson 3. RSNA Pneumonia detection using Kaggle data format [Github](https://github.com/mdai/ml-lessons/blob/master/lesson3-rsna-pneumonia-detection-kaggle.ipynb) | [Annotator](https://public.md.ai/annotator/project/LxR6zdR2/workspace)
- Lesson 3. RSNA Pneumonia detection using MD.ai python client library [Github](https://github.com/mdai/ml-lessons/blob/master/lesson3-rsna-pneumonia-detection-mdai-client-lib.ipynb) | [Annotator](https://public.md.ai/annotator/project/LxR6zdR2/workspace)

## Contributing

See [contributing guidelines](CONTRIBUTING.md) to set up a development environemnt and how to make contributions to mdai.

## Running Jupyter notebooks Colab

It’s easy to run a Jupyter notebook on Google's Colab with free GPU use (time limited).
For example, you can add the Github jupyter notebook path to https://colab.research.google.com/notebook:
Select the "GITHUB" tab, and add the Lesson 1 URL: https://github.com/mdai/ml-lessons/blob/master/lesson1-xray-images-classification.ipynb

To use the GPU, in the notebook menu, go to Runtime -> Change runtime type -> switch to Python 3, and turn on GPU. See more [colab tips.](https://www.kdnuggets.com/2018/02/essential-google-colaboratory-tips-tricks.html)

---

&copy; 2025 MD.ai, Inc.

