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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file efficientbioai-0.0.6.tar.gz
.
File metadata
- Download URL: efficientbioai-0.0.6.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f388e674e828535836910d874671771fea74021fb95a9dfbb44efcb54f34749 |
|
MD5 | 401c488d36417039d4fab4649d5e78dc |
|
BLAKE2b-256 | 95d0405ebc3422a162cbb4c6508fa382765c56e93c2c1a202f0ebe979404f865 |
File details
Details for the file efficientbioai-0.0.6-py2.py3-none-any.whl
.
File metadata
- Download URL: efficientbioai-0.0.6-py2.py3-none-any.whl
- Upload date:
- Size: 24.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.16
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 024086081b51a1897378f66c62b3f045dde111e898d280f69e6f014e6237bf9a |
|
MD5 | 0299131a0942b092d37af018d12c9e70 |
|
BLAKE2b-256 | c12a8d0fca8d0402c651ee5400fb46835474a89a2bbda1ac7a41d92631ceea52 |