Skip to main content

PyTorch implementation of HighResNet

Project description

HighRes3DNet

License: MIT PyPI version DOI

PyTorch implementation of HighRes3DNet from Li et al. 2017, On the Compactness, Efficiency, and Representation of 3D Convolutional Networks: Brain Parcellation as a Pretext Task.

All the information about how the weights were ported from NiftyNet can be found in my submission to the MICCAI Educational Challenge 2019.

A 2D version (HighRes2DNet) is also available.

Installation

1. Install PyTorch

Within a conda environment:

$ conda create -n deepgif python -y
$ conda activate deepgif
(deepgif) $ conda install pytorch torchvision cudatoolkit=10.0 -c pytorch -y

2. Install the pip package

(deepgif) $ pip install highresnet
>>> from highresnet import HighRes3DNet
>>> model = HighRes3DNet(in_channels=1, out_channels=160)

Usage

PyTorch Hub

If you are using pytorch>=1.2.0, you can import the model directly from this repository using PyTorch Hub.

>>> import torch
>>> repo = 'fepegar/highresnet'
>>> model_name = 'highres3dnet'
>>> print(torch.hub.help(repo, model_name))

        "HighRes3DNet by Li et al. 2017 for T1-MRI brain parcellation"
        "pretrained (bool): load parameters from pretrained model"

>>> model = torch.hub.load(repo, model_name, pretrained=True)

Command line interface

(deepgif) $ deepgif t1_mri.nii.gz parcellation.nii.gz
Using cache found in /home/fernando/.cache/torch/hub/fepegar_highresnet_master
100%|███████████████████████████████████████████| 36/36 [01:13<00:00,  2.05s/it]

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

highresnet-0.5.1.tar.gz (10.8 kB view details)

Uploaded Source

File details

Details for the file highresnet-0.5.1.tar.gz.

File metadata

  • Download URL: highresnet-0.5.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.9

File hashes

Hashes for highresnet-0.5.1.tar.gz
Algorithm Hash digest
SHA256 692a0790df2247cb6e532e7a63f4739c09b0593e2da42f357127c7b7365e0d26
MD5 0585250deb3cb461174f82bfeb33e4d0
BLAKE2b-256 dcbe516deb78ec72f941d7cf3eacb9ce9d601df2075b05f8d96777f932de1ed1

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