Skip to main content

efficientbioai is a python package for efficient deep learning in bioimaging

Project description

EfficientBioAI

This package mainly focus on the efficiency of BioImage AI tasks. For the moment we just implemented quantization algorithm.

Introduction:

The whole project contains two parts: quantization and inference. In the quantization step, we quantize the pretrained model into int8 precision and transform them to the format suitable to the inference engine. The next step is to run the inference on the inference engine and do the analysis. The inference engine that we choose is openvino for intel CPU and tensorrt for nvidia GPU.
We support several popular bioimage AI tools like(mmv_im2im,cellpose). Also user-defined pytorch models are supported.

Installation:

pip:

First create a virtual environment using conda:

conda config --add channels conda-forge
conda create -n efficientbioai python=3.8 setuptools=59.5.0

Then we need to install the dependencies:

git clone git@github.com:ModelTC/MQBench.git
cd MQBench
python setup.py install
cd ..

Then install the efficientbioai package:

git clone git@github.com:MMV-Lab/EfficientBioAI.git
cd EfficientBioAI
pip install -e .[cpu/gpu/all] # for intel cpu, nvidia gpu or both

docker:(recommended)

We use different docker images for both cpu and gpu. Assume that you are in the root directory of the project.

  • for CPU:
cd docker/cpu
bash install.sh # if not install docker, run this command first
bash build_docker.sh # build the docker image
cd ../..
bash docker/cpu/run_container.sh #run the docker container
  • for GPU:
cd docker/gpu
bash install.sh # if not install docker, run this command first
bash build_docker.sh # build the docker image
cd ../..
bash docker/gpu/run_container.sh #run the docker container

How to run it:

Use scripts:

  • compression:
python efficientbioai/compress.py --config path/to/the/config.yaml --exp_path experiment/save_path
  • inference:
python efficientbioai/inference.py --config path/to/the/config.yaml

Use functions:

There is a simple example

Note that pretrained model and data should be placed in the model and data folders, respectively. You can download our mmv_im2im pretrained model from nextcloud. All the intermediate files will be saved in the experiment folder.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

efficientbioai-0.0.6.tar.gz (19.5 kB view hashes)

Uploaded Source

Built Distribution

efficientbioai-0.0.6-py2.py3-none-any.whl (24.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page