Skip to content

Commit

Permalink
Update detection docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jaegukhyun committed Jul 11, 2023
1 parent 6b51ba0 commit 51f9928
Show file tree
Hide file tree
Showing 22 changed files with 154 additions and 118 deletions.

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions docs/source/guide/get_started/cli_commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ Example to find ready-to-use templates for the detection task:
.. code-block::
(otx) ...$ otx find --task detection
+-----------+-----------------------------------+-------+-------------------------------------------------------------------------------+
| TASK | ID | NAME | BASE PATH |
+-----------+-----------------------------------+-------+-------------------------------------------------------------------------------+
| DETECTION | Custom_Object_Detection_Gen3_ATSS | ATSS | src/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml |
| DETECTION | Custom_Object_Detection_Gen3_SSD | SSD | src/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/template.yaml |
| DETECTION | Custom_Object_Detection_YOLOX | YOLOX | src/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml |
+-----------+-----------------------------------+-------+-------------------------------------------------------------------------------+
+-----------+-----------------------------------------------+------------------+-------------------------------------------------------------------------------+
| TASK | ID | NAME | BASE PATH |
+-----------+-----------------------------------------------+------------------+-------------------------------------------------------------------------------+
| DETECTION | Custom_Object_Detection_Gen3_SSD | SSD | src/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/template.yaml |
| DETECTION | Custom_Object_Detection_YOLOX | YOLOX | src/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml |
| DETECTION | Custom_Object_Detection_Gen3_MobileNetV2_ATSS | MobileNetV2-ATSS | src/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml |
+-----------+-----------------------------------------------+------------------+-------------------------------------------------------------------------------+
Example to find supported torchvision backbones for the detection task:
Expand Down Expand Up @@ -101,12 +101,12 @@ Building workspace folder
--seed SEED Set seed for configuration.
For example, the following command line will create an object detection ``Custom_Object_Detection_Gen3_ATSS`` model template with ResNet backbone from `mmdetection <https://github.com/open-mmlab/mmdetection>`_:
For example, the following command line will create an object detection ``Custom_Object_Detection_Gen3_MobileNetV2_ATSS`` model template with ResNet backbone from `mmdetection <https://github.com/open-mmlab/mmdetection>`_:
To learn more about backbone replacement, please refer to the :doc:`following advanced tutorial <../tutorials/advanced/backbones>`.

.. code-block::
(otx) ...$ otx build Custom_Object_Detection_Gen3_ATSS --backbone mmdet.ResNet --train-data-roots <path/to/train/root> --val-data-roots <path/to/val/root>
(otx) ...$ otx build Custom_Object_Detection_Gen3_MobileNetV2_ATSS --backbone mmdet.ResNet --train-data-roots <path/to/train/root> --val-data-roots <path/to/val/root>
----------------
Dataset handling
Expand Down
24 changes: 12 additions & 12 deletions docs/source/guide/tutorials/base/how_to_train/detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,20 +134,20 @@ The list of supported templates for object detection is available with the comma
.. code-block::
(otx) ...$ otx find --template --task DETECTION
+-----------+-----------------------------------+-------+-------------------------------------------------------------------------------+
| TASK | ID | NAME | PATH |
+-----------+-----------------------------------+-------+-------------------------------------------------------------------------------+
| DETECTION | Custom_Object_Detection_YOLOX | YOLOX | src/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml |
| DETECTION | Custom_Object_Detection_Gen3_SSD | SSD | src/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/template.yaml |
| DETECTION | Custom_Object_Detection_Gen3_ATSS | ATSS | src/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml |
+-----------+-----------------------------------+-------+-------------------------------------------------------------------------------+
+-----------+-----------------------------------------------+------------------+-------------------------------------------------------------------------------+
| TASK | ID | NAME | BASE PATH |
+-----------+-----------------------------------------------+------------------+-------------------------------------------------------------------------------+
| DETECTION | Custom_Object_Detection_Gen3_SSD | SSD | src/otx/algorithms/detection/configs/detection/mobilenetv2_ssd/template.yaml |
| DETECTION | Custom_Object_Detection_YOLOX | YOLOX | src/otx/algorithms/detection/configs/detection/cspdarknet_yolox/template.yaml |
| DETECTION | Custom_Object_Detection_Gen3_MobileNetV2_ATSS | MobileNetV2-ATSS | src/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml |
+-----------+-----------------------------------------------+------------------+-------------------------------------------------------------------------------+v
.. _detection_workspace:

2. On this step we will create **otx-workspace-Detection**
with:

