Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update detection docs #2335

Merged
merged 5 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

14 changes: 7 additions & 7 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_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
18 changes: 9 additions & 9 deletions docs/source/guide/tutorials/base/how_to_train/detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ 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_ATSS | MobileNetV2-ATSS | src/otx/algorithms/detection/configs/detection/mobilenetv2_atss/template.yaml |
+-----------+-----------------------------------------------+------------------+-------------------------------------------------------------------------------+v

.. _detection_workspace:

Expand All @@ -165,15 +165,15 @@ Let's prepare the object detection workspace running the following command:
(otx) ...$ otx build Custom_Object_Detection_Gen3_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 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
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@

class TestExplainMethods:
ref_saliency_shapes = {
"ATSS": (2, 4, 4),
"MobileNetV2-ATSS": (2, 4, 4),
"SSD": (81, 13, 13),
"YOLOX": (80, 13, 13),
}

ref_saliency_vals_det = {
"ATSS": np.array([67, 216, 255, 57], dtype=np.uint8),
"MobileNetV2-ATSS": np.array([67, 216, 255, 57], dtype=np.uint8),
"YOLOX": np.array([80, 28, 42, 53, 49, 68, 72, 75, 69, 57, 65, 6, 157], dtype=np.uint8),
"SSD": np.array([119, 72, 118, 35, 39, 30, 31, 31, 36, 28, 44, 23, 61], dtype=np.uint8),
}

ref_saliency_vals_det_wo_postprocess = {
"ATSS": -0.10465062,
"MobileNetV2-ATSS": -0.10465062,
"YOLOX": 0.04948914,
"SSD": 0.6629989,
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/cli/manager/test_config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ def test__check_rebuild(self, mocker):
assert not config_manager._check_rebuild()

config_manager.args.model = "SSD"
config_manager.template.name = "ATSS"
config_manager.template.name = "MobileNetV2-ATSS"
config_manager.args.train_type = "Semisupervised"
assert config_manager._check_rebuild()

Expand Down