İçeriğe geç

Ses ve Video Promptları

Whisper ile audio transcription, video frame extraction, multi-modal pipelines. Toplantı transkriptleri, podcast özeti.

Şükrü Yusuf KAYA
9 dakikalık okuma
İleri

Ses ve Video Promptları

Audio: Whisper Pipeline#

python
from openai import OpenAI
client = OpenAI()
 
# 1. Transcript
with open("toplanti.mp3", "rb") as f:
transcript = client.audio.transcriptions.create(
model="whisper-1",
file=f,
language="tr",
response_format="verbose_json",
timestamp_granularities=["segment"]
)
 
# 2. Speaker diarization (ayrı tool — pyannote, AssemblyAI)
# 3. LLM ile özet/aksiyon
 
from anthropic import Anthropic
ant = Anthropic()
 
r = ant.messages.create(
model="claude-sonnet-4-6",
max_tokens=2000,
messages=[{
"role": "user",
"content": f"""Aşağıdaki Türkçe toplantı transkriptinden:
 
{transcript.text}
 
Çıktı:
# Özet (3 cümle)
## Alınan Kararlar
- ...
## Action Items
- [ ] [iş] - [sorumlu] - [tarih]
## Açık Sorular
- ..."""
}]
)
print(r.content[0].text)
Audio → transcript → LLM özet

Video: Frame + Audio#

Video'dan kilit frame'ler:
import cv2 cap = cv2.VideoCapture("video.mp4") fps = cap.get(cv2.CAP_PROP_FPS) total = int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) # Her 5 saniyede 1 frame key_frames = [] for i in range(0, total, int(fps * 5)): cap.set(cv2.CAP_PROP_POS_FRAMES, i) ret, frame = cap.read() if ret: key_frames.append(frame)
Pipeline: Video → frame'ler + audio → frames description (vision LLM) + audio transcript → final synthesis.

Yorumlar & Soru-Cevap

(0)
Yorum yazmak için giriş yap.
Yorumlar yükleniyor...

İlgili İçerikler