efficientbioai


Nameefficientbioai JSON
Version 0.0.6 PyPI version JSON
download
home_page
Summaryefficientbioai is a python package for efficient deep learning in bioimaging
upload_time2023-04-25 16:29:40
maintainer
docs_urlNone
authormmv_lab team
requires_python>=3.8
license
keywords deep learning quantization microscopy model compression
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/MMV-Lab/mmv_im2im),[cellpose](https://github.com/MouseLand/cellpose)). Also user-defined pytorch models are supported.

## Installation:
### pip:
First create a virtual environment using conda:
```bash
conda config --add channels conda-forge
conda create -n efficientbioai python=3.8 setuptools=59.5.0
```
Then we need to install the dependencies:
```bash
git clone git@github.com:ModelTC/MQBench.git
cd MQBench
python setup.py install
cd ..
```
Then install the `efficientbioai` package:

```bash
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:
```bash
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:
```bash
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:
 ```bash
python efficientbioai/compress.py --config path/to/the/config.yaml --exp_path experiment/save_path
```
- inference:
```bash
python efficientbioai/inference.py --config path/to/the/config.yaml
```
### Use functions:
There is a simple [example](tutorial/compress_custom_network.ipynb)


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. 


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "efficientbioai",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "deep learning,quantization,microscopy model compression",
    "author": "mmv_lab team",
    "author_email": "yu.zhou@isas.de",
    "download_url": "https://files.pythonhosted.org/packages/95/d0/405ebc3422a162cbb4c6508fa382765c56e93c2c1a202f0ebe979404f865/efficientbioai-0.0.6.tar.gz",
    "platform": null,
    "description": "# EfficientBioAI\nThis package mainly focus on the efficiency of BioImage AI tasks. For the moment we just implemented quantization algorithm.\n\n## Introduction:\nThe 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.   \nWe support several popular bioimage AI tools like([mmv_im2im](https://github.com/MMV-Lab/mmv_im2im),[cellpose](https://github.com/MouseLand/cellpose)). Also user-defined pytorch models are supported.\n\n## Installation:\n### pip:\nFirst create a virtual environment using conda:\n```bash\nconda config --add channels conda-forge\nconda create -n efficientbioai python=3.8 setuptools=59.5.0\n```\nThen we need to install the dependencies:\n```bash\ngit clone git@github.com:ModelTC/MQBench.git\ncd MQBench\npython setup.py install\ncd ..\n```\nThen install the `efficientbioai` package:\n\n```bash\ngit clone git@github.com:MMV-Lab/EfficientBioAI.git\ncd EfficientBioAI\npip install -e .[cpu/gpu/all] # for intel cpu, nvidia gpu or both\n```\n\n### docker:(recommended)\nWe use different docker images for both cpu and gpu. Assume that you are in the root directory of the project.\n- for CPU:\n```bash\ncd docker/cpu\nbash install.sh # if not install docker, run this command first\nbash build_docker.sh # build the docker image\ncd ../..\nbash docker/cpu/run_container.sh #run the docker container\n```\n- for GPU:\n```bash\ncd docker/gpu\nbash install.sh # if not install docker, run this command first\nbash build_docker.sh # build the docker image\ncd ../..\nbash docker/gpu/run_container.sh #run the docker container\n```\n\n## How to run it:\n### Use scripts:\n- compression:\n ```bash\npython efficientbioai/compress.py --config path/to/the/config.yaml --exp_path experiment/save_path\n```\n- inference:\n```bash\npython efficientbioai/inference.py --config path/to/the/config.yaml\n```\n### Use functions:\nThere is a simple [example](tutorial/compress_custom_network.ipynb)\n\n\nNote 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. \n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "efficientbioai is a python package for efficient deep learning in bioimaging",
    "version": "0.0.6",
    "split_keywords": [
        "deep learning",
        "quantization",
        "microscopy model compression"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c12a8d0fca8d0402c651ee5400fb46835474a89a2bbda1ac7a41d92631ceea52",
                "md5": "0299131a0942b092d37af018d12c9e70",
                "sha256": "024086081b51a1897378f66c62b3f045dde111e898d280f69e6f014e6237bf9a"
            },
            "downloads": -1,
            "filename": "efficientbioai-0.0.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0299131a0942b092d37af018d12c9e70",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.8",
            "size": 24618,
            "upload_time": "2023-04-25T16:29:38",
            "upload_time_iso_8601": "2023-04-25T16:29:38.480170Z",
            "url": "https://files.pythonhosted.org/packages/c1/2a/8d0fca8d0402c651ee5400fb46835474a89a2bbda1ac7a41d92631ceea52/efficientbioai-0.0.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95d0405ebc3422a162cbb4c6508fa382765c56e93c2c1a202f0ebe979404f865",
                "md5": "401c488d36417039d4fab4649d5e78dc",
                "sha256": "7f388e674e828535836910d874671771fea74021fb95a9dfbb44efcb54f34749"
            },
            "downloads": -1,
            "filename": "efficientbioai-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "401c488d36417039d4fab4649d5e78dc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 19515,
            "upload_time": "2023-04-25T16:29:40",
            "upload_time_iso_8601": "2023-04-25T16:29:40.119714Z",
            "url": "https://files.pythonhosted.org/packages/95/d0/405ebc3422a162cbb4c6508fa382765c56e93c2c1a202f0ebe979404f865/efficientbioai-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-25 16:29:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "efficientbioai"
}
        
Elapsed time: 0.07818s