Skip to content

Commit

Permalink
Replace mmdet v2 for v3 (obss#893)
Browse files Browse the repository at this point in the history
Co-authored-by: fatih <[email protected]>
  • Loading branch information
i-aki-y and fcakyon authored Jun 13, 2023
1 parent 0414e47 commit deaed7a
Show file tree
Hide file tree
Showing 45 changed files with 3,296 additions and 146 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ jobs:
if: matrix.operating-system == 'macos-latest'
run: pip install torch==1.13.1 torchvision==0.14.1

- name: Install MMDetection(2.28.1) with MMCV(1.7.0)
- name: Install MMDetection(3.0.0) with MMCV(2.0.0)
run: >
pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.13.0/index.html
pip install mmdet==2.28.1
pip install mmengine==0.7.3
pip install mmcv==2.0.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.13.0/index.html
pip install mmdet==3.0.0
- name: Install YOLOv5(7.0.9)
run: >
Expand Down Expand Up @@ -126,9 +127,9 @@ jobs:
# help
sahi --help
# predict mmdet
sahi predict --source tests/data/ --novisual --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_retinanet/retinanet_r50_fpn_1x_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/terrain1.jpg --export_pickle --export_crop --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/ --novisual --dataset_json_path tests/data/coco_utils/combined_coco.json --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco.py --image_size 320
sahi predict --source tests/data/ --novisual --model_path tests/data/models/mmdet/yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet/yolox/yolox_tiny_8xb8-300e_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/terrain1.jpg --export_pickle --export_crop --model_path tests/data/models/mmdet/yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet/yolox/yolox_tiny_8xb8-300e_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/ --novisual --dataset_json_path tests/data/coco_utils/combined_coco.json --model_path tests/data/models/mmdet/yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet/yolox/yolox_tiny_8xb8-300e_coco.py --image_size 320
# predict yolov5
sahi predict --no_sliced_prediction --model_type yolov5 --source tests/data/coco_utils/terrain1.jpg --novisual --model_path tests/data/models/yolov5/yolov5s6.pt --image_size 320
sahi predict --model_type yolov5 --source tests/data/ --novisual --model_path tests/data/models/yolov5/yolov5s6.pt --image_size 320
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/ci_torch1.10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ jobs:
if: matrix.operating-system == 'macos-latest'
run: pip install torch==1.10.1 torchvision==0.11.2

- name: Install MMDetection(2.26.0) with MMCV(1.7.0)
- name: Install MMDetection(3.0.0) with MMCV(2.0.0)
run: >
pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.10.0/index.html
pip install mmdet==2.26.0
pip install mmengine==0.7.3
pip install mmcv==2.0.0 -f https://download.openmmlab.com/mmcv/dist/cpu/torch1.10.0/index.html
pip install mmdet==3.0.0
- name: Install YOLOv5(7.0.9)
run: >
Expand All @@ -115,7 +116,7 @@ jobs:
- name: Install ultralytics
run: >
pip install ultralytics==8.0.99
- name: Install super-gradients
run: >
pip install super-gradients==3.1.2
Expand All @@ -133,9 +134,9 @@ jobs:
# help
sahi --help
# predict mmdet
sahi predict --source tests/data/ --novisual --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_retinanet/retinanet_r50_fpn_1x_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/terrain1.jpg --export_pickle --export_crop --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/ --novisual --dataset_json_path tests/data/coco_utils/combined_coco.json --model_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet_yolox/yolox_tiny_8x8_300e_coco.py --image_size 320
sahi predict --source tests/data/ --novisual --model_path tests/data/models/mmdet/yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet/yolox/yolox_tiny_8xb8-300e_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/terrain1.jpg --export_pickle --export_crop --model_path tests/data/models/mmdet/yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet/yolox/yolox_tiny_8xb8-300e_coco.py --image_size 320
sahi predict --source tests/data/coco_utils/ --novisual --dataset_json_path tests/data/coco_utils/combined_coco.json --model_path tests/data/models/mmdet/yolox/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth --model_config_path tests/data/models/mmdet/yolox/yolox_tiny_8xb8-300e_coco.py --image_size 320
# predict yolov5
sahi predict --no_sliced_prediction --model_type yolov5 --source tests/data/coco_utils/terrain1.jpg --novisual --model_path tests/data/models/yolov5/yolov5s6.pt --image_size 320
sahi predict --model_type yolov5 --source tests/data/ --novisual --model_path tests/data/models/yolov5/yolov5s6.pt --image_size 320
Expand Down
8 changes: 4 additions & 4 deletions demo/inference_for_mmdetection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"!pip install -U torch sahi mmdet mmcv-full"
"!pip install -U torch sahi mmdet mmengine 'mmcv>=2.0.0'"
]
},
{
Expand Down Expand Up @@ -83,7 +83,7 @@
"# download cascade mask rcnn model&config\n",
"model_path = 'models/cascade_mask_rcnn.pth'\n",
"download_mmdet_cascade_mask_rcnn_model(model_path)\n",
"config_path = download_mmdet_config(model_name=\"cascade_rcnn\", config_file_name=\"cascade_mask_rcnn_r50_fpn_1x_coco.py\",)\n",
"config_path = download_mmdet_config(model_name=\"cascade_rcnn\", config_file_name=\"cascade-mask-rcnn_r50_fpn_1x_coco.py\",)\n",
"\n",
"# download test images into demo_data folder\n",
"download_from_url('https://raw.githubusercontent.com/obss/sahi/main/demo/demo_data/small-vehicles1.jpeg', 'demo_data/small-vehicles1.jpeg')\n",
Expand Down Expand Up @@ -759,7 +759,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.8 ('sahi')",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -773,7 +773,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.16"
},
"vscode": {
"interpreter": {
Expand Down
Loading

0 comments on commit deaed7a

Please sign in to comment.