Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] 점수 분석 모델 개발 #54

Merged
merged 7 commits into from
Aug 1, 2024
Merged

Conversation

JakePark929
Copy link
Collaborator

📝 PR Summary

드디어 점수 분석 모델 서버 쪽 구현이 완료되었네요!
점수 분석 모델은 exe 파일로 운영 서버에 배포 되어있는 상태이며,
도커 우분투 컨테이너 환경에서 실행됩니다.

m4a 파일을 서버에 업로드 하고 분석 모델에 원본 파일과 녹음 파일을 넣으면
두 파일을 비교하여 목소리 유사도와 음정을 기반으로 점수를 측정합니다.

점수 분석 모델을 사용하는 서버 쪽 API들도 추가 완료 되었습니다.

  • 분석 히스토리
  • 녹음본 서버 업로드
  • 점수 분석 모델 실행

🌲 Working Branch

feat/#51-model-score

🌲 TODOs

  • 점수 분석 모델 개발
    • 음원 파일 목소리 추출
    • 분석 및 비교
    • 점수 측정
    • 분석 결과 추출
  • 모델 사용 서버 API 구현
    • 녹음본 서버 업로드
    • 점수 분석 모델 실행 및 결과 반환
    • 분석 히스토리

Related Issues

resolves #51

📚 Remarks

우분투 컨테이너 이름, 녹음본 저장경로, 결과파일 저장경로를 지정하는 환경변수가 추가되었습니다.
서버 쪽 env에는 먼저 추가해 놓도록 하겠습니다.

남은 이틀은 화면만 구현하면 끝이네요!

- 내가 점수 분석한 히스토리를 볼 수 있습니다. 분석과 유사도등의 정보가 DB로 관리됩니다.
- 녹음본(.m4a)을 서버에 업로드하는 기능이 추가되었습니다.
- 업로드된 녹음본과 원본 음원의 유사도를 분석하고 점수를 반환하는 기능이 추가되었습니다.
@JakePark929 JakePark929 added the enhancement New feature or request label Jul 31, 2024
@JakePark929 JakePark929 self-assigned this Jul 31, 2024
@JakePark929 JakePark929 linked an issue Jul 31, 2024 that may be closed by this pull request
9 tasks
@JakePark929 JakePark929 changed the title Feat/#51 model score [FEATURE] 점수 분석 모델 개발 Jul 31, 2024
Copy link
Collaborator

@donsonioc2010 donsonioc2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생진짜 많이 하신게 보이는거같아요.

env는 서버에 먼저 선추가하신다고 하셨는데, 저희도 추가해야 하는 부분이 있을까요?

Comment on lines +92 to +98
String line;
while ((line = reader.readLine()) != null) {
log.info(line);
}
while ((line = errorReader.readLine()) != null) {
log.error(line);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이렇게 로그를 남기면서 돌려야 하는 이유가 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 제가 잘 몰라서 그럴 수도 있는데 모델을 실행하는 Process 커멘드 동작이
모델 실행이 완료되기 전에 비동기로 다음 코드로 넘어가 버립니다.
그럼 모델에서 결과 파일 받기 전에 실행이 완료 되어버려서 결과 파일을 못 받더라구요.

이전에 다른 프로젝트할 때는 스레드 웨이트로 결과파일 올 때까지 대기했는데
이번에는 로그를 계속해서 받는 방식으로 모델 실행을 기다리도록 했습니다.
이 방식으로 하니 모델 실행 되는 동안 로그도 계속 볼 수 있고 에러도 전달해줘서 더 좋더라구요.

더 나은 프랙티스가 있으면 제안해주시면 감사하겠니다~ :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이건 그냥 제 생각인데 그러면 저 line을 While로 돌리는거보단 StringBuilder로 제작해서 Append를 하고 마지막에 출력하는게 로그볼때도 깔끔하지 않을까요?ㅋㅋ

String command = String.format("docker exec %s bash -c \"~/model/fav18_score %s %s\"",
containerId, request.getOriginalFilename(), recordedFilename);

File resultFile = new File(resultPath + "/" + recordedFilename + "/analysis_result.json");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

결과물이 매번 같은 요청으로 나오게 되는 경우 a요청이 처리되기 전에 b요청이 되서 결과물이 발생시
a요청의 결과물로 작업이 되는건가요 b요청의 결과물로 작업이 이뤄지는 건가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오 File 생성 코드가 원래 밑에 있다가 위로 올렸는데 말씀하신 이슈가 있을 수 있겠군요!
모델 실행 이후 파일 잡는 것으로 코드를 이동했습니다~

@@ -94,3 +94,5 @@ Temporary Items
*.msix
*.msm
*.msp

/fav18/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이친구가 추가된 이유가 필요할듯합니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

커밋메세지에 추가했었는데 이 부분 PR 에 설명을 안 드렸군요!
로컬에서 모델 컨테이너 테스트 하려고 만든 폴더입니다.
로컬에서 모델 테스트할 예정이시면 모델 실행 파일 등 필요한 파일 전달드리겠습니다.
그럴필요 없으면 넘어가셔도 됩니다 :)

- 내가 점수 분석한 히스토리를 볼 수 있습니다. 분석과 유사도등의 정보가 DB로 관리됩니다.
- 녹음본(.m4a)을 서버에 업로드하는 기능이 추가되었습니다.
- 업로드된 녹음본과 원본 음원의 유사도를 분석하고 점수를 반환하는 기능이 추가되었습니다.
- 점수가 없는 히스토리는 노출하지 않도록 했습니다.
- 음정 분석점수와 유사도 분석 점수를 구분했습니다.
@JakePark929
Copy link
Collaborator Author

PR 에 먼저 말씀드린 것처럼 env 환경 변수가 추가되었는데 로컬에서 컨테이너 테스트 하는 용이라 로컬에 추가할 필요는 없어보입니다만, 혹시 모르니 다른 채널로 전달드려 놓겠습니다. 머지 진행합니다. 리뷰 감사합니다 :)

@JakePark929 JakePark929 merged commit 619d342 into dev Aug 1, 2024
1 check passed
@JakePark929 JakePark929 deleted the feat/#51-model-score branch August 1, 2024 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] 점수 분석 모델 개발
2 participants