Coder Social home page Coder Social logo

nikky4d / cfcm-2d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from faustomilletari/cfcm-2d

0.0 2.0 0.0 42 KB

This repository contains a publicly available version of CFCM: segmentation via Coarse to Fine Context Memory, a paper accepted at MICCAI 2018 for presentation.

Python 100.00%

cfcm-2d's Introduction

CFCM

This repository contains a publicly available version of CFCM: segmentation via Coarse to Fine Context Memory, a paper accepted at MICCAI 2018 for presentation. An arXiv version of the paper is available here: https://arxiv.org/abs/1806.01413

In this repository we provide only training/validation code. In the future it will be possibile to use CFCM to obtain predictions on the Montgomery XRay lung dataset over the cloud using TOMAAT and a compatible client (for example through 3D Slicer and its TOMAAT extension).

The code is provided without guarantees of correctness and functionality. This implementation is derived directly from the original implementation used for the CFCM paper, but it has been modified in a way that can result in unexpected behaviors. Limited support will be given through the means offered by GitHub issues reporting system.

The experiments of the CFCM paper were run on NVIDIA DGX systems with either 16Gb or 32Gb GPUs. To the best of our knowledge most experiments can run on workstations with smaller GPUs such as 1080ti, and all the experiments can surely run on GPUs equipped with 24Gb of memory (Quadro P6000 and above).

Cite

If you use CFCM for your own research please cite our paper using this bibtext:

TODO

Local usage

Only recommended for development

Setup

  • install C++ dependencies

    • Ubuntu: sudo apt install python-opencv ffmpeg
  • (Recommended) create a python 2.7 virtual environment and activate it

virtualenv <path-to-virtualenv>
source <path-to-virtualenv>/bin/activate
  • install the python dependencies
pip install -r requirements.txt

Usage

  • activate the virtualenv
source <path-to-virtualenv>/bin/activate
  • run training or evaluation
python cfcm/train.py

Docker usage

This section describes the usage of docker-compose, which allows to avoid verbose shell commands. For a lower-level nvidia-docker experience, please refer to the later section "Usage without docker-compose".

Prerequisites

  • nvidia-container-runtime
  • docker-compose >= 1.20

Setup

Register the NVidia docker runtime

By default, docker-compose is not aware of the NVidia docker runtime, so running cfcm could lead to the following error:

ERROR: Cannot create container for service cfcm: Unknown runtime specified nvidia   

In order to fix it, create a file named /etc/docker/daemon.json with the following content:

{
    "runtimes": {
        "nvidia": {
            "path": "/usr/bin/nvidia-container-runtime",
            "runtimeArgs": []
        }
    }
}

In order to apply the changes, reload the service configuration and restart it:

sudo systemctl deamon-reload
sudo systemctl restart docker

Login into the NVidia container registry

This image builds on the official NVidia Tensorflow Docker image, which is hosted on the NVidia container registry. The registry requires authentication in order to download the base image.

docker login nvcr.io
  username: $oauthtoken 
  password: <YOUR API KEY>

In order to avoid having to login manually, you can use pass.

Usage with docker-compose

  • update env/local.env with the paths to this folder and to the data folder
  • do the same with the paths for your remote setup in env/remote.env

Local

docker-compose run cfcm

Remote

docker-compose -f docker-compose.yml -f docker-compose-remote.yml run cfcm

Usage without Docker compose

Prerequisites

  • nvidia-docker

Building

The following command builds a Docker image with all required dependencies, with the name "cfcm":

cd cfcm
nvidia-docker build -t cfcm .

Running an interactive shell

This command will start a bash shell in a container:

nvidia-docker run -it --rm --shm-size=1g --ulimit memlock=-1 --ulimit stack=67108864 cfcm bash

Acknowledgments

The code we provide in this repository is a refactoring of the original version. Most of the work for this refactoring has been done by Marco Esposito.

cfcm-2d's People

Contributors

faustomilletari avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.