# CoTr
**Repository Path**: RitchieAlpha/CoTr
## Basic Information
- **Project Name**: CoTr
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: GPL-3.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-09-03
- **Last Updated**: 2022-04-28
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
## CoTr: Efficient 3D Medical Image Segmentation by bridging CNN and Transformer
This is the official pytorch implementation of the CoTr:
**Paper: [CoTr: Efficient 3D Medical Image Segmentation
by bridging CNN and Transformer](https://arxiv.org/pdf/2103.03024.pdf
).**
## Requirements
CUDA 11.0
Python 3.7
Pytorch 1.7
Torchvision 0.8.2
## Usage
### 0. Installation
* Install Pytorch1.7, nnUNet and CoTr as below
```
pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html
cd nnUNet
pip install -e .
cd CoTr_package
pip install -e .
```
### 1. Data Preparation
* Download [BCV dataset](https://www.synapse.org/#!Synapse:syn3193805/wiki/217789)
* Preprocess the BCV dataset according to the uploaded nnUNet package.
* Training and Testing ID are in `data/splits_final.pkl`.
### 2. Training
cd CoTr_package/CoTr/run
* Run `nohup python run_training.py -gpu='0' -outpath='CoTr' 2>&1 &` for training.
### 3. Testing
* Run `nohup python run_training.py -gpu='0' -outpath='CoTr' -val --val_folder='validation_output' 2>&1 &` for validation.
### 4. Citation
If this code is helpful for your study, please cite:
```
@article{xie2021cotr,
title={CoTr: Efficiently Bridging CNN and Transformer for 3D Medical Image Segmentation},
author={Xie, Yutong and Zhang, Jianpeng and Shen, Chunhua and Xia, Yong},
booktitle={MICCAI},
year={2021}
}
```
### 5. Acknowledgements
Part of codes are reused from the [nnU-Net](https://github.com/MIC-DKFZ/nnUNet). Thanks to Fabian Isensee for the codes of nnU-Net.
### Contact
Yutong Xie (xuyongxie@mail.nwpu.edu.cn)