SBS 데이터셋 수집기
Project description
Downloader: SBS 데이터셋 수집기
YouTube 영상에서 얼굴, 자동차 번호판, 타투, 텍스트 자막을 수집하고 YOLO-World로 검증하는 자동화 파이프라인입니다.
1. 설치 및 시작
필수 요구사항:
- Python 3.8 이상
- FFmpeg (Mac:
brew install ffmpeg) 👈 필수 설치! (영상 자르기에 필요)
설치:
cd 260203_sbs_dataset
pip install -e .
프로젝트 초기화 (최초 1회):
필요한 폴더(urls/, video/)를 생성합니다.
ytcollector init
2. URL 관리
다운로드할 YouTube 영상 리스트는 텍스트 파일로 관리합니다.
파일 위치: urls/<태스크이름>/youtube_url.txt (예: urls/face/youtube_url.txt)
파일 형식 (CSV 스타일):
task_type,url,timestamp_min,timestamp_sec,description
face,https://www.youtube.com/watch?v=VIDEO_ID,2,30,설명
init명령 실행 시 샘플 내용이 포함된 파일이 자동 생성됩니다.
3. 사용법 (다운로드 & 검증)
이 프로그램은 다운로드 → YOLO 검증 → (성공 시) 저장 순서로 작동합니다. 타겟 객체가 없으면 자동으로 삭제됩니다.
기본 다운로드 (순차 실행)
안정적으로 하나씩 다운로드하고 검증합니다.
ytcollector download --task face
🚀 Fast 모드 (병렬 다운로드)
대량의 영상을 빠르게 수집할 때 사용합니다. (4개 스레드 동시 실행)
ytcollector download --task face --fast
- 방화벽 우회: 랜덤 딜레이(1~3초)가 적용되어 차단을 방지합니다.
- 에러 무시: 중간에 에러가 나도 멈추지 않고 다음 영상으로 넘어갑니다.
저장 파일 규칙
- 파일명:
face_0001.mp4,face_0002.mp4... (순차 번호) - 중복 방지:
download_history.json에 기록하여, 이미 받은 URL은 중복해서 받지 않습니다.
4. NAS / 네트워크 저장 설정
영상을 로컬이 아닌 NAS에 저장하려면 설정을 수정하세요. OS(Windows/Mac)를 자동 감지하여 적절한 경로를 사용합니다.
설정 파일 수정: ytcollector/config.py
# Windows 예시
NAS_PATH_WINDOWS = r"\\NAS_SERVER_IP\Data\Private Dataset\..."
# Mac 예시 (/Volumes로 마운트된 경로 확인 필요)
NAS_PATH_MAC = "/Volumes/Data/Private Dataset/..."
5. 전체 명령어 목록
| 명령어 | 설명 | 예시 |
|---|---|---|
init |
프로젝트 초기화 | ytcollector init |
download |
텍스트 파일 목록 대량 다운로드 | ytcollector download --task face --fast |
download-single |
URL 1개만 테스트 다운로드 | ytcollector download-single --task face ... |
verify |
수동 YOLO 검증 (기존 파일) | ytcollector verify --task face |
list-tasks |
지원하는 태스크 목록 확인 | ytcollector list-tasks |
6. 문제 해결
- 검증 실패가 너무 많음:
config.py에서CONFIDENCE_THRESHOLD(기본 0.25) 값을 낮춰보세요. - IP 차단: Fast 모드 사용 중 YouTube 접근이 막히면 잠시 기다린 후 다시 시도하거나 딜레이 시간을 늘리세요.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ytcollector-1.0.6.tar.gz.
File metadata
- Download URL: ytcollector-1.0.6.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30a64461cb5b2e4eea02953839ddef8513df5648f1deff0a6e09731b9a5e1689
|
|
| MD5 |
15bcdaccaacf4e297201e105448d5b22
|
|
| BLAKE2b-256 |
08f73432343a24189b1b89b002db6a5c5fc5bf93efda9d52679de2a49a552e56
|
File details
Details for the file ytcollector-1.0.6-py3-none-any.whl.
File metadata
- Download URL: ytcollector-1.0.6-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6c823160205cf6b5cafb7a049b41b0a95940143a622fd3ea441f77094af55b3
|
|
| MD5 |
7ca55fd2d0a304131f5ef2c2c72b5ceb
|
|
| BLAKE2b-256 |
6eb10e5296a814fd113141fb040aa0de26b49fe7690dd0af7a0e7b363a73afaa
|