- all necessary configs for Custom_Object_Detection_Gen3_ATSS
- all necessary configs for Custom_Object_Detection_Gen3_MobileNetV2_ATSS
- prepared ``data.yaml`` to simplify CLI commands launch
- train/validation sets, based on provided annotation.

Expand All @@ -162,18 +162,18 @@ Let's prepare the object detection workspace running the following command:
.. code-block::
# we can specify the template by its ID
(otx) ...$ otx build Custom_Object_Detection_Gen3_ATSS --train-data-roots data/wgisd
(otx) ...$ otx build Custom_Object_Detection_Gen3_MobileNetV2_ATSS --train-data-roots data/wgisd
# or its name
(otx) ...$ otx build ATSS --train-data-roots data/wgisd
(otx) ...$ otx build MobileNetV2-ATSS --train-data-roots data/wgisd
# or its path
(otx) ...$ otx build otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml --train-data-roots data/wgisd
...
[*] Workspace Path: otx-workspace-DETECTION
[*] Load Model Template ID: Custom_Object_Detection_Gen3_ATSS
[*] Load Model Name: ATSS
[*] Load Model Template ID: Custom_Object_Detection_Gen3_MobileNetV2_ATSS
[*] Load Model Name: MobileNetV2-ATSS
[*] - Updated: otx-workspace-DETECTION/model.py
[*] - Updated: otx-workspace-DETECTION/data_pipeline.py
[*] - Updated: otx-workspace-DETECTION/tile_pipeline.py
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Initialization of ATSS model for Detection Task."""
"""Initialization of MobileNetV2-ATSS model for Detection Task."""

# Copyright (C) 2022 Intel Corporation
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Data Pipeline of ATSS model for Detection Task."""
"""Data Pipeline of MobileNetV2-ATSS model for Detection Task."""

# Copyright (C) 2022 Intel Corporation
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""MMDeploy config of ATSS model for Detection Task."""
"""MMDeploy config of MobileNetV2-ATSS model for Detection Task."""

_base_ = ["../../base/deployments/base_detection_dynamic.py"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model configuration of ATSS model for Detection Task."""
"""Model configuration of MobileNetV2-ATSS model for Detection Task."""

# Copyright (C) 2022 Intel Corporation
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Initialization of ATSS model for Semi-SL Detection Task."""
"""Initialization of MobileNetV2-ATSS model for Semi-SL Detection Task."""

# Copyright (C) 2022 Intel Corporation
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Data Pipeline of ATSS model for Semi-Supervised Learning Detection Task."""
"""Data Pipeline of MobileNetV2-ATSS model for Semi-Supervised Learning Detection Task."""

# Copyright (C) 2022 Intel Corporation
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Model configuration of ATSS model for Detection Task."""
"""Model configuration of MobileNetV2-ATSS model for Detection Task."""

# Copyright (C) 2022 Intel Corporation
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Description.
model_template_id: Custom_Object_Detection_Gen3_ATSS
name: ATSS
model_template_id: Custom_Object_Detection_Gen3_MobileNetV2_ATSS
name: MobileNetV2-ATSS
task_type: DETECTION
task_family: VISION
instantiation: "CLASS"
summary: Class-Incremental Object Detection for ATSS
summary: Class-Incremental Object Detection for MobileNetV2-ATSS
application: ~

# Algo backend.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tiling Pipeline of ATSS model for Detection Task."""
"""Tiling Pipeline of MobileNetV2-ATSS model for Detection Task."""

# Copyright (C) 2022 Intel Corporation
#
Expand Down
2 changes: 1 addition & 1 deletion src/otx/cli/manager/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

DEFAULT_MODEL_TEMPLATE_ID = {
"CLASSIFICATION": "Custom_Image_Classification_EfficinetNet-B0",
"DETECTION": "Custom_Object_Detection_Gen3_ATSS",
"DETECTION": "Custom_Object_Detection_Gen3_MobileNetV2_ATSS",
"INSTANCE_SEGMENTATION": "Custom_Counting_Instance_Segmentation_MaskRCNN_ResNet50",
"ROTATED_DETECTION": "Custom_Rotated_Detection_via_Instance_Segmentation_MaskRCNN_ResNet50",
"SEGMENTATION": "Custom_Semantic_Segmentation_Lite-HRNet-18-mod2_OCR",
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/test_api_xai_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_inference_xai(self, multilabel, hierarchical):

class TestOVDetXAIAPI(DetectionTaskAPIBase):
ref_raw_saliency_shapes = {
"ATSS": (6, 8),
"MobileNetV2-ATSS": (6, 8),
}

@e2e_pytest_api
Expand Down Expand Up @@ -216,7 +216,7 @@ def test_inference_xai(self):

class TestOVDetTilXAIAPI(DetectionTaskAPIBase):
ref_raw_saliency_shapes = {
"ATSS": (6, 8),
"MobileNetV2-ATSS": (6, 8),
}

@e2e_pytest_api
Expand Down
7 changes: 6 additions & 1 deletion tests/integration/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
"--model": "MobileNet-V3-large-1x",
"--train-type": "Semisupervised",
},
"detection": {"default": "ATSS", "--task": "detection", "--model": "SSD", "--train-type": "Semisupervised"},
"detection": {
"default": "MobileNetV2-ATSS",
"--task": "detection",
"--model": "SSD",
"--train-type": "Semisupervised",
},
}


