Nondefaced-Detector
A framework to detect if a 3D MRI volume has been defaced.
Table of contents
- Installation
- Using pre-trained networks
- Reproducibility
- Paper
- Roadmap
- Questions or Issues
- Contributing
- License
- Contact
- Acknowledgements
Installation
Container
We recommend using the latest Nondefaced-detector docker container, which includes all the dependencies required for the framework.
GPU
The Nondefaced-detector GPU supported container uses the tensorflow-gpu as its base image. Please see the official tensorflow docker install page for all of the CUDA and NVIDIA driver requirements.
$ docker pull poldracklab/nondefaced-detector:latest-gpu
CPU
This container can be used on most systems that have Docker/Singularity installed.
$ docker pull poldracklab/nondefaced-detector:latest-cpu
NOTE: The CPU container will be very slow for training. We highly recommend that you use a GPU system.
Pip
$ pip install --no-cache-dir nondefaced-detector[cpu/gpu]
Using pre-trained networks
Pre-trained networks are avalaible in the Nondefaced-detector models repository. Prediction can be done using the nondefaced-detector CLI or in python.
From docker container installation
$ docker run --rm -v $PWD:/data nondefaced-detector:latest-cpu \
predict \
--model-path=$MODEL_PATH \
/data/example1.nii.gz
From pip installation
$ nondefaced-detector
Usage: nondefaced-detector [OPTIONS] COMMAND [ARGS]...
A framework to detect if a 3D MRI Volume has been defaced.
Options:
--version Show the version and exit.
--help Show this message and exit.
Commands:
convert Preprocess MRI volumes and convert to Tfrecords.
evaluate Evaluate a model's predictions against known labels.
info Return information about this system.
predict Predict labels from features using a trained model.
Reproducibility
Steps to reproduce inference results from the paper.
Step 1: Get the preprocessed dataset. You need to have datalad installed.
$ datalad clone https://gin.g-node.org/shashankbansal56/nondefaced-detector-reproducibility /opt/nondefaced-detector-reproducibility
$ cd /opt/nondefaced-detector-reproducibility
$ datalad get pretrained_weights/*
$ datalad get test_ixi/tfrecords/*
NOTE: To reproduce inference results from the paper, you only need to download the tfrecords.
Step 2: Depending on your system create a tensorflow-cpu/gpu virtual environment. We recommend using conda.
$ conda create -n tf-cpu tensorflow
$ conda activate tf-cpu
Step 3: Get the nondefaced-detector repo.
$ git clone https://github.com/poldracklab/nondefaced-detector.git
Step 4: Run the standalone inference script.
$ cd nondefaced-detector
$ pip install -e .
$ cd nondefaced_detector
$ python inference.py -h
usage: inference.py [-h] tfrecords_path model_path
positional arguments:
tfrecords_path Path to tfrecords.
model_path Path to pretrained model weights.
optional arguments:
-h, --help show this help message and exit
Paper
Roadmap
See the projects dashboard for a list of ongoing work and proposed features.
Questions or Issues
See the open issues for a list of known issues. If you have any questions or encounter any issues, please submit a github issue.
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the Apache 2.0 License. See LICENSE for more information.
Contact
Shashank Bansal - shashankbansal56@gmail.com
Acknowledgements
Training Dataset
The original model was trained on 980 defaced MRI scans from 36 different studies that are publicly available at OpenNeuro.org
Built With
Metadata
Release files for nondefaced-detector 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nondefaced-detector-0.1.3.tar.gz | 26.7 kB | Without provenance | Details for nondefaced-detector-0.1.3.tar.gz |
Release files / nondefaced-detector-0.1.3.tar.gz
| Download URL | nondefaced-detector-0.1.3.tar.gz |
|---|---|
| Size | 26.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b05406c7a56c48bb5cf231e5cc88f6125b29bf1af1634d23fcd8a475ea99b2f
|
|
BLAKE2b-256 checksum How to use checksums |
de82ac50be19e7f3f3d29c37bea03a1412d126cdc48d599363b27b0d8db4ad47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
|
Security for nondefaced-detector 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.