getitune-discovering-models

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Discovering models and recipes in getitune

在getitune中探索模型和食谱

Every trainable model in
getitune
is backed by a recipe YAML under
library/src/getitune/recipe/<task>/
. Recipes are self-discovering, so listing them is how you learn what you can train and what to pass to
create_engine
.
Run everything from
library/
.
getitune
中每个可训练模型都由
library/src/getitune/recipe/<task>/
下的食谱YAML文件提供支持。食谱可自动识别,因此列出它们是了解可训练内容以及向
create_engine
传入参数的方式。
所有操作都从
library/
目录下执行。

List models from Python

从Python中列出模型

python
from getitune.utils import list_models

list_models()                                # all model names
list_models(return_recipes=True)             # full recipe YAML paths
list_models(task="DETECTION")                # filter by task
list_models(pattern="*efficient*")           # filter by name pattern
list_models(task="DETECTION", return_recipes=True)  # recipe paths for one task
Pass any returned name (or recipe path) to
create_engine(model="...", data="...")
— see
getitune-training-a-model
.
python
from getitune.utils import list_models

list_models()                                # 所有模型名称
list_models(return_recipes=True)             # 完整的食谱YAML路径
list_models(task="DETECTION")                # 按任务过滤
list_models(pattern="*efficient*")           # 按名称模式过滤
list_models(task="DETECTION", return_recipes=True)  # 单个任务的食谱路径
将返回的任意名称(或食谱路径)传入
create_engine(model="...", data="...")
——详见
getitune-training-a-model

List models from the CLI

从CLI中列出模型

bash
undefined
bash
undefined

from library/

from library/

getitune find # lists available model recipes
undefined
getitune find # 列出可用的模型食谱
undefined

Tasks

任务类型

Task types live in
getitune.types
(
TaskType
) and organize both the model implementations and the recipe folders:
  • Classification:
    MULTI_CLASS_CLS
    ,
    MULTI_LABEL_CLS
    ,
    H_LABEL_CLS
  • Detection:
    DETECTION
    ,
    ROTATED_DETECTION
    ,
    KEYPOINT_DETECTION
  • Segmentation:
    INSTANCE_SEGMENTATION
    ,
    SEMANTIC_SEGMENTATION
Recipes whose name ends in
_tile
enable the tiling pipeline for large images. Each task directory also ships an
openvino_model.yaml
recipe for running pre-exported OpenVINO IR models.
任务类型位于
getitune.types
TaskType
)中,用于组织模型实现和食谱文件夹:
  • 分类:
    MULTI_CLASS_CLS
    MULTI_LABEL_CLS
    H_LABEL_CLS
  • 检测:
    DETECTION
    ROTATED_DETECTION
    KEYPOINT_DETECTION
  • 分割:
    INSTANCE_SEGMENTATION
    SEMANTIC_SEGMENTATION
名称以
_tile
结尾的食谱支持针对大图像的分块处理流程。每个任务目录还附带一个
openvino_model.yaml
食谱,用于运行预导出的OpenVINO IR模型。

Resolving model-name ambiguity

解决模型名称歧义

  • Passing a model name that matches recipes under multiple tasks raises a
    ValueError
    listing the matches — pass
    task=
    to disambiguate (e.g.
    create_engine(model="dino_v2", task="DETECTION", ...)
    ).
  • Passing a recipe path (
    .yaml
    /
    .yml
    ) that does not exist raises
    FileNotFoundError
    .
  • Use
    list_models(task="...", return_recipes=True)
    to get unambiguous full recipe paths.
  • 传入的模型名称匹配多个任务下的食谱时,会抛出
    ValueError
    并列出匹配项——需传入
    task=
    参数来明确(例如
    create_engine(model="dino_v2", task="DETECTION", ...)
    )。
  • 传入不存在的食谱路径
    .yaml
    /
    .yml
    )会抛出
    FileNotFoundError
  • 使用
    list_models(task="...", return_recipes=True)
    获取明确的完整食谱路径。

Workflow

工作流程

  1. List candidates, filtering by
    task=
    and/or
    pattern=
    to narrow down.
    • Done when: you have a concrete model name or recipe path.
  2. Confirm the task matches your dataset (see
    getitune-preparing-datasets
    ).
    • Done when: model task and dataset annotations agree.
  3. Hand the chosen model to
    create_engine
    in
    getitune-training-a-model
    .
  1. 列出候选模型,通过
    task=
    和/或
    pattern=
    过滤以缩小范围。
    • 完成标志:获得具体的模型名称或食谱路径。
  2. 确认任务与数据集匹配(详见
    getitune-preparing-datasets
    )。
    • 完成标志:模型任务与数据集标注一致。
  3. 将选定的模型传入
    create_engine
    ,详见
    getitune-training-a-model

Related skills

相关技能

  • getitune-training-a-model
    — train the model you selected.
  • getitune-preparing-datasets
    — match the model's task to your data.
  • geti-library-dev
    — when adding a new model/recipe to the library itself.
  • getitune-training-a-model
    —— 训练你选择的模型。
  • getitune-preparing-datasets
    —— 使模型任务与你的数据匹配。
  • geti-library-dev
    —— 向库中添加新模型/食谱时使用。