Expand Down
40 changes: 20 additions & 20 deletions tests/regression/regression_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -325,27 +325,27 @@
"train": {
"YOLOX": 0.537,
"SSD": 0.179,
"ATSS": 0.446
"MobileNetV2-ATSS": 0.446
},
"export": {
"YOLOX": 0.534,
"SSD": 0.179,
"ATSS": 0.455
"MobileNetV2-ATSS": 0.455
},
"deploy": {
"YOLOX": 0.534,
"SSD": 0.179,
"ATSS": 0.455
"MobileNetV2-ATSS": 0.455
},
"nncf": {
"YOLOX": 0.517,
"SSD": 0.181,
"ATSS": 0.446
"MobileNetV2-ATSS": 0.446
},
"pot": {
"YOLOX": 0.531,
"SSD": 0.18,
"ATSS": 0.458
"MobileNetV2-ATSS": 0.458
}
}
},
Expand All @@ -354,7 +354,7 @@
"train": {
"YOLOX": 0.532,
"SSD": 0.2,
"ATSS": 0.443
"MobileNetV2-ATSS": 0.443
}
}
},
Expand All @@ -363,7 +363,7 @@
"train": {
"YOLOX": 0.398,
"SSD": 0.142,
"ATSS": 0.414
"MobileNetV2-ATSS": 0.414
}
}
},
Expand All @@ -372,27 +372,27 @@
"train": {
"YOLOX": 0.545,
"SSD": 0.19,
"ATSS": 0.459
"MobileNetV2-ATSS": 0.459
},
"export": {
"YOLOX": 0.549,
"SSD": 0.19,
"ATSS": 0.469
"MobileNetV2-ATSS": 0.469
},
"deploy": {
"YOLOX": 0.549,
"SSD": 0.19,
"ATSS": 0.469
"MobileNetV2-ATSS": 0.469
},
"nncf": {
"YOLOX": 0.0,
"SSD": 0.0,
"ATSS": 0.0
"MobileNetV2-ATSS": 0.0
},
"pot": {
"YOLOX": 0.531,
"SSD": 0.192,
"ATSS": 0.459
"MobileNetV2-ATSS": 0.459
}
}
}
Expand Down Expand Up @@ -1573,7 +1573,7 @@
"train": {
"YOLOX": 4226.84,
"SSD": 1992.196,
"ATSS": 1843.627
"MobileNetV2-ATSS": 1843.627
}
}
},
Expand All @@ -1582,7 +1582,7 @@
"train": {
"YOLOX": 3059.355,
"SSD": 1439.16,
"ATSS": 1531.103
"MobileNetV2-ATSS": 1531.103
}
}
},
Expand All @@ -1591,7 +1591,7 @@
"train": {
"YOLOX": 4962.307,
"SSD": 6410.017,
"ATSS": 6263.435
"MobileNetV2-ATSS": 6263.435
}
}
},
Expand All @@ -1600,7 +1600,7 @@
"train": {
"YOLOX": 1689.117,
"SSD": 2052.821,
"ATSS": 2074.501
"MobileNetV2-ATSS": 2074.501
}
}
}
Expand Down Expand Up @@ -1973,7 +1973,7 @@
"train": {
"YOLOX": 82.169,
"SSD": 86.989,
"ATSS": 73.888
"MobileNetV2-ATSS": 73.888
}
}
},
Expand All @@ -1982,7 +1982,7 @@
"train": {
"YOLOX": 59.154,
"SSD": 89.412,
"ATSS": 62.492
"MobileNetV2-ATSS": 62.492
}
}
},
Expand All @@ -1991,7 +1991,7 @@
"train": {
"YOLOX": 47.199,
"SSD": 76.703,
"ATSS": 50.34
"MobileNetV2-ATSS": 50.34
}
}
},
Expand All @@ -2000,7 +2000,7 @@
"train": {
"YOLOX": 146.561,
"SSD": 169.937,
"ATSS": 84.882
"MobileNetV2-ATSS": 84.882
}
}
}
Expand Down
Loading

0 comments on commit 51f9928

Please sign in to comment.