Large Scale 3d Convolution Net Inference
Project description
chunkflow
patch by patch convolutional network inference with multiple frameworks including pytorch and pznet.
Introduction
3D convnet is state of the art approach to segment 3D images. Since single machine has limited computational power and RAM capacity, a large dataset can not fit in for one-time convnet inference especially for large complex networks. Hence, convnet inference should be decomposed to multiple patches and then stitch the patches together. The patches could be well distributed across machines utilizing the data level parallelism. However, there normally exist boundary effect of each patch since the image context around boundary voxels is missing. To reduce the boundary effect, the patches could be blended with some overlap. Overlap and blending could be easily handled in a single shared-memory machine, but not for distributed computation for terabyte or petabyte scale inference. This package was made to solve this problem. The solution is simply cropping the surrounding regions and stitch them together.
The boundary effect due to the cropping depends on the cropping size. If the cropping size is half of the patch size, there will be no boundary effect, but there is a lot of waste. In practise, we found that about 20%-25% of patch size is reasonably good enough.
Supported backends
- pytorch
- pznet
Terminology
- patch: the input/output 3D/4D array for convnet with typical size like 32x256x256.
- chunk: the input/output 3D/4D array after blending in each machine with typical size like 116x1216x1216.
- block: the final main output array of each machine which should be aligned with storage backend such as neuroglancer precomputed. The typical size is like 112x1152x1152.
Usage
Produce tasks
in scripts
,
python produce_tasks.py --help
launch worker to consume tasks
in the scripts
folder,
python consume_tasks.py --help
use specific GPU device
we can simply set an environment variable to use specific GPU device.
CUDA_VISIBLE_DEVICES=2 python consume_tasks.py
Development
Create a new release in PyPi
python setup.py bdist_wheel --universal
twine upload dist/my-new-wheel
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 Distributions
Built Distribution
File details
Details for the file chunkflow-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: chunkflow-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.23.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1275e49e29c9d40d60eb89b8789785f469b6e2fa7eed6323ddbd56bd176e2958 |
|
MD5 | 9bee52ee80abc214f596ef80a0739347 |
|
BLAKE2b-256 | 0804d31316e716c35345d1b690df1dc2ffbcb8e93d8246634891ad031b80e6d1 |