Skip to content

Commit 8f2c56c

Browse files
authored
Merge pull request #5 from M3DV/a3d
A3d
2 parents 17ef01f + 94109fc commit 8f2c56c

32 files changed

+925
-26
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<<<<<<< HEAD
21
#my setting
2+
*.so
33
.idea
44
*pycache*
55
*.pyc
@@ -18,8 +18,6 @@ to2dweights.py
1818
epoch_18.pth
1919
ttepoch_18.pth
2020
*.pth
21-
=======
22-
>>>>>>> 3ff8574077823c9bfc120ac9cd9dab9396a50bcc
2321
# Byte-compiled / optimized / DLL files
2422
__pycache__/
2523
*.py[cod]

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
* ``alignshift``
1616
the core implementation of AlignShift convolution and TSM convolution, including the operators, models, and 2D-to-3D/AlignShift/TSM model converters.
17-
* ``operators``: include AlignShiftConv, TSMConv.
18-
* ``converters.py``: include converters which convert 2D models to 3dConv/AlignShiftConv/TSMConv counterparts.
19-
* ``models``: Native AlignShift/TSM models.
17+
* ``operators``: include AlignShiftConv, TSMConv, A3DConv.
18+
* ``converters.py``: include converters which convert 2D models to 3DConv/AlignShiftConv/TSMConv/A3DConv counterparts.
19+
* ``models``: Native AlignShift/TSM/A3DConv models.
2020
* ``deeplesion``
2121
the experiment code is base on [mmdetection](https://github.com/open-mmlab/mmdetection)
2222
,this directory consists of compounents used in mmdetection.
@@ -51,10 +51,10 @@ thickness = torch.rand(batch_size, 1)
5151
out = m(x, thickness)
5252
```
5353

54-
## Usage of AlignShiftConv/TSMConv operators
54+
## Usage of AlignShiftConv/TSMConv/A3DConv operators
5555

5656
```python
57-
from alignshift.operators import AlignShiftConv, TSMConv
57+
from nn.operators import AlignShiftConv, TSMConv, A3DConv
5858
x = torch.rand(batch_size, 3, D, H, W)
5959
thickness = torch.rand(batch_size, 1)
6060
# AlignShiftConv to process 3D volumnes
@@ -63,12 +63,15 @@ out = conv(x, thickness)
6363
# TSMConv to process 3D volumnes
6464
conv = TSMConv(in_channels=3, out_channels=10, kernel_size=3, padding=1, n_fold=8, tsm=True)
6565
out = conv(x)
66+
# A3DConv to process 3D volumnes
67+
conv = A3DConv(in_channels=3, out_channels=10, kernel_size=3, padding=1, dimension=3)
68+
out = conv(x)
6669
```
6770

6871
## Usage of native AlignShiftConv/TSMConv models
6972

7073
```python
71-
from alignshift.models import DenseNetCustomTrunc3dAlign, DenseNetCustomTrunc3dTSM
74+
from nn.models import DenseNetCustomTrunc3dAlign, DenseNetCustomTrunc3dTSM
7275
net = DenseNetCustomTrunc3dAlign(num_classes=3)
7376
B, C_in, D, H, W = (1, 3, 7, 256, 256)
7477
input_3d = torch.rand(B, C_in, D, H, W)
@@ -109,6 +112,11 @@ output_3d = net(input_3d, thickness)
109112
```bash
110113
./deeplesion/train_dist.sh ./deeplesion/mconfig/densenet_tsm.py 2
111114
```
115+
* Train A3DConv models
116+
```bash
117+
./deeplesion/train_dist.sh ./deeplesion/mconfig/densenet_a3d.py 2
118+
```
119+
112120
* Evaluation
113121
```bash
114122
./deeplesion/eval.sh ${mmdetection script} ${checkpoint path}

alignshift/models/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

alignshift/operators/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

deeplesion/ENVIRON.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
data_root = '/mnt/data/DeepLesion/'
1+
data_root = '/mnt/data2/deeplesion/dataset/'

0 commit comments

Comments
 (0)