get_captions¶
단일 비디오의 캡션 조회
개요¶
특정 비디오의 모든 캡션 세그먼트를 조회합니다.
Function Signature¶
def get_captions(
feature_view: str,
uuid: str,
model: str,
config: Optional[str] = None,
timestamp: Optional[str] = None
) -> pd.DataFrame
Description¶
특정 비디오의 모든 캡션 세그먼트를 조회합니다.
Parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
uuid |
str |
required | 비디오 고유 식별자 예: "f2c99e03-8415-4926-bf3d-60ec8c2ddab4" |
model |
str |
required | 캡션 생성 모델 이름 예: "gpt-4o", "vila-1.5" |
config |
str or None |
None |
Config 파일 경로None이면 config_source가 실제로 None인 데이터만 조회 |
timestamp |
str or None |
None |
특정 시점의 버전 조회 (ISO format)None이면 최신 버전 조회 |
Returns¶
Type: pd.DataFrame
Columns:
uuid(str): 비디오 고유 식별자segment_id(str): Segment 고유 식별자timestamp(datetime): 데이터 생성 시점model(str): 캡션 생성 모델 이름index(int): Segment 순서 (0부터 시작)start(float): Segment 시작 시간 (초)end(float): Segment 종료 시간 (초)text(str): 캡션 텍스트config_source(str or None): Config 파일 경로
예시¶
최신 버전 조회¶
# GPT-4 최신 결과 조회
captions = get_captions(
feature_view='caption_summary',
uuid='f2c99e03-8415-4926-bf3d-60ec8c2ddab4',
model='gpt-4o'
)
# 결과 출력
for idx, row in captions.iterrows():
print(f"[{row['start']:.1f}s - {row['end']:.1f}s] {row['text']}")
출력:
[0.0s - 10.0s] A man is standing in a kitchen...
[10.0s - 20.0s] The man places vegetables into a pan
[20.0s - 30.0s] He adds ingredients to the pot
...
특정 시점 버전 조회¶
# 2024-12-01 시점의 GPT-4 결과 조회
captions = get_captions(
feature_view='caption_summary',
uuid='f2c99e03-8415-4926-bf3d-60ec8c2ddab4',
model='gpt-4o',
timestamp='2024-12-01T10:00:00'
)
특정 config 사용한 결과 조회¶
# VILA + config_X.yaml 결과 조회
captions = get_captions(
feature_view='caption_summary',
uuid='1d0f4f13-f79b-448b-b176-cbcc4f38e911',
model='vila-1.5',
config='config_X.yaml'
)
관련 API¶
- search_metadata - 메타데이터 검색
- get_captions_batch - 배치 조회