AI 기능 4종을 통합한 Flask 기반 백엔드 서버입니다.
본 서버는 다음 기능을 제공합니다:
-
Thumbnail Generator
- 얼굴 인식 + 웃는 표정 우선 점수화 → 최적 썸네일 자동 추출
-
STT → 요약 + 제목 생성
- Gemini Flash 모델로 오디오 내용을 1줄 요약 + 영상 주제 기반 제목 자동 생성
-
Pet Shorts Generator
- 반려동물 등장 구간 자동 탐지 + 구간만 모아 숏츠 파일 생성
-
Pet Daily Classifier
- 업로드된 사진/영상에서 반려동물 등장 여부 분류
-
Face Arrangement (Face Guide)
- 촬영 시 사용자 얼굴 위치 분석
- "come_in / move_back / perfect" 상태 반환
WooriZip-AI/
│
├── app.py
├── requirements.txt
│── shorts/generated
└── models/
├── thumb_stt.py
├── pet_shorts.py
├── pet_daily.py
├── face_arrange.py
├── __init__.py
pip install -r requirements.txt
python app.py
서버는 다음 주소에서 실행됩니다:
http://localhost:8000
아래 모든 요청은 multipart/form-data 또는 JSON 형식을 사용합니다.
Request
form-data:
video: <mp4 file>
Response
{
"message": "Thumbnail analysis successful",
"time_sec": 1.35,
"score": 422.1,
"image_base64": "..."
}Request
form-data:
api_key: <Gemini API key>
video: <mp4>
Response
{
"message": "summary + title generation successful",
"summary": "영상 내용을 한 문장으로 요약…",
"title": "자동 생성된 제목"
}Request
form-data:
video: <mp4>
Response
{
"message": "success",
"segments": [
[1.0, 3.0],
[8.0, 11.0]
]
}Request (JSON)
{
"video_path": "uploads/video1.mp4",
"segments": [[1.0, 3.5], [8.0, 11.2]]
}Response
{
"message": "success",
"output": "shorts/3f1d9a53.mp4"
}업로드된 파일이 사진인지 영상인지 자동 분류하여
반려동물 등장 여부를 판별합니다.
Request
form-data:
file: <image or video>
Response
{
"message": "success",
"data": {
"file_type": "video",
"is_pet_present": true,
"timestamps": [0.0, 1.0, 2.0]
}
}이미지 한 장을 분석하여 다음 상태 중 하나 반환:
perfectmove_backcome_in
Request (form-data or base64 JSON)
- Multipart 이미지 업로드
form-data:
file: <image>
- Base64 JSON
{
"image": "<base64_string>"
}Response
{
"message": "success",
"data": {
"state": "move_back",
"message": "조금 뒤로 물러나세요",
"is_good": false
}
}.env 또는 서버 환경 변수에서 설정:
GOOGLE_APPLICATION_CREDENTIALS=service-account.json
GCP_PROJECT_ID=your_project_id
-
ffmpeg는 시스템에 설치되어 있어야 합니다
macOS →brew install ffmpeg
Ubuntu →sudo apt install ffmpeg -
pet_shorts 출력 파일은 자동으로 UUID 기반 파일명으로 저장됩니다.