Skip to content

Commit

Permalink
Add argument & options descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
HonzaCuhel committed Nov 7, 2024
1 parent c03f743 commit 62bef33
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 9 deletions.
41 changes: 33 additions & 8 deletions tools/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from typing import Optional

import typer
from typing_extensions import Annotated

from tools.utils import (
GOLD_YOLO_CONVERSION,
Expand Down Expand Up @@ -46,14 +47,38 @@

@app.command()
def convert(
model: str,
imgsz: str = "416 416",
version: Optional[str] = None,
use_rvc2: bool = True,
class_names: Optional[str] = None,
output_remote_url: Optional[str] = None,
config_path: Optional[str] = None,
put_file_plugin: Optional[str] = None,
model: Annotated[str, typer.Argument(help="Path to the model file.")],
imgsz: Annotated[
str, typer.Option(help="Input image size [width, height].")
] = "416 416",
version: Annotated[
Optional[str],
typer.Option(
help='YOLO version (e.g. `"yolov8"`). If `None`, the toolkit will run an automatic version detector.'
),
] = None,
use_rvc2: Annotated[
bool, typer.Option(help="Whether the target platform is RVC2 or RVC3.")
] = True,
class_names: Annotated[
Optional[str],
typer.Option(
help='A list of class names the model is capable of recognizing (e.g. `"person, bicycle, car"`).'
),
] = None,
output_remote_url: Annotated[
Optional[str], typer.Option(help="An URL to upload the output to.")
] = None,
config_path: Annotated[
Optional[str],
typer.Option(help="An optional path to a conversion config file."),
] = None,
put_file_plugin: Annotated[
Optional[str],
typer.Option(
help="The name of a registered function under the PUT_FILE_REGISTRY."
),
] = None,
):
logger = logging.getLogger(__name__)
logger.info("Converting model...")
Expand Down
2 changes: 1 addition & 1 deletion tools/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Config(LuxonisConfig):
default=[416, 416],
min_length=2,
max_length=2,
min_ledescription="Image size [width, height].",
min_ledescription="Input image size [width, height].",
)
class_names: Optional[List[str]] = Field(None, description="List of class names.")
use_rvc2: Literal[False, True] = Field(True, description="Whether to use RVC2.")
Expand Down

0 comments on commit 62bef33

Please sign in to comment.