|
@@ -1,6 +1,5 @@
|
|
import unittest
|
|
import unittest
|
|
|
|
|
|
-from super_gradients.training import MultiGPUMode
|
|
|
|
from super_gradients.training import Trainer
|
|
from super_gradients.training import Trainer
|
|
from super_gradients.training.dataloaders import imagenet_val, imagenet_vit_base_val
|
|
from super_gradients.training.dataloaders import imagenet_val, imagenet_vit_base_val
|
|
from super_gradients.training.dataloaders.dataloaders import (
|
|
from super_gradients.training.dataloaders.dataloaders import (
|
|
@@ -228,13 +227,13 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
}
|
|
}
|
|
|
|
|
|
def test_pretrained_resnet50_imagenet(self):
|
|
def test_pretrained_resnet50_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_resnet50", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_resnet50")
|
|
model = models.get("resnet50", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("resnet50", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["resnet50"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["resnet50"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_resnet50_imagenet(self):
|
|
def test_transfer_learning_resnet50_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_resnet50_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_resnet50_transfer_learning")
|
|
model = models.get("resnet50", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("resnet50", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -244,14 +243,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_resnet34_imagenet(self):
|
|
def test_pretrained_resnet34_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_resnet34", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_resnet34")
|
|
|
|
|
|
model = models.get("resnet34", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("resnet34", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["resnet34"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["resnet34"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_resnet34_imagenet(self):
|
|
def test_transfer_learning_resnet34_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_resnet34_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_resnet34_transfer_learning")
|
|
model = models.get("resnet34", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("resnet34", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -261,14 +260,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_resnet18_imagenet(self):
|
|
def test_pretrained_resnet18_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_resnet18", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_resnet18")
|
|
|
|
|
|
model = models.get("resnet18", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("resnet18", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["resnet18"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["resnet18"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_resnet18_imagenet(self):
|
|
def test_transfer_learning_resnet18_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_resnet18_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_resnet18_transfer_learning")
|
|
model = models.get("resnet18", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("resnet18", arch_params=self.imagenet_pretrained_arch_params["resnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -278,14 +277,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_regnetY800_imagenet(self):
|
|
def test_pretrained_regnetY800_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_regnetY800", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_regnetY800")
|
|
|
|
|
|
model = models.get("regnetY800", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("regnetY800", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["regnetY800"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["regnetY800"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_regnetY800_imagenet(self):
|
|
def test_transfer_learning_regnetY800_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_regnetY800_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_regnetY800_transfer_learning")
|
|
model = models.get("regnetY800", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("regnetY800", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -295,14 +294,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_regnetY600_imagenet(self):
|
|
def test_pretrained_regnetY600_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_regnetY600", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_regnetY600")
|
|
|
|
|
|
model = models.get("regnetY600", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("regnetY600", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["regnetY600"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["regnetY600"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_regnetY600_imagenet(self):
|
|
def test_transfer_learning_regnetY600_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_regnetY600_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_regnetY600_transfer_learning")
|
|
model = models.get("regnetY600", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("regnetY600", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -312,14 +311,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_regnetY400_imagenet(self):
|
|
def test_pretrained_regnetY400_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_regnetY400", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_regnetY400")
|
|
|
|
|
|
model = models.get("regnetY400", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("regnetY400", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["regnetY400"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["regnetY400"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_regnetY400_imagenet(self):
|
|
def test_transfer_learning_regnetY400_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_regnetY400_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_regnetY400_transfer_learning")
|
|
model = models.get("regnetY400", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("regnetY400", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -329,14 +328,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_regnetY200_imagenet(self):
|
|
def test_pretrained_regnetY200_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_regnetY200", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_regnetY200")
|
|
|
|
|
|
model = models.get("regnetY200", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("regnetY200", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["regnetY200"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["regnetY200"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_regnetY200_imagenet(self):
|
|
def test_transfer_learning_regnetY200_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_regnetY200_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_regnetY200_transfer_learning")
|
|
model = models.get("regnetY200", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("regnetY200", arch_params=self.imagenet_pretrained_arch_params["regnet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -346,14 +345,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_repvgg_a0_imagenet(self):
|
|
def test_pretrained_repvgg_a0_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_repvgg_a0", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_repvgg_a0")
|
|
|
|
|
|
model = models.get("repvgg_a0", arch_params=self.imagenet_pretrained_arch_params["repvgg_a0"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("repvgg_a0", arch_params=self.imagenet_pretrained_arch_params["repvgg_a0"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["repvgg_a0"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["repvgg_a0"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_repvgg_a0_imagenet(self):
|
|
def test_transfer_learning_repvgg_a0_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_repvgg_a0_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_repvgg_a0_transfer_learning")
|
|
model = models.get("repvgg_a0", arch_params=self.imagenet_pretrained_arch_params["repvgg_a0"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("repvgg_a0", arch_params=self.imagenet_pretrained_arch_params["repvgg_a0"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -363,7 +362,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_regseg48_cityscapes(self):
|
|
def test_pretrained_regseg48_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_regseg48", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_regseg48")
|
|
model = models.get("regseg48", arch_params=self.cityscapes_pretrained_arch_params["regseg48"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("regseg48", arch_params=self.cityscapes_pretrained_arch_params["regseg48"], **self.cityscapes_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(
|
|
trainer.test(
|
|
@@ -375,7 +374,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["regseg48"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["regseg48"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_regseg48_cityscapes(self):
|
|
def test_transfer_learning_regseg48_cityscapes(self):
|
|
- trainer = Trainer("regseg48_cityscapes_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("regseg48_cityscapes_transfer_learning")
|
|
model = models.get("regseg48", arch_params=self.cityscapes_pretrained_arch_params["regseg48"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("regseg48", arch_params=self.cityscapes_pretrained_arch_params["regseg48"], **self.cityscapes_pretrained_ckpt_params)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -385,7 +384,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_ddrnet23_cityscapes(self):
|
|
def test_pretrained_ddrnet23_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_ddrnet23", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_ddrnet23")
|
|
model = models.get("ddrnet_23", arch_params=self.cityscapes_pretrained_arch_params["ddrnet_23"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("ddrnet_23", arch_params=self.cityscapes_pretrained_arch_params["ddrnet_23"], **self.cityscapes_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(
|
|
trainer.test(
|
|
@@ -397,7 +396,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["ddrnet_23"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["ddrnet_23"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_ddrnet23_slim_cityscapes(self):
|
|
def test_pretrained_ddrnet23_slim_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_ddrnet23_slim", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_ddrnet23_slim")
|
|
model = models.get("ddrnet_23_slim", arch_params=self.cityscapes_pretrained_arch_params["ddrnet_23"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("ddrnet_23_slim", arch_params=self.cityscapes_pretrained_arch_params["ddrnet_23"], **self.cityscapes_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(
|
|
trainer.test(
|
|
@@ -409,7 +408,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["ddrnet_23_slim"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["ddrnet_23_slim"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_ddrnet23_cityscapes(self):
|
|
def test_transfer_learning_ddrnet23_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_ddrnet23_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_ddrnet23_transfer_learning")
|
|
model = models.get("ddrnet_23", arch_params=self.cityscapes_pretrained_arch_params["ddrnet_23"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("ddrnet_23", arch_params=self.cityscapes_pretrained_arch_params["ddrnet_23"], **self.cityscapes_pretrained_ckpt_params)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -419,7 +418,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_transfer_learning_ddrnet23_slim_cityscapes(self):
|
|
def test_transfer_learning_ddrnet23_slim_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_ddrnet23_slim_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_ddrnet23_slim_transfer_learning")
|
|
model = models.get("ddrnet_23_slim", arch_params=self.cityscapes_pretrained_arch_params["ddrnet_23"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("ddrnet_23_slim", arch_params=self.cityscapes_pretrained_arch_params["ddrnet_23"], **self.cityscapes_pretrained_ckpt_params)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -429,7 +428,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_coco_segmentation_subclass_pretrained_shelfnet34_lw(self):
|
|
def test_pretrained_coco_segmentation_subclass_pretrained_shelfnet34_lw(self):
|
|
- trainer = Trainer("coco_segmentation_subclass_pretrained_shelfnet34_lw", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("coco_segmentation_subclass_pretrained_shelfnet34_lw")
|
|
model = models.get(
|
|
model = models.get(
|
|
"shelfnet34_lw",
|
|
"shelfnet34_lw",
|
|
arch_params=self.coco_segmentation_subclass_pretrained_arch_params["shelfnet34_lw"],
|
|
arch_params=self.coco_segmentation_subclass_pretrained_arch_params["shelfnet34_lw"],
|
|
@@ -439,14 +438,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.coco_segmentation_subclass_pretrained_mious["shelfnet34_lw"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.coco_segmentation_subclass_pretrained_mious["shelfnet34_lw"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_efficientnet_b0_imagenet(self):
|
|
def test_pretrained_efficientnet_b0_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_efficientnet_b0", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_efficientnet_b0")
|
|
|
|
|
|
model = models.get("efficientnet_b0", arch_params=self.imagenet_pretrained_arch_params["efficientnet_b0"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("efficientnet_b0", arch_params=self.imagenet_pretrained_arch_params["efficientnet_b0"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["efficientnet_b0"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["efficientnet_b0"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_efficientnet_b0_imagenet(self):
|
|
def test_transfer_learning_efficientnet_b0_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_efficientnet_b0_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_efficientnet_b0_transfer_learning")
|
|
|
|
|
|
model = models.get(
|
|
model = models.get(
|
|
"efficientnet_b0", arch_params=self.imagenet_pretrained_arch_params["efficientnet_b0"], **self.imagenet_pretrained_ckpt_params, num_classes=5
|
|
"efficientnet_b0", arch_params=self.imagenet_pretrained_arch_params["efficientnet_b0"], **self.imagenet_pretrained_ckpt_params, num_classes=5
|
|
@@ -459,7 +458,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_ssd_lite_mobilenet_v2_coco(self):
|
|
def test_pretrained_ssd_lite_mobilenet_v2_coco(self):
|
|
- trainer = Trainer("coco_ssd_lite_mobilenet_v2", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("coco_ssd_lite_mobilenet_v2")
|
|
model = models.get("ssd_lite_mobilenet_v2", arch_params=self.coco_pretrained_arch_params["ssd_lite_mobilenet_v2"], **self.coco_pretrained_ckpt_params)
|
|
model = models.get("ssd_lite_mobilenet_v2", arch_params=self.coco_pretrained_arch_params["ssd_lite_mobilenet_v2"], **self.coco_pretrained_ckpt_params)
|
|
ssd_post_prediction_callback = SSDPostPredictCallback()
|
|
ssd_post_prediction_callback = SSDPostPredictCallback()
|
|
res = trainer.test(
|
|
res = trainer.test(
|
|
@@ -471,7 +470,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["ssd_lite_mobilenet_v2"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["ssd_lite_mobilenet_v2"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_ssd_lite_mobilenet_v2_coco(self):
|
|
def test_transfer_learning_ssd_lite_mobilenet_v2_coco(self):
|
|
- trainer = Trainer("coco_ssd_lite_mobilenet_v2_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("coco_ssd_lite_mobilenet_v2_transfer_learning")
|
|
transfer_arch_params = self.coco_pretrained_arch_params["ssd_lite_mobilenet_v2"].copy()
|
|
transfer_arch_params = self.coco_pretrained_arch_params["ssd_lite_mobilenet_v2"].copy()
|
|
transfer_arch_params["num_classes"] = 5
|
|
transfer_arch_params["num_classes"] = 5
|
|
model = models.get("ssd_lite_mobilenet_v2", arch_params=transfer_arch_params, **self.coco_pretrained_ckpt_params)
|
|
model = models.get("ssd_lite_mobilenet_v2", arch_params=transfer_arch_params, **self.coco_pretrained_ckpt_params)
|
|
@@ -483,7 +482,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_ssd_mobilenet_v1_coco(self):
|
|
def test_pretrained_ssd_mobilenet_v1_coco(self):
|
|
- trainer = Trainer("coco_ssd_mobilenet_v1", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("coco_ssd_mobilenet_v1")
|
|
model = models.get("ssd_mobilenet_v1", arch_params=self.coco_pretrained_arch_params["coco_ssd_mobilenet_v1"], **self.coco_pretrained_ckpt_params)
|
|
model = models.get("ssd_mobilenet_v1", arch_params=self.coco_pretrained_arch_params["coco_ssd_mobilenet_v1"], **self.coco_pretrained_ckpt_params)
|
|
ssd_post_prediction_callback = SSDPostPredictCallback()
|
|
ssd_post_prediction_callback = SSDPostPredictCallback()
|
|
res = trainer.test(
|
|
res = trainer.test(
|
|
@@ -495,7 +494,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["coco_ssd_mobilenet_v1"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["coco_ssd_mobilenet_v1"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_yolox_s_coco(self):
|
|
def test_pretrained_yolox_s_coco(self):
|
|
- trainer = Trainer("yolox_s", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("yolox_s")
|
|
|
|
|
|
model = models.get("yolox_s", **self.coco_pretrained_ckpt_params)
|
|
model = models.get("yolox_s", **self.coco_pretrained_ckpt_params)
|
|
res = trainer.test(
|
|
res = trainer.test(
|
|
@@ -506,7 +505,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_s"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_s"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_yolox_m_coco(self):
|
|
def test_pretrained_yolox_m_coco(self):
|
|
- trainer = Trainer("yolox_m", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("yolox_m")
|
|
model = models.get("yolox_m", **self.coco_pretrained_ckpt_params)
|
|
model = models.get("yolox_m", **self.coco_pretrained_ckpt_params)
|
|
res = trainer.test(
|
|
res = trainer.test(
|
|
model=model,
|
|
model=model,
|
|
@@ -516,7 +515,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_m"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_m"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_yolox_l_coco(self):
|
|
def test_pretrained_yolox_l_coco(self):
|
|
- trainer = Trainer("yolox_l", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("yolox_l")
|
|
model = models.get("yolox_l", **self.coco_pretrained_ckpt_params)
|
|
model = models.get("yolox_l", **self.coco_pretrained_ckpt_params)
|
|
res = trainer.test(
|
|
res = trainer.test(
|
|
model=model,
|
|
model=model,
|
|
@@ -526,7 +525,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_l"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_l"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_yolox_n_coco(self):
|
|
def test_pretrained_yolox_n_coco(self):
|
|
- trainer = Trainer("yolox_n", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("yolox_n")
|
|
|
|
|
|
model = models.get("yolox_n", **self.coco_pretrained_ckpt_params)
|
|
model = models.get("yolox_n", **self.coco_pretrained_ckpt_params)
|
|
res = trainer.test(
|
|
res = trainer.test(
|
|
@@ -537,7 +536,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_n"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_n"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_yolox_t_coco(self):
|
|
def test_pretrained_yolox_t_coco(self):
|
|
- trainer = Trainer("yolox_t", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("yolox_t")
|
|
model = models.get("yolox_t", **self.coco_pretrained_ckpt_params)
|
|
model = models.get("yolox_t", **self.coco_pretrained_ckpt_params)
|
|
res = trainer.test(
|
|
res = trainer.test(
|
|
model=model,
|
|
model=model,
|
|
@@ -547,7 +546,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_t"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.coco_pretrained_maps["yolox_t"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_yolox_n_coco(self):
|
|
def test_transfer_learning_yolox_n_coco(self):
|
|
- trainer = Trainer("test_transfer_learning_yolox_n_coco", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("test_transfer_learning_yolox_n_coco")
|
|
model = models.get("yolox_n", **self.coco_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("yolox_n", **self.coco_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -557,7 +556,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_transfer_learning_mobilenet_v3_large_imagenet(self):
|
|
def test_transfer_learning_mobilenet_v3_large_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_mobilenet_v3_large_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_mobilenet_v3_large_transfer_learning")
|
|
|
|
|
|
model = models.get(
|
|
model = models.get(
|
|
"mobilenet_v3_large", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params, num_classes=5
|
|
"mobilenet_v3_large", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params, num_classes=5
|
|
@@ -570,14 +569,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_mobilenet_v3_large_imagenet(self):
|
|
def test_pretrained_mobilenet_v3_large_imagenet(self):
|
|
- trainer = Trainer("imagenet_mobilenet_v3_large", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_mobilenet_v3_large")
|
|
|
|
|
|
model = models.get("mobilenet_v3_large", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("mobilenet_v3_large", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["mobilenet_v3_large"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["mobilenet_v3_large"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_mobilenet_v3_small_imagenet(self):
|
|
def test_transfer_learning_mobilenet_v3_small_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_mobilenet_v3_small_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_mobilenet_v3_small_transfer_learning")
|
|
|
|
|
|
model = models.get(
|
|
model = models.get(
|
|
"mobilenet_v3_small", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params, num_classes=5
|
|
"mobilenet_v3_small", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params, num_classes=5
|
|
@@ -590,14 +589,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_mobilenet_v3_small_imagenet(self):
|
|
def test_pretrained_mobilenet_v3_small_imagenet(self):
|
|
- trainer = Trainer("imagenet_mobilenet_v3_small", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_mobilenet_v3_small")
|
|
|
|
|
|
model = models.get("mobilenet_v3_small", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("mobilenet_v3_small", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["mobilenet_v3_small"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["mobilenet_v3_small"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_mobilenet_v2_imagenet(self):
|
|
def test_transfer_learning_mobilenet_v2_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_mobilenet_v2_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_mobilenet_v2_transfer_learning")
|
|
|
|
|
|
model = models.get("mobilenet_v2", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("mobilenet_v2", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
@@ -608,14 +607,14 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_mobilenet_v2_imagenet(self):
|
|
def test_pretrained_mobilenet_v2_imagenet(self):
|
|
- trainer = Trainer("imagenet_mobilenet_v2", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_mobilenet_v2")
|
|
|
|
|
|
model = models.get("mobilenet_v2", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("mobilenet_v2", arch_params=self.imagenet_pretrained_arch_params["mobilenet"], **self.imagenet_pretrained_ckpt_params)
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
res = trainer.test(model=model, test_loader=self.imagenet_dataset, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0].cpu().item()
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["mobilenet_v2"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["mobilenet_v2"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_stdc1_seg50_cityscapes(self):
|
|
def test_pretrained_stdc1_seg50_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_stdc1_seg50", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_stdc1_seg50")
|
|
model = models.get("stdc1_seg50", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("stdc1_seg50", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(
|
|
trainer.test(
|
|
@@ -630,7 +629,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["stdc1_seg50"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["stdc1_seg50"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_stdc1_seg50_cityscapes(self):
|
|
def test_transfer_learning_stdc1_seg50_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_stdc1_seg50_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_stdc1_seg50_transfer_learning")
|
|
model = models.get("stdc1_seg50", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("stdc1_seg50", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -640,7 +639,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_stdc1_seg75_cityscapes(self):
|
|
def test_pretrained_stdc1_seg75_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_stdc1_seg75", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_stdc1_seg75")
|
|
model = models.get("stdc1_seg75", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("stdc1_seg75", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(
|
|
trainer.test(
|
|
@@ -655,7 +654,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["stdc1_seg75"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["stdc1_seg75"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_stdc1_seg75_cityscapes(self):
|
|
def test_transfer_learning_stdc1_seg75_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_stdc1_seg75_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_stdc1_seg75_transfer_learning")
|
|
model = models.get("stdc1_seg75", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("stdc1_seg75", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -665,7 +664,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_stdc2_seg50_cityscapes(self):
|
|
def test_pretrained_stdc2_seg50_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_stdc2_seg50", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_stdc2_seg50")
|
|
model = models.get("stdc2_seg50", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("stdc2_seg50", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(
|
|
trainer.test(
|
|
@@ -680,7 +679,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["stdc2_seg50"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["stdc2_seg50"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_stdc2_seg50_cityscapes(self):
|
|
def test_transfer_learning_stdc2_seg50_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_stdc2_seg50_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_stdc2_seg50_transfer_learning")
|
|
model = models.get("stdc2_seg50", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("stdc2_seg50", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -690,7 +689,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_stdc2_seg75_cityscapes(self):
|
|
def test_pretrained_stdc2_seg75_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_stdc2_seg75", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_stdc2_seg75")
|
|
model = models.get("stdc2_seg75", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("stdc2_seg75", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(
|
|
trainer.test(
|
|
@@ -705,7 +704,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["stdc2_seg75"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["stdc2_seg75"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_stdc2_seg75_cityscapes(self):
|
|
def test_transfer_learning_stdc2_seg75_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_stdc2_seg75_transfer_learning", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_stdc2_seg75_transfer_learning")
|
|
model = models.get("stdc2_seg75", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("stdc2_seg75", arch_params=self.cityscapes_pretrained_arch_params["stdc"], **self.cityscapes_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
model=model,
|
|
model=model,
|
|
@@ -715,7 +714,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_transfer_learning_vit_base_imagenet21k(self):
|
|
def test_transfer_learning_vit_base_imagenet21k(self):
|
|
- trainer = Trainer("imagenet21k_pretrained_vit_base", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet21k_pretrained_vit_base")
|
|
|
|
|
|
model = models.get("vit_base", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet21k_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("vit_base", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet21k_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
@@ -726,7 +725,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_transfer_learning_vit_large_imagenet21k(self):
|
|
def test_transfer_learning_vit_large_imagenet21k(self):
|
|
- trainer = Trainer("imagenet21k_pretrained_vit_large", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet21k_pretrained_vit_large")
|
|
|
|
|
|
model = models.get("vit_large", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet21k_pretrained_ckpt_params, num_classes=5)
|
|
model = models.get("vit_large", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet21k_pretrained_ckpt_params, num_classes=5)
|
|
trainer.train(
|
|
trainer.train(
|
|
@@ -737,7 +736,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_vit_base_imagenet(self):
|
|
def test_pretrained_vit_base_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_vit_base", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_vit_base")
|
|
model = models.get("vit_base", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("vit_base", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(model=model, test_loader=self.imagenet_dataset_05_mean_std, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0]
|
|
trainer.test(model=model, test_loader=self.imagenet_dataset_05_mean_std, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0]
|
|
@@ -747,7 +746,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["vit_base"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["vit_base"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_vit_large_imagenet(self):
|
|
def test_pretrained_vit_large_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_vit_large", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_vit_large")
|
|
model = models.get("vit_large", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("vit_large", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(model=model, test_loader=self.imagenet_dataset_05_mean_std, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0]
|
|
trainer.test(model=model, test_loader=self.imagenet_dataset_05_mean_std, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0]
|
|
@@ -757,7 +756,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["vit_large"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["vit_large"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_beit_base_imagenet(self):
|
|
def test_pretrained_beit_base_imagenet(self):
|
|
- trainer = Trainer("imagenet_pretrained_beit_base", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("imagenet_pretrained_beit_base")
|
|
model = models.get("beit_base_patch16_224", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet_pretrained_ckpt_params)
|
|
model = models.get("beit_base_patch16_224", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet_pretrained_ckpt_params)
|
|
res = (
|
|
res = (
|
|
trainer.test(model=model, test_loader=self.imagenet_dataset_05_mean_std, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0]
|
|
trainer.test(model=model, test_loader=self.imagenet_dataset_05_mean_std, test_metrics_list=[Accuracy()], metrics_progress_verbose=True)[0]
|
|
@@ -767,7 +766,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["beit_base_patch16_224"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.imagenet_pretrained_accuracies["beit_base_patch16_224"], delta=0.001)
|
|
|
|
|
|
def test_transfer_learning_beit_base_imagenet(self):
|
|
def test_transfer_learning_beit_base_imagenet(self):
|
|
- trainer = Trainer("test_transfer_learning_beit_base_imagenet", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("test_transfer_learning_beit_base_imagenet")
|
|
|
|
|
|
model = models.get(
|
|
model = models.get(
|
|
"beit_base_patch16_224", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet_pretrained_ckpt_params, num_classes=5
|
|
"beit_base_patch16_224", arch_params=self.imagenet_pretrained_arch_params["vit_base"], **self.imagenet_pretrained_ckpt_params, num_classes=5
|
|
@@ -780,7 +779,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
)
|
|
)
|
|
|
|
|
|
def test_pretrained_pplite_t_seg50_cityscapes(self):
|
|
def test_pretrained_pplite_t_seg50_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_pplite_t_seg50", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_pplite_t_seg50")
|
|
model = models.get("pp_lite_t_seg50", arch_params=self.cityscapes_pretrained_arch_params["pplite_seg"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("pp_lite_t_seg50", arch_params=self.cityscapes_pretrained_arch_params["pplite_seg"], **self.cityscapes_pretrained_ckpt_params)
|
|
|
|
|
|
res = (
|
|
res = (
|
|
@@ -796,7 +795,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["pp_lite_t_seg50"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["pp_lite_t_seg50"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_pplite_t_seg75_cityscapes(self):
|
|
def test_pretrained_pplite_t_seg75_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_pplite_t_seg75", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_pplite_t_seg75")
|
|
model = models.get("pp_lite_t_seg75", arch_params=self.cityscapes_pretrained_arch_params["pplite_seg"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("pp_lite_t_seg75", arch_params=self.cityscapes_pretrained_arch_params["pplite_seg"], **self.cityscapes_pretrained_ckpt_params)
|
|
|
|
|
|
res = (
|
|
res = (
|
|
@@ -812,7 +811,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["pp_lite_t_seg75"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["pp_lite_t_seg75"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_pplite_b_seg50_cityscapes(self):
|
|
def test_pretrained_pplite_b_seg50_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_pplite_b_seg50", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_pplite_b_seg50")
|
|
model = models.get("pp_lite_b_seg50", arch_params=self.cityscapes_pretrained_arch_params["pplite_seg"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("pp_lite_b_seg50", arch_params=self.cityscapes_pretrained_arch_params["pplite_seg"], **self.cityscapes_pretrained_ckpt_params)
|
|
|
|
|
|
res = (
|
|
res = (
|
|
@@ -828,7 +827,7 @@ class PretrainedModelsTest(unittest.TestCase):
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["pp_lite_b_seg50"], delta=0.001)
|
|
self.assertAlmostEqual(res, self.cityscapes_pretrained_mious["pp_lite_b_seg50"], delta=0.001)
|
|
|
|
|
|
def test_pretrained_pplite_b_seg75_cityscapes(self):
|
|
def test_pretrained_pplite_b_seg75_cityscapes(self):
|
|
- trainer = Trainer("cityscapes_pretrained_pplite_b_seg75", multi_gpu=MultiGPUMode.OFF)
|
|
|
|
|
|
+ trainer = Trainer("cityscapes_pretrained_pplite_b_seg75")
|
|
model = models.get("pp_lite_b_seg75", arch_params=self.cityscapes_pretrained_arch_params["pplite_seg"], **self.cityscapes_pretrained_ckpt_params)
|
|
model = models.get("pp_lite_b_seg75", arch_params=self.cityscapes_pretrained_arch_params["pplite_seg"], **self.cityscapes_pretrained_ckpt_params)
|
|
|
|
|
|
res = (
|
|
res = (
|