/final-project-level3-cv-02

final-project-level-cv-02 created by GitHub Classroom

Primary LanguagePython

header

๐Ÿ’˜๋น„์ „๋กœ์ผ“๋‹จ



๊ตฌ์ƒ๋ชจ ๋ฐฐ์„œํ˜„ ์ด์˜์ง„ ๊ถŒ๊ทœ๋ณด ์˜คํ•œ๋ณ„
T4008 T4095 T4155 T4011 T4128


๐Ÿ‘ซํŒ€ ๊ตฌ์„ฑ ๋ฐ ์—ญํ• 

์ „์ฒด ์„œ๋น„์Šค ์‹œ๋‚˜๋ฆฌ์˜ค ์ •์˜ ๋ฐ ๊ตฌ์ฒดํ™”
๊ตฌ์ƒ๋ชจ oemer custom, Web Back-end(์‚ฌ์šฉ์ž ์ธ์ฆ)
๊ถŒ๊ทœ๋ณด Model pipeline, Model training, convert to XML
๋ฐฐ์„œํ˜„ dataset research, Web Front-end
์˜คํ•œ๋ณ„ model pre-processing, model post-processingโ€‹
์ด์˜์ง„ Web Back-end(DB, server)


โญDemo

Video Label



๐Ÿ“ฅStart

# clone repo
git clone https://github.com/boostcampaitech4lv23cv1/level3_productserving-level3-cv-02.git

# install requirements
pip install -r requirements.txt

# install to convert mp3 package
cd MusicXML2Audio/
sh install_packages.sh

# Run
cd ../app/
python main.py



๐ŸŽน๊ฐœ์š”





์•…๋ณด๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ์œผ๋‚˜ ์—ฐ์ฃผ๊ฐ€ ์–ด๋ ต๋‹ค๊ณ  ๋Š๋‚„ ๋•Œ ์Œ์•…์œผ๋กœ ๋ณ€ํ™˜ํ•ด์ฃผ๋Š” ์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.



๐Ÿ’ปService architecture



๐Ÿ“ฆData

Deepscore V2

https://tuggeluk.github.io/deepscores/

# Example code
.
|-- deepscores_test.json
|-- deepscores_train.json
|-- images
|   |-- image1.png
|   |-- image2.png
|   `-- ...
|-- instance
|   |-- image1.png
|   |-- image2.png
|   `-- ...
|-- segmentation
|   |-- image1.png
|   |-- image2.png
|   `-- ...
|-- deepscores_test.json
`-- deepscores_train.json



๐Ÿ”‘Modeling

1. Model

Yolo v7

https://github.com/WongKinYiu/yolov7

2. Pre-processing

dataset์„ ๊ทธ๋Œ€๋กœ ํ•™์Šต์‹œํ‚ฌ ๊ฒฝ์šฐ ๋ถˆํ•„์š”ํ•œ ์ •๋ณด๊ฐ€ ๋งŽ์•„ ์ „์ฒ˜๋ฆฌ ๊ณผ์ •์ด ํ•„์š”ํ–ˆ์Šต๋‹ˆ๋‹ค.

์•…์ƒ๊ธฐํ˜ธ์™€ ์Œํ‘œ๋งŒ ๋‚จ๊ธฐ๊ธฐ ์œ„ํ•ด ์˜ค์„ ์ง€์˜ ์œ„์น˜ ์ •๋ณด๋งŒ ์ €์žฅํ•œ ํ›„ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค. ์ดํ›„ ์•…๋ณด๋ฅผ ์ด์ง„ํ™”ํ•˜์—ฌ ํ•„์š”ํ•œ ์ •๋ณด๋งŒ ์ถ”์ถœํ•œ ํ›„ ํ•™์Šต์‹œํ‚ต๋‹ˆ๋‹ค.

3. Post-processing

model์˜ prediction์„ ๊ธฐ๋ฐ˜์œผ๋กœ ์—ฐ์ฃผํ•  ๋•Œ ํ•„์š”ํ•œ ์ •๋ณด๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค.

  • conversion from yolo: ์ •๊ทœํ™”๋œ bbox ์ขŒํ‘œ๋ฅผ ์ผ๋ฐ˜ ์•…๋ณด ์ขŒํ‘œ๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
  • merge bbox: ํ•œ ์Œํ‘œ๋‚˜ ๊ธฐํ˜ธ๋ฅผ ์—ฌ๋Ÿฌ๋ฒˆ ์˜ˆ์ธกํ–ˆ๋‹ค๋ฉด ํ•˜๋‚˜๋กœ ํ•ฉ์นฉ๋‹ˆ๋‹ค.
  • noise removal: ์˜ˆ์ธก ๊ฒฐ๊ณผ์˜ noise๋ฅผ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.
  • beat detection: ์Œํ‘œ์˜ ๋ฐ•์ž ์ •๋ณด๋ฅผ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค.
  • measure calculation: ์Œํ‘œ๊ฐ€ ๋ช‡๋ฒˆ์งธ ๋งˆ๋””์— ์†ํ•ด์žˆ๋Š”์ง€ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค.
  • pitch detection: ๊ณ„์ด๋ฆ„์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
  • SFN(Sharp Flat Natural) detection: ์กฐํ‘œ๋ฅผ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.

4. Conversion to MusicXML

post processing ๊ฒฐ๊ณผ๋ฅผ MusicXML ํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•ฉ๋‹ˆ๋‹ค.



๐Ÿ“Folder Structure

app/
.
|-- constant.py
|-- db
|   |-- __init__.py
|   |-- connection.py
|   |-- core
|   |   |-- __init__.py
|   |   |-- config.py
|   |   |-- db_login.py
|   |   `-- key.json
|   |-- crud
|   |   |-- __init__.py
|   |   |-- image_bundle.py
|   |   |-- sound.py
|   |   `-- users.py
|   |-- models
|   |   |-- __init__.py
|   |   |-- image.py
|   |   |-- image_bundle.py
|   |   |-- sound.py
|   |   `-- users.py
|   |-- routes
|   |   |-- __init__.py
|   |   |-- image_bundle.py
|   |   |-- sound.py
|   |   `-- users.py
|   |-- schemas
|   |   |-- __init__.py
|   |   |-- image.py
|   |   |-- image_bundle.py
|   |   |-- sound.py
|   |   `-- users.py
|   |-- service
|   |   |-- __init__.py
|   |   |-- image_bundle.py
|   |   |-- sound.py
|   |   `-- users.py
|   `-- session.py
|-- main.py
|-- output
|-- poetry.lock
|-- pyproject.toml
|-- secret.py
|-- service.py
|-- static
|   |-- css
|   |   |-- css files
|       `-- ******.css
|   |-- fonts
|       `-- font files
|   `-- js
|   |   |-- js files
|       `-- ******.js
|-- templates
|   |-- html files
|   `-- ******.html
`-- utils.py

MusicXML2Audio/
.
|-- constant.py
|-- converter
|   |-- MXL2midi.py
|   |-- midi2wav.py
|   `-- wav2sound.py
|-- data
|-- install_packages.sh
|-- main.py
`-- midi2audio.py



๐Ÿ“„Reference

Footer