Skip to content

Commit

Permalink
Update Engine docstring for autodoc build (#3240)
Browse files Browse the repository at this point in the history
Fix docs/
  • Loading branch information
harimkang authored Mar 29, 2024
1 parent 1c1d16b commit d68a1db
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Models
Currently OpenVINO™ Training Extensions supports `X3D <https://arxiv.org/abs/2004.04730>`_ and `MoViNet <https://arxiv.org/pdf/2103.11511.pdf>`_ for action classification.

+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+---------------------+-------------------------+
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
+========================================================================================================================================================================================+=========+=====================+=========================+
| `Custom_Action_Classification_X3D <https://github.com/openvinotoolkit/training_extensions/blob/develop/src/otx/recipe/action/action_classification/x3d.yaml>`_ | X3D | 2.49 | 3.79 |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+---------------------+-------------------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Models
We support the following ready-to-use model recipes for transfer learning:

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+---------------------+-------------------------+
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
+=========================================================================================================================================================================================+===============+=====================+=========================+
| `Custom_Action_Detection_X3D_FAST_RCNN <https://github.com/openvinotoolkit/training_extensions/blob/develop/src/otx/recipe/action/action_detection/x3d_fast_rcnn.yaml>`_ | x3d_fast_rcnn | 13.04 | 8.32 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+---------------------+-------------------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Models
We support the following ready-to-use model recipes:

+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+---------------------+-----------------+
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
+==================================================================================================================================================================================================================+=======================+=====================+=================+
| `Custom_Image_Classification_MobileNet-V3-large-1x <https://github.com/openvinotoolkit/training_extensions/blob/develop/src/otx/recipe/classification/multi_class_cls/otx_mobilenet_v3_large.yaml>`_ | MobileNet-V3-large-1x | 0.44 | 4.29 |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+---------------------+-----------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Models
We support the following ready-to-use model recipes:

+------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------+-----------------+
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
+============================================================================================================================================================+=====================+=====================+=================+
| `Custom_Object_Detection_YOLOX <https://github.com/openvinotoolkit/training_extensions/blob/develop/src/otx/recipe/detection/yolox_tiny.yaml>`_ | YOLOX-TINY | 6.5 | 20.4 |
+------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+---------------------+-----------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Models
We support the following ready-to-use model recipes:

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------+---------------------+-----------------+
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
+======================================================================================================================================================================================+========================+=====================+=================+
| `Custom_Semantic_Segmentation_Lite-HRNet-s-mod2_OCR <https://github.com/openvinotoolkit/training_extensions/blob/develop/src/otx/recipe/semantic_segmentation/litehrnet_s.yaml>`_ | Lite-HRNet-s-mod2 | 1.44 | 3.2 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------+---------------------+-----------------+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Models
We support the following model recipes in experimental phase:

+------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+---------------------+-----------------+
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
| Recipe ID | Name | Complexity (GFLOPs) | Model size (MB) |
+============================================================================================================================================================+==============+=====================+=================+
| `Visual_Prompting_SAM_Tiny_ViT <https://github.com/openvinotoolkit/training_extensions/blob/develop/src/otx/recipe/visual_prompting/sam_tiny_vit.yaml>`_ | SAM_Tiny_ViT | 38.55 | 47 |
+------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+---------------------+-----------------+
Expand Down
60 changes: 32 additions & 28 deletions src/otx/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,26 @@ class Engine:
Example:
The following examples show how to use the Engine class.
Auto-Configuration with data_root
>>> engine = Engine(
... data_root=<dataset/path>,
... )
Create Engine with Custom OTXModel
>>> engine = Engine(
... data_root=<dataset/path>,
... model=OTXModel(...),
... checkpoint=<checkpoint/path>,
... )
Create Engine with Custom OTXDataModule
>>> engine = Engine(
... model = OTXModel(...),
... datamodule = OTXDataModule(...),
... )
Auto-Configuration with data_root::
engine = Engine(
data_root=<dataset/path>,
)
Create Engine with Custom OTXModel::
engine = Engine(
data_root=<dataset/path>,
model=OTXModel(...),
checkpoint=<checkpoint/path>,
)
Create Engine with Custom OTXDataModule::
engine = Engine(
model = OTXModel(...),
datamodule = OTXDataModule(...),
)
"""

def __init__(
Expand Down Expand Up @@ -527,6 +530,7 @@ def optimize(
... datamodule=OTXDataModule(),
... checkpoint=<checkpoint/path>,
... )
CLI Usage:
To optimize a model, run
```python
Expand Down Expand Up @@ -743,17 +747,17 @@ def from_model_name(
... data_root=<dataset/path>,
... )
If you want to override configuration from default config
>>> overriding = {
... "data.config.train_subset.batch_size": 2,
... "data.config.test_subset.subset_name": "TESTING",
... }
>>> engine = Engine(
... model_name="atss_mobilenetv2",
... task="DETECTION",
... data_root=<dataset/path>,
... **overriding,
... )
If you want to override configuration from default config:
>>> overriding = {
... "data.config.train_subset.batch_size": 2,
... "data.config.test_subset.subset_name": "TESTING",
... }
>>> engine = Engine(
... model_name="atss_mobilenetv2",
... task="DETECTION",
... data_root=<dataset/path>,
... **overriding,
... )
"""
default_config = DEFAULT_CONFIG_PER_TASK.get(task)
model_path = str(default_config).split("/")
Expand Down

0 comments on commit d68a1db

Please sign in to comment.