File size: 748 Bytes
668bf5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from youtube_download import download_youtube_videos, extract_frames_from_videos
from youtube_list import youtube_list  # 유튜브 링크 리슀트
from subtitle import ocr_all_frames
from object_detection import detect_all_objects

# 유튜브 μ˜μƒ λ‹€μš΄λ‘œλ“œ
download_youtube_videos(youtube_list, save_dir="my_data/mp4")

# ν”„λ ˆμž„ μΆ”μΆœ (1μ΄ˆλ§ˆλ‹€)
extract_frames_from_videos(video_dir="my_data/mp4", frame_root_dir="my_data/frames", every_n_seconds=1)


ocr_output = ocr_all_frames("/workspace/frames/frame_1")
for item in ocr_output:
    print(item["frame"], "β†’", item["text"])

object_info = detect_all_objects("/workspace/frames/frame_1")
for item in object_info:
    print(item["frame"], "β†’", item["objects"])