Skip to content

Commit

Permalink
feat(Architectures): removed 2D ResNeXt image architecture support
Browse files Browse the repository at this point in the history
  • Loading branch information
muellerdo committed Feb 21, 2024
1 parent f6945b8 commit 979a660
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 217 deletions.
15 changes: 4 additions & 11 deletions aucmedi/neural_network/architectures/image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
from aucmedi.neural_network.architectures.image.resnet50v2 import ResNet50V2
from aucmedi.neural_network.architectures.image.resnet101v2 import ResNet101V2
from aucmedi.neural_network.architectures.image.resnet152v2 import ResNet152V2
# ResNeXt
from aucmedi.neural_network.architectures.image.resnext50 import ResNeXt50
from aucmedi.neural_network.architectures.image.resnext101 import ResNeXt101
# MobileNet
from aucmedi.neural_network.architectures.image.mobilenet import MobileNet
from aucmedi.neural_network.architectures.image.mobilenetv2 import MobileNetV2
Expand Down Expand Up @@ -86,8 +83,6 @@
"ResNet50V2": ResNet50V2,
"ResNet101V2": ResNet101V2,
"ResNet152V2": ResNet152V2,
"ResNeXt50": ResNeXt50,
"ResNeXt101": ResNeXt101,
"DenseNet121": DenseNet121,
"DenseNet169": DenseNet169,
"DenseNet201": DenseNet201,
Expand Down Expand Up @@ -153,8 +148,8 @@
For example:
```python
# for the image architecture "ResNeXt101"
architecture="2D.ResNeXt101"
# for the image architecture "ResNet101"
architecture="2D.ResNet101"
```
Architectures are based on the abstract base class [aucmedi.neural_network.architectures.arch_base.Architecture_Base][].
Expand All @@ -175,8 +170,6 @@
"ResNet50V2": "tf",
"ResNet101V2": "tf",
"ResNet152V2": "tf",
"ResNeXt50": "torch",
"ResNeXt101": "torch",
"DenseNet121": "torch",
"DenseNet169": "torch",
"DenseNet201": "torch",
Expand Down Expand Up @@ -237,8 +230,8 @@
For example:
```python
# for the image architecture "ResNeXt101"
# for the image architecture "ResNet101"
from aucmedi.neural_network.architectures import supported_standardize_mode
sf_norm = supported_standardize_mode["2D.ResNeXt101"]
sf_norm = supported_standardize_mode["2D.ResNet101"]
```
"""
82 changes: 0 additions & 82 deletions aucmedi/neural_network/architectures/image/resnext101.py

This file was deleted.

82 changes: 0 additions & 82 deletions aucmedi/neural_network/architectures/image/resnext50.py

This file was deleted.

42 changes: 0 additions & 42 deletions tests/test_architectures_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,48 +229,6 @@ def test_ResNet152V2(self):
self.assertTrue(supported_standardize_mode["ResNet152V2"] == "tf")
self.assertTrue(sdm_global["2D.ResNet152V2"] == "tf")

#-------------------------------------------------#
# Architecture: ResNeXt50 #
#-------------------------------------------------#
def test_ResNeXt50(self):
arch = ResNeXt50(Classifier(n_labels=4), channels=1,
input_shape=(32, 32))
model = NeuralNetwork(n_labels=4, channels=1, architecture=arch,
batch_queue_size=1)
model.predict(self.datagen_GRAY)
arch = ResNeXt50(Classifier(n_labels=4), channels=3,
input_shape=(32, 32))
model = NeuralNetwork(n_labels=4, channels=3, architecture=arch,
batch_queue_size=1)
model.predict(self.datagen_RGB)
model = NeuralNetwork(n_labels=4, channels=3, architecture="2D.ResNeXt50",
batch_queue_size=1, input_shape=(32, 32))
try : model.model.summary()
except : raise Exception()
self.assertTrue(supported_standardize_mode["ResNeXt50"] == "torch")
self.assertTrue(sdm_global["2D.ResNeXt50"] == "torch")

#-------------------------------------------------#
# Architecture: ResNeXt101 #
#-------------------------------------------------#
def test_ResNeXt101(self):
arch = ResNeXt101(Classifier(n_labels=4), channels=1,
input_shape=(32, 32))
model = NeuralNetwork(n_labels=4, channels=1, architecture=arch,
batch_queue_size=1)
model.predict(self.datagen_GRAY)
arch = ResNeXt101(Classifier(n_labels=4), channels=3,
input_shape=(32, 32))
model = NeuralNetwork(n_labels=4, channels=3, architecture=arch,
batch_queue_size=1)
model.predict(self.datagen_RGB)
model = NeuralNetwork(n_labels=4, channels=3, architecture="2D.ResNeXt101",
batch_queue_size=1, input_shape=(32, 32))
try : model.model.summary()
except : raise Exception()
self.assertTrue(supported_standardize_mode["ResNeXt101"] == "torch")
self.assertTrue(sdm_global["2D.ResNeXt101"] == "torch")

#-------------------------------------------------#
# Architecture: DenseNet121 #
#-------------------------------------------------#
Expand Down

0 comments on commit 979a660

Please sign in to comment.