boostcampaitech3 / final-project-level3-cv-10 Goto Github PK
View Code? Open in Web Editor NEW[부스트캠프 AI Tech 3기 / CV-10] 인물 기반 예능 숏폼 영상 생성기, #눈#사람 ⛄️ (22.05.16 - 22.06.15)
[부스트캠프 AI Tech 3기 / CV-10] 인물 기반 예능 숏폼 영상 생성기, #눈#사람 ⛄️ (22.05.16 - 22.06.15)
files/[uuid]
)에 저장되고, select-person
페이지로 넘어간다.npm run start-dev
로 실행하면 30002번 port로 열린다.NavBar
가 스크롤을 내려도 상단에 고정되고, 맨 앞에 위치하도록 한다.NavBar
의 글자 부분을 클릭하면 메인 페이지로 리다이렉트 되도록 한다.PeoplePanel
에서 인물 리스트 부분의 height를 video의 height와 같도록 설정한다.PeoplePanel
에서 인물을 선택하지 않고 완료 버튼을 누를 때 경고 모달 창이 뜨도록 한다.PeoplePanel
에서 인물 선택 후 timeline을 추출할 때, spinner가 panel의 가운데에 위치하도록 한다.laughter timeline 계산 시 zerodivision error 해결
model/laughter/laughter_detector/laughter_detector.py 에서 calculate_interest 함수 수정
/select-person
, /select-video
를 입력해서 들어오는 경우, 메인화면으로 리다이렉트 시킨다.NavBar
-> Header
로 명칭을 변경한다.Spin
의 색깔과 아이콘을 변경한다.Footer
를 추가하고 GitHub repository 링크를 건다.laughterTimeline
과 faceTimeline
이 각각 병렬적으로 추출된 이후 최종 finalTimeline
을 추출하는 API에게 요청을 보내도록 한다.async
를 삭제한다.uvicorn
의 workers
를 추가한다.experiment 폴더의 모델링 코드 수정
흥미도 계산 로직 수정, recognition threshold 수정 등 내부적인 부분 refactoring
face_extractor/face_extractor.py parameter 추가
imagecluster/face_classifier.py parameter 추가
final_shorts/final_timeline.py make_final_timeline 흥미도 계산에 person 등장비율 추가
demo 파일 수정
Input video를 입력받아 각 person에 해당하는 128-d embedding vector를 반환해주는 face extractor 모듈.
Face extractor와 face matching을 연결하여 time line추출을 위함
예시 코드 업로드
하나의 파이프라인으로 완성된 모델링 코드를 업로드
모듈화된 코드 연결
demo 파일 참고
The original Person class has a class attribute _last_id
but it gets accumulated for different videos.
기존 experiment 폴더를 model 폴더로 변경하고, experiment 폴더를 새로 생성하여 기존에 실험했던 내용을 업로드하도록 한다.
laughter detection & face recognition pipeline 업로드
pipeline 연결을 위해 모듈화 진행
config.py 경로 수정 후 make_shorts.py 실행
FFT 로 가장 덜 blur 한 사진을 찾는다. 가장 덜 blur 한 사진이 sharp 한 사진이라 기대
input으로 인물 사진이 저장되어 있는 폴더의 저장 위치를 넣으면 output으로 사진 한장 반환
클러스터링 이후, 사용자에게 제안할 사진 한 장을 고를 때 적절한 사진을 뽑기 위한 알고리즘
모듈화 진행 중..
자체 실험을 통해 구한 쇼츠 타임라인 및 흥미도 계산 방법을 적용한 코드를 업로드
타임라인 생성) 기존 -10초 ~ +0.5초 -> -15초 ~ +0.5초
흥미도 계산) 웃음 구간 길이의 비율: 웃음 구간 소리 크기: 인물 등장 비율 을 기존 2:1:2 -> 3:2:1
/upload-video
: FE에서 BE로 원본 영상을 업로드 후 face clustering을 수행한다./show-people
: face clustering 결과에서 각 cluster의 첫 번째 사진을 FE로 반환한다.api.py
하나에만 모든 api를 작성했었으나, 이를 큰 기능별로 파일을 분리한다.serving/backend/app
에서 python main.py
를 실행한다.
app.post를 통한 Video불러오기
gcp에서 Video를 보내줬을 때, Video를 가져와 이후 face clustering 및 다양한 작업이 가능하도록 한다.
pip install ffmpeg-python
을 사용하여 ffmpeg-python을 설치한다.Scene transition detection
장면 전환한 이미지들로부터 face clustering을 수행하여 정확도 향상
original_audio.wav
라는 이름으로 원본 영상의 오디오 파일을 저장한다.app/ml/final_shorts/make_shorts.py
에서 최종 쇼츠 영상 파일을 만들 때, 임시 오디오 파일인 [video-name]TEMP_MPY_wvf_snd.mp3
파일이 루트 디렉토리에 생성되는 문제점을 해결한다. (async로 여러 요청 동시에 처리 시 파일 이름이 겹치면 문제 발생 가능하므로)sim_threshold
, face & cloth weights
, face_cnt
clustering 코드 수정
시간 단축 목적
기존 clustering 코드에 덮어쓰기만 하면 사용 가능
demo 파일에 수정이 필요한 부분이 있어 간단히 수정
발생할 수 있는 문제 상황은 아래와 같다.
이러한 상황들에 대해 대처할 수 있는 예외처리를 구현한다.
clustering 결과를 통해 사용자가 하이라이트 추출을 원하는 인물을 고를 수 있도록 한다.
npm run start-dev
시 30002번 포트로 열린다.
face clustering부분을 모듈화하여 face recognition 모듈과 호환되게 리팩토링
가장 기초적으로, fastapi를 활용하여 gcp서버와 통신하는 backend를 구축하려고 한다.
gcp서버에서의 frontend와 통신하는 backend api 구축
서버 내에서
python main.py
를 실행시키고, {서버ip} : 30001
를 통하여 접근이 가능하다.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.