geti-using-the-pipeline

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Using the Geti pipeline (application)

使用Geti流程(应用层)

The Geti application is a FastAPI server (
application/backend/
, the
geti
package) that exposes a REST API for the full computer-vision workflow: create a project, upload and annotate media, train a model as an async job, then configure and enable a live inference pipeline (source → model → sink). This skill is about using that API; to change backend code use the
geti-backend-dev
skill instead.
Start the server from
application/backend/
with
just run-server
(default
https://localhost:7860
). The full endpoint reference is
application/docs/api.md
; interactive docs are the generated OpenAPI spec.
Geti应用是一个FastAPI服务器(位于
application/backend/
目录,对应
geti
包),它暴露REST API以支持完整的计算机视觉工作流:创建项目,上传并标注媒体资源,以异步任务形式训练模型,然后配置并启用实时推理流程(数据源→模型→输出端)。本技能聚焦于该API的使用;若需修改后端代码,请使用
geti-backend-dev
技能。
application/backend/
目录执行
just run-server
启动服务器(默认地址为
https://localhost:7860
)。完整的接口参考文档位于
application/docs/api.md
;交互式文档为生成的OpenAPI规范。

End-to-end pipeline

端到端流程

mermaid
flowchart LR
    A[Create project] --> B[Upload media]
    B --> C[Annotate media]
    C --> D[Train job]
    D --> E[Configure pipeline: source, model, sink]
    E --> F[Enable pipeline / live inference]
  1. Create a project with a task type and labels.
    • POST /api/projects
      (name, task, labels) → project info.
    • Done when:
      GET /api/projects/<id>
      returns the project with its labels.
  2. Upload media (images/videos) to the project dataset.
    • POST /api/projects/<id>/dataset/media
      (binary) → media info.
    • Done when:
      GET /api/projects/<id>/dataset/media
      lists the uploaded item.
  3. Annotate media so the dataset is trainable.
    • POST /api/projects/<id>/dataset/media/<media_id>/annotations
      (annotation info).
    • Done when:
      GET .../annotations
      returns the saved annotation.
    • (Optional) import an existing dataset instead via the dataset jobs below.
  4. Train a model as an async job.
    • POST /api/jobs
      with job type
      train
      → job id.
    • Track it:
      GET /api/jobs/<id>
      , stream
      GET /api/jobs/<id>/status
      and
      GET /api/jobs/<id>/logs
      ; cancel with
      POST /api/jobs/<id>:cancel
      .
    • Done when: the job reaches a finished state and
      GET /api/projects/<id>/models
      lists the new model.
  5. (Optional) Quantize the trained model for faster inference.
    • POST /api/jobs
      with job type
      quantize
      .
    • Done when: the quantized model variant appears under the project's models.
  6. Configure the inference pipeline — bind a source, the model, and a sink.
    • Sources:
      POST /api/sources
      ; sinks:
      POST /api/sinks
      .
    • PATCH /api/projects/<id>/pipeline
      with the ids of source, sink, and model.
    • Done when:
      GET /api/projects/<id>/pipeline
      shows the wired components.
  7. Enable live inference and monitor it.
    • POST /api/projects/<id>/pipeline:enable
      (disable with
      :disable
      ).
    • Metrics:
      GET /api/projects/<id>/pipeline/metrics
      (latency, throughput).
    • POST /api/projects/<id>/pipeline:capture
      collects the next frame into the dataset for continued annotation/retraining.
    • Done when: the pipeline reports active and metrics update.
mermaid
flowchart LR
    A[Create project] --> B[Upload media]
    B --> C[Annotate media]
    C --> D[Train job]
    D --> E[Configure pipeline: source, model, sink]
    E --> F[Enable pipeline / live inference]
  1. 创建项目,指定任务类型和标签。
    • 调用
      POST /api/projects
      (传入名称、任务类型、标签)→ 返回项目信息。
    • 完成标志:
      GET /api/projects/<id>
      返回包含标签的项目详情。
  2. 上传媒体资源(图片/视频)到项目数据集。
    • 调用
      POST /api/projects/<id>/dataset/media
      (传入二进制文件)→ 返回媒体资源信息。
    • 完成标志:
      GET /api/projects/<id>/dataset/media
      列出已上传的资源。
  3. 标注媒体资源,使数据集可用于训练。
    • 调用
      POST /api/projects/<id>/dataset/media/<media_id>/annotations
      (传入标注信息)。
    • 完成标志:
      GET .../annotations
      返回已保存的标注内容。
    • (可选)通过下方的数据集任务导入现有数据集,替代手动标注。
  4. 以异步任务形式训练模型
    • 调用
      POST /api/jobs
      并指定任务类型为
      train
      → 返回任务ID。
    • 跟踪任务:调用
      GET /api/jobs/<id>
      ,或流式获取
      GET /api/jobs/<id>/status
      GET /api/jobs/<id>/logs
      ;调用
      POST /api/jobs/<id>:cancel
      可取消任务。
    • 完成标志:任务进入完成状态,且
      GET /api/projects/<id>/models
      列出新模型。
  5. (可选)量化训练后的模型以提升推理速度。
    • 调用
      POST /api/jobs
      并指定任务类型为
      quantize
    • 完成标志:量化后的模型变体出现在项目模型列表中。
  6. 配置推理流程——绑定数据源、模型和输出端。
    • 创建数据源:
      POST /api/sources
      ;创建输出端:
      POST /api/sinks
    • 调用
      PATCH /api/projects/<id>/pipeline
      并传入数据源、输出端和模型的ID。
    • 完成标志:
      GET /api/projects/<id>/pipeline
      显示已绑定的组件。
  7. 启用实时推理并监控
    • 调用
      POST /api/projects/<id>/pipeline:enable
      (调用
      :disable
      可关闭)。
    • 查看指标:
      GET /api/projects/<id>/pipeline/metrics
      (延迟、吞吐量)。
    • 调用
      POST /api/projects/<id>/pipeline:capture
      可将下一帧采集到数据集,用于后续标注/再训练。
    • 完成标志:流程报告处于活跃状态,且指标持续更新。

The async job model

异步任务模型

Long-running work runs as jobs (
POST /api/jobs
), keeping the API responsive. Job types:
train
,
quantize
,
prepare_dataset_for_import
,
import_dataset_to_existing_project
,
import_dataset_as_new_project
,
export_dataset
,
stage_dataset
. Poll
GET /api/jobs/<id>
or stream
/status
and
/logs
; jobs are cancelable.
耗时操作以任务形式运行(调用
POST /api/jobs
),确保API响应性。任务类型包括:
train
quantize
prepare_dataset_for_import
import_dataset_to_existing_project
import_dataset_as_new_project
export_dataset
stage_dataset
。可轮询
GET /api/jobs/<id>
或流式获取
/status
/logs
;任务支持取消操作。

Datasets: import instead of manual annotation

数据集:导入替代手动标注

To bring in an existing dataset rather than annotating from scratch:
  • Upload an archive to staging:
    POST /api/staged_datasets
    .
  • Then submit an import job (
    import_dataset_as_new_project
    or
    import_dataset_to_existing_project
    ) via
    POST /api/jobs
    .
  • Export a project's dataset with the
    export_dataset
    job.
若无需从头标注,可导入现有数据集:
  • 将归档文件上传到暂存区:
    POST /api/staged_datasets
  • 然后通过
    POST /api/jobs
    提交导入任务(
    import_dataset_as_new_project
    import_dataset_to_existing_project
    )。
  • 调用
    export_dataset
    任务可导出项目数据集。

Notes

注意事项

  • Training and quantization jobs run out-of-process and call into the
    getitune
    library; the underlying capabilities map to the
    getitune-training-a-model
    and
    getitune-optimizing-a-model
    skills.
  • This skill covers API usage; endpoint paths and payloads are the contract in
    application/docs/api.md
    . To add or change endpoints, use
    geti-backend-dev
    and
    geti-openapi-sync
    .
  • 训练和量化任务在进程外运行,并调用
    getitune
    库;其底层能力对应
    getitune-training-a-model
    getitune-optimizing-a-model
    技能。
  • 本技能涵盖API使用;接口路径和请求体是
    application/docs/api.md
    中定义的契约。若需添加或修改接口,请使用
    geti-backend-dev
    geti-openapi-sync
    技能。

Related skills

相关技能

  • getitune-training-a-model
    /
    getitune-optimizing-a-model
    — the library capabilities behind the
    train
    and
    quantize
    jobs.
  • geti-backend-dev
    — change the backend/API itself.
  • geti-ui-dev
    — the web UI that drives this same API.
  • getitune-training-a-model
    /
    getitune-optimizing-a-model
    ——
    train
    quantize
    任务背后的库能力。
  • geti-backend-dev
    —— 修改后端/API本身。
  • geti-ui-dev
    —— 调用同一API的Web前端界面。