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 Engine docstring for autodoc build #3240

Merged
merged 1 commit into from
Mar 29, 2024
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
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
Loading