Skip to main content

Large Scale 3d Convolution Net Inference

Project description

chunkflow

Build Status PyPI version Coverage Status

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

refer to lasio documentation.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

chunkflow-0.1.0-py2.py3-none-any.whl (2.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file chunkflow-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: chunkflow-0.1.0-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

Hashes for chunkflow-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7b2ff2bb88dc3796784d92f03b3b71b341081086c4a318c34386cff107952757
MD5 1071f7b9ec22ba1594cf5929b0f04f6e
BLAKE2b-256 fef2801ad547a08e94b578fa3c9d54e34bfb1894253cc91caca296c75d43a610

See more details on using hashes here.

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