diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a2641331..320234b44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,9 +67,9 @@ jobs: if: matrix.operating-system == 'macos-latest' run: pip install torch==1.10.0 torchvision==0.11.1 - - name: Install MMDetection(2.18.0), YOLOv5(6.0.4) and Norfair(0.3.1) + - name: Install MMDetection(2.19.0), YOLOv5(6.0.6) and Norfair(0.3.1) run: > - pip install mmcv-full==1.3.17 mmdet==2.18.0 yolov5==6.0.4 norfair==0.3.1 + pip install mmcv-full==1.4.0 mmdet==2.19.0 yolov5==6.0.6 norfair==0.3.1 - name: Lint with flake8, black and isort run: | @@ -90,7 +90,7 @@ jobs: run: > pip install -e . - - name: Test SAHI CLI for MMDetection(2.17.0), YOLOv5(6.0.4) and Norfair(0.3.1) + - name: Test SAHI CLI for MMDetection(2.19.0), YOLOv5(6.0.6) and Norfair(0.3.1) run: | # help sahi --help diff --git a/.github/workflows/package_testing.yml b/.github/workflows/package_testing.yml index 8771aa8f4..1bb11fec2 100644 --- a/.github/workflows/package_testing.yml +++ b/.github/workflows/package_testing.yml @@ -66,16 +66,16 @@ jobs: if: matrix.operating-system == 'macos-latest' run: pip install torch==1.10.0 torchvision==0.11.1 - - name: Install MMDetection(2.18.0), YOLOv5(6.0.4) and Norfair(0.3.1) + - name: Install MMDetection(2.19.0), YOLOv5(6.0.6) and Norfair(0.3.1) run: > - pip install mmcv-full==1.3.17 mmdet==2.18.0 yolov5==6.0.4 norfair==0.3.1 + pip install mmcv-full==1.4.0 mmdet==2.19.0 yolov5==6.0.6 norfair==0.3.1 - name: Test with unittest run: | pip install pytest python -m unittest - - name: Test SAHI CLI for MMDetection(2.17.0), YOLOv5(6.0.4) and Norfair(0.3.1) + - name: Test SAHI CLI for MMDetection(2.19.0), YOLOv5(6.0.6) and Norfair(0.3.1) run: | # predict mmdet sahi predict --source tests/data/ --model_path tests/data/models/mmdet_retinanet/retinanet_r50_fpn_2x_coco_20200131-fdb43119.pth --model_config_path tests/data/models/mmdet_retinanet/retinanet_r50_fpn_1x_coco.py --image_size 320 diff --git a/tests/test_mmdetectionmodel.py b/tests/test_mmdetectionmodel.py index a9f3f196b..96dcc3ff3 100644 --- a/tests/test_mmdetectionmodel.py +++ b/tests/test_mmdetectionmodel.py @@ -19,7 +19,7 @@ def test_load_model(self): model_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_MODEL_PATH, config_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_CONFIG_PATH, confidence_threshold=0.3, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) @@ -36,7 +36,7 @@ def test_perform_inference_with_mask_output(self): model_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_MODEL_PATH, config_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_CONFIG_PATH, confidence_threshold=0.5, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) @@ -74,7 +74,7 @@ def test_perform_inference_without_mask_output(self): model_path=MmdetTestConstants.MMDET_RETINANET_MODEL_PATH, config_path=MmdetTestConstants.MMDET_RETINANET_CONFIG_PATH, confidence_threshold=0.5, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) @@ -110,7 +110,7 @@ def test_convert_original_predictions_with_mask_output(self): model_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_MODEL_PATH, config_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_CONFIG_PATH, confidence_threshold=0.5, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) @@ -157,7 +157,7 @@ def test_convert_original_predictions_without_mask_output(self): model_path=MmdetTestConstants.MMDET_RETINANET_MODEL_PATH, config_path=MmdetTestConstants.MMDET_RETINANET_CONFIG_PATH, confidence_threshold=0.5, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) @@ -200,7 +200,7 @@ def test_create_original_predictions_from_object_prediction_list_with_mask_outpu model_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_MODEL_PATH, config_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_CONFIG_PATH, confidence_threshold=0.5, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) @@ -245,7 +245,7 @@ def test_create_original_predictions_from_object_prediction_list_without_mask_ou model_path=MmdetTestConstants.MMDET_RETINANET_MODEL_PATH, config_path=MmdetTestConstants.MMDET_RETINANET_CONFIG_PATH, confidence_threshold=0.5, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) diff --git a/tests/test_predict.py b/tests/test_predict.py index 9aa93c0d5..318ec25b1 100644 --- a/tests/test_predict.py +++ b/tests/test_predict.py @@ -34,7 +34,7 @@ def test_get_prediction_mmdet(self): model_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_MODEL_PATH, config_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_CONFIG_PATH, confidence_threshold=0.3, - device=None, + device="cpu", category_remapping=None, ) mmdet_detection_model.load_model() @@ -78,7 +78,7 @@ def test_get_prediction_yolov5(self): yolov5_detection_model = Yolov5DetectionModel( model_path=Yolov5TestConstants.YOLOV5N_MODEL_PATH, confidence_threshold=0.3, - device=None, + device="cpu", category_remapping=None, load_at_init=False, ) @@ -124,7 +124,7 @@ def test_get_sliced_prediction_mmdet(self): model_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_MODEL_PATH, config_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_CONFIG_PATH, confidence_threshold=0.3, - device=None, + device="cpu", category_remapping=None, load_at_init=False, ) @@ -189,7 +189,7 @@ def test_get_sliced_prediction_yolov5(self): yolov5_detection_model = Yolov5DetectionModel( model_path=Yolov5TestConstants.YOLOV5N_MODEL_PATH, confidence_threshold=0.3, - device=None, + device="cpu", category_remapping=None, load_at_init=False, ) @@ -267,7 +267,7 @@ def test_coco_json_prediction(self): model_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_MODEL_PATH, model_config_path=MmdetTestConstants.MMDET_CASCADEMASKRCNN_CONFIG_PATH, model_confidence_threshold=0.4, - model_device=None, + model_device="cpu", model_category_mapping=None, model_category_remapping=None, source=source, @@ -306,7 +306,7 @@ def test_coco_json_prediction(self): model_path=Yolov5TestConstants.YOLOV5N_MODEL_PATH, model_config_path=None, model_confidence_threshold=0.4, - model_device=None, + model_device="cpu", model_category_mapping=None, model_category_remapping=None, source=source, diff --git a/tests/test_yolov5model.py b/tests/test_yolov5model.py index aee5c1119..6d17d539d 100644 --- a/tests/test_yolov5model.py +++ b/tests/test_yolov5model.py @@ -18,7 +18,7 @@ def test_load_model(self): yolov5_detection_model = Yolov5DetectionModel( model_path=Yolov5TestConstants.YOLOV5N_MODEL_PATH, confidence_threshold=0.3, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) @@ -34,7 +34,7 @@ def test_perform_inference(self): yolov5_detection_model = Yolov5DetectionModel( model_path=Yolov5TestConstants.YOLOV5N_MODEL_PATH, confidence_threshold=0.5, - device=None, + device="cpu", category_remapping=None, load_at_init=True, ) @@ -72,7 +72,7 @@ def test_convert_original_predictions(self): yolov5_detection_model = Yolov5DetectionModel( model_path=Yolov5TestConstants.YOLOV5N_MODEL_PATH, confidence_threshold=0.5, - device=None, + device="cpu", category_remapping=None, load_at_init=True, )