Skip to content

マルチモーダル(動画-音声)タスクのSDKメソッド追加(getのみ)#267

Merged
rikunosuke merged 4 commits intomainfrom
feature/10900-multi-modal-video-audio-sdk
Mar 16, 2026
Merged

マルチモーダル(動画-音声)タスクのSDKメソッド追加(getのみ)#267
rikunosuke merged 4 commits intomainfrom
feature/10900-multi-modal-video-audio-sdk

Conversation

@soymd
Copy link
Contributor

@soymd soymd commented Mar 11, 2026

サマリ

概要、背景

Issue #10900 の対応。マルチモーダル(動画-音声)プロジェクトタイプのタスク情報を Python SDK 経由で取得できるようにする。

アプリ側 PR: https://github.com/fastlabel/fastlabel-application/pull/10902

やったこと

  • get_multi_modal_video_audio_tasks — 一覧取得メソッド追加
  • find_multi_modal_video_audio_task — 単一取得メソッド追加

やれていないこと、妥協点

  • create/update は未実装(清瀬さん指示によりまずは get のみ対応)

テスト

変更の意図に沿った基本動作が確認できている

  • get_multi_modal_video_audio_tasks(project="my-project") でタスク一覧が取得できる
  • find_multi_modal_video_audio_task(task_id) でタスク単体が取得できる

関連リンク

アプリ側PR: https://github.com/fastlabel/fastlabel-application/pull/10902

soymd added 2 commits March 10, 2026 16:02
- get_multi_modal_video_audio_tasks()
- find_multi_modal_video_audio_task()
- create_multi_modal_video_audio_task()
- update_multi_modal_video_audio_task()
create/updateは未実装のためgetのみ残す。
- create_multi_modal_video_audio_task を削除
- update_multi_modal_video_audio_task を削除
@soymd soymd self-assigned this Mar 11, 2026
@soymd
Copy link
Contributor Author

soymd commented Mar 12, 2026

アノテーション時間計算Colab の対応コード案

get_multi_modal_video_audio_tasks / find_multi_modal_video_audio_task を利用するために、アノテーション時間計算Colab の初期化セル(SDKの初期化セル)を以下のように修正する必要があります。


変更箇所

1. ProjectType に追加

class ProjectType:
    # ...既存のまま...
    multi_modal_video_audio_segmentation = "multi_modal_video_audio_segmentation"  # 追加

2. FunctionType に追加

class FunctionType:
    # ...既存のまま...
    multi_modal_video_audio = {ProjectType.multi_modal_video_audio_segmentation}  # 追加

3. FetchLimit に追加

class FetchLimit(IntEnum):
    normal = 1000
    video = 10
    sequential_pcd = 10
    multi_image = 10
    multi_modal_video_audio = 10  # 追加

4. get_tasks_func に分岐追加

def get_tasks_func(project: dict):
    # ...既存のまま...
    elif project['type'] in FunctionType.multi_modal_video_audio:
        return client.get_multi_modal_video_audio_tasks
    else:
        raise ValueError("サポートしていないプロジェクトタイプです。")

5. find_task_func に分岐追加

def find_task_func(project: dict):
    # ...既存のまま...
    elif project['type'] in FunctionType.multi_modal_video_audio:
        return client.find_multi_modal_video_audio_task
    else:
        raise ValueError("サポートしていないプロジェクトタイプです。")

6. get_all_tasks のlimit判定に追加

def get_all_tasks(...) -> list:
    # ...
    if is_video_project(project):
        limit = FetchLimit.video.value
    elif is_sequential_pcd_project(project):
        limit = FetchLimit.sequential_pcd.value
    elif is_multi_image_project(project):
        limit = FetchLimit.multi_image.value
    elif project['type'] in FunctionType.multi_modal_video_audio:  # 追加
        limit = FetchLimit.multi_modal_video_audio.value            # 追加
    else:
        limit = FetchLimit.normal.value

補足

  • create_task_func への追加は不要(create は未実装のため)
  • multi_modal_video_audio_segmentation タスクのアノテーションは TaskAnnotationAudioSegmentationExportVO と同構造(title, start, end を持つ)なので、計算ロジック自体は変更不要

@soymd soymd marked this pull request as ready for review March 12, 2026 03:56
Copy link
Contributor

@rikunosuke rikunosuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readme.md と example/... の記載をお願いします🙇
中身は完璧だと思います!

soymd added 2 commits March 13, 2026 11:38
- READMEにget/findメソッドの使用例を追記
- get_multi_modal_video_audio_tasks()のサンプルコードを追加
- find_multi_modal_video_audio_task()のサンプルコードを追加
@soymd
Copy link
Contributor Author

soymd commented Mar 13, 2026

@rikunosuke
sampleとREADME修正しました!

@soymd soymd requested a review from rikunosuke March 13, 2026 02:41
Copy link
Contributor

@rikunosuke rikunosuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rikunosuke rikunosuke merged commit 1169c06 into main Mar 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants