diff --git a/.gitattributes b/.gitattributes index c7d9f3332a950355d5a77d85000f05e6f45435ea..e5636600c49dfdb666b2357e254136f88ba9aae6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -32,3 +32,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.m4a filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text diff --git a/examples/21savage.m4a b/examples/21savage.m4a new file mode 100644 index 0000000000000000000000000000000000000000..8a21fef5a0a787de69da6977f2372aa8334caac0 --- /dev/null +++ b/examples/21savage.m4a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f2016ea5f8f3dbe35c5d49ea9aaa6387d00a93fbac2b78a3bd5da87ed56f194 +size 3458744 diff --git a/examples/aaliyah/ONE_IN_A_MILLION.mp3 b/examples/aaliyah/ONE_IN_A_MILLION.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..e0b9773a06a1bcabd3f3543a997bd5a9eab19670 --- /dev/null +++ b/examples/aaliyah/ONE_IN_A_MILLION.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8018673242ffed9728c6a567dc7e7478170c4858537e46e1633ffe001d460cef +size 2644982 diff --git a/examples/aaliyah/y2mate.com - Aaliyah 4 Page Letter A Capella Aaliyahpl.mp3 b/examples/aaliyah/y2mate.com - Aaliyah 4 Page Letter A Capella Aaliyahpl.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..e3f6c3bd896b4d7efefbfd0aa761d7da11636d1b --- /dev/null +++ b/examples/aaliyah/y2mate.com - Aaliyah 4 Page Letter A Capella Aaliyahpl.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb3beaf241961c5f71ec483fb31365a763a113b662b22ce814eb5a3604f7fb9e +size 4109929 diff --git a/examples/cmd.txt b/examples/cmd.txt new file mode 100644 index 0000000000000000000000000000000000000000..4b249d2259a71e13c291f94e75dc365f623cc0db --- /dev/null +++ b/examples/cmd.txt @@ -0,0 +1,3 @@ +ffmpeg -ss 1080 -i timbaland.mp3 -t 180 -c copy timbaland_3.wav +/home/fantasyfish/Desktop/dotdemo/examples/sweet tooth ai.mp3 +sudo lsof -n -i :7865 diff --git a/examples/drake.m4a b/examples/drake.m4a new file mode 100644 index 0000000000000000000000000000000000000000..452aeb495f19f5e50568a26425c5f5b620518364 --- /dev/null +++ b/examples/drake.m4a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e780a623a60a9cac4e8810205efea908bd52ec1156559ab2ca2358910afd04ea +size 2480947 diff --git a/examples/drake/drake god plan.mp3 b/examples/drake/drake god plan.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..d4c239176c9024f781f456c30f29352585679a34 --- /dev/null +++ b/examples/drake/drake god plan.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48f8b149acd7edde17874ecb67750e777eb281e0faa6a920f4715c6cffa351c8 +size 2615725 diff --git a/examples/drake/drake.m4a b/examples/drake/drake.m4a new file mode 100644 index 0000000000000000000000000000000000000000..452aeb495f19f5e50568a26425c5f5b620518364 --- /dev/null +++ b/examples/drake/drake.m4a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e780a623a60a9cac4e8810205efea908bd52ec1156559ab2ca2358910afd04ea +size 2480947 diff --git a/examples/drake/y2mate.com - Drake Falling Back HQ Acapella Vocals Only BEST ON YT SO FAR.mp3 b/examples/drake/y2mate.com - Drake Falling Back HQ Acapella Vocals Only BEST ON YT SO FAR.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..745516c22fb9cedc94a878d6adc3fa5de8647063 --- /dev/null +++ b/examples/drake/y2mate.com - Drake Falling Back HQ Acapella Vocals Only BEST ON YT SO FAR.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5615e0844b3b2c4e55dd7763fae008a0f4f5446d7ba7720dc9a0d99c2ffd7277 +size 3810252 diff --git a/examples/eminem/TWIAD_cut.mp3 b/examples/eminem/TWIAD_cut.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..625d93ecc5f0c1f0a6daa6f5a3a463a20dcecf38 --- /dev/null +++ b/examples/eminem/TWIAD_cut.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71ad436a0bfe63c986b8874410985ce4c7f2bdb6389c504e1892c6e784e297e0 +size 3887857 diff --git a/examples/eminem/loseyourself.mp3 b/examples/eminem/loseyourself.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..17b97d77a39fade996bf8c15398f3fee960498b8 --- /dev/null +++ b/examples/eminem/loseyourself.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c4b94abb2e3f8b7c96a3c33b7689718363580d70713ee901917aaa8620f7208 +size 3356349 diff --git a/examples/lil_uzi_vert.m4a b/examples/lil_uzi_vert.m4a new file mode 100644 index 0000000000000000000000000000000000000000..5c5f951a296f767ff0716e6f02ffd03afba0e2dc --- /dev/null +++ b/examples/lil_uzi_vert.m4a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb955d966df4fa8b176a47f53b4e007bec655df9f2274d7abc45e18bee9a679c +size 2906267 diff --git a/examples/lil_uzi_vert/lil_uzi_vert.m4a b/examples/lil_uzi_vert/lil_uzi_vert.m4a new file mode 100644 index 0000000000000000000000000000000000000000..5c5f951a296f767ff0716e6f02ffd03afba0e2dc --- /dev/null +++ b/examples/lil_uzi_vert/lil_uzi_vert.m4a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb955d966df4fa8b176a47f53b4e007bec655df9f2274d7abc45e18bee9a679c +size 2906267 diff --git a/examples/mars/y2mate.com - Bruno Mars Versace On The Floor Official Studio Acapella HD Quality.mp3 b/examples/mars/y2mate.com - Bruno Mars Versace On The Floor Official Studio Acapella HD Quality.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..6e86ce9b12e6c1e45b1d379affe260a1f34027bc --- /dev/null +++ b/examples/mars/y2mate.com - Bruno Mars Versace On The Floor Official Studio Acapella HD Quality.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e831a1e71bb76110f9dc9f2cce3c208078cf59ad8cb5d9152604763666098680 +size 4175131 diff --git a/examples/mars/y2mate.com - When I Was Your Man Bruno Mars Live Studio Acapella.mp3 b/examples/mars/y2mate.com - When I Was Your Man Bruno Mars Live Studio Acapella.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..b4a7fad93884e96564228bbdfa8cea5291f6e1ce --- /dev/null +++ b/examples/mars/y2mate.com - When I Was Your Man Bruno Mars Live Studio Acapella.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:04698f240e951d90132952702c6bd638ba34a418216ae0874fd1fb967710379d +size 3172447 diff --git a/examples/radwimps.mp3 b/examples/radwimps.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..71f630766a28ea3d888833d6759238060970a846 --- /dev/null +++ b/examples/radwimps.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc09a11c7f3b9c99fa09181062a53d0c1d005c495de8a6a87b1ea0338ae62179 +size 3362702 diff --git a/examples/sia.m4a b/examples/sia.m4a new file mode 100644 index 0000000000000000000000000000000000000000..4e2a40936f1c967ff320d47934372a6c5857e177 --- /dev/null +++ b/examples/sia.m4a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99e2dd3a1ce7375a8f551f642688abdc9a11ac9bb9230eef37f8af157a5a160f +size 3498173 diff --git a/examples/stacey.mp3 b/examples/stacey.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..3ced40d1b97ee5871e3f6034fa78a16908beedb8 --- /dev/null +++ b/examples/stacey.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:becc834a4ce4df7e441c8b1be74f731b9706da61d3c6330780a945958f2327e6 +size 8458616 diff --git a/examples/timbaland.mp3 b/examples/timbaland.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..d789cfa504af20710d1503e7fcf095118af55d29 --- /dev/null +++ b/examples/timbaland.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbc0b02d3a5c9d3d7fa961e247ca69a11c86190b09659635bbc28faac380ae79 +size 84203581 diff --git a/examples/timbaland/timbaland_1.wav b/examples/timbaland/timbaland_1.wav new file mode 100644 index 0000000000000000000000000000000000000000..7f0656cd21612a2b37367f4d3b0d86d2d83d8c41 --- /dev/null +++ b/examples/timbaland/timbaland_1.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91e9ba6bac06b4986953937f5f30b7c6dde85f0c7068c1c09651377fdae50aed +size 3040340 diff --git a/examples/timbaland/timbaland_2.wav b/examples/timbaland/timbaland_2.wav new file mode 100644 index 0000000000000000000000000000000000000000..08c9b5b7c78768cc9e1f84e5997b67c22cf798a6 --- /dev/null +++ b/examples/timbaland/timbaland_2.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60574e2fe6b3537b2554cc533a21d50d639454bb1802fb742de84237d311c7ea +size 2720182 diff --git a/examples/timbaland/timbaland_3.wav b/examples/timbaland/timbaland_3.wav new file mode 100644 index 0000000000000000000000000000000000000000..f933f468cc9f5b80a01ad613d306f5ff4ede99d2 --- /dev/null +++ b/examples/timbaland/timbaland_3.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a58298362178a696a710f6970a427e3bbf38c8b52d112db94b519289326ae817 +size 2880680 diff --git a/examples/zefaan/XO mix zz ai vox.mp3 b/examples/zefaan/XO mix zz ai vox.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..690b2d1e6f6eab71e02753cd0a16ac5ca19fdbde --- /dev/null +++ b/examples/zefaan/XO mix zz ai vox.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:591cb163e5380cd9b6a75bc7637160af7b847a06333b11aa430922484e040a0a +size 1519736 diff --git a/examples/zefaan/bliss ai zz.mp3 b/examples/zefaan/bliss ai zz.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..ff85879b1b2129f8e227915da186689f3a6a23cd --- /dev/null +++ b/examples/zefaan/bliss ai zz.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f66a105ddf1aa972ea2fbcb72ee7f315d7ee2fb93cc99115fd261224ffd14a82 +size 4017656 diff --git a/examples/zefaan/criminal woman zz vox.mp3 b/examples/zefaan/criminal woman zz vox.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..407a1f951786dae38465471f04198ff572791c41 --- /dev/null +++ b/examples/zefaan/criminal woman zz vox.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e82ca8394ac8755acf1b68d0b8558b9e3df661154b2df6bb2cd0f04fc1918039 +size 2354936 diff --git a/examples/zefaan/don't waste my time ai zz.mp3 b/examples/zefaan/don't waste my time ai zz.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f087def82a472e3f33ad05b7ca27cc14401144b1 --- /dev/null +++ b/examples/zefaan/don't waste my time ai zz.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3cce06737294362f7dc6ac31de78665a594f4f257cee3a1b5e36ed3379487459 +size 4899896 diff --git a/examples/zefaan/fell in love with the devil zz ai.mp3 b/examples/zefaan/fell in love with the devil zz ai.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f9d159d332f312ea9f205bf2866a682256ac4b1c --- /dev/null +++ b/examples/zefaan/fell in love with the devil zz ai.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0f0ffc554ce7b68a243ff2659158dc1269ed20ce58ac85b4e03361d1baec7ea8 +size 2283896 diff --git a/examples/zefaan/pain & passion zz vox.mp3 b/examples/zefaan/pain & passion zz vox.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..2ba2f51031297e97713128b5a8e691eb6f04bd58 --- /dev/null +++ b/examples/zefaan/pain & passion zz vox.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e3e7fbd7989da732406b31e258ff8cc1c43dec3fe2c27ef973798be6b2a729a +size 5719736 diff --git a/examples/zefaan/party trick zz vox.mp3 b/examples/zefaan/party trick zz vox.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..cbd65fa37a20331871ec0b55c6b0f93d174c9c54 --- /dev/null +++ b/examples/zefaan/party trick zz vox.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f69df7a90f4c721e2ffc661ad6ce9085420861735a250c1b5ac7fb34d8769bee +size 2721656 diff --git a/examples/zefaan/sweet tooth ai.mp3 b/examples/zefaan/sweet tooth ai.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..57f47e90daaaf6c22952f520cd2bb15b889ddb11 --- /dev/null +++ b/examples/zefaan/sweet tooth ai.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cbf726d70d90d8c2a03bafd78154a877f01fa1d314157cee6a41032544c8bed +size 879416 diff --git a/examples/zefaan/sweet tooth ai2.mp3 b/examples/zefaan/sweet tooth ai2.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..17708ee77b87233c97cc842ec0712384d36915ca --- /dev/null +++ b/examples/zefaan/sweet tooth ai2.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3551af91b3eb260d46ab268425e4c2ee9c64b89c411c7872a6062456d6d399a3 +size 930296 diff --git a/examples/zefaan/u no body 2 me zz ai vox.mp3 b/examples/zefaan/u no body 2 me zz ai vox.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..9e450c9ff3655945a39868aa54589229979cbd9e --- /dev/null +++ b/examples/zefaan/u no body 2 me zz ai vox.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a7b064cf2e5930314a55dffd311dc14587be6ec8c308983780eda4249e2f76c +size 2672696 diff --git a/examples/zefaan/what you want zz vox.mp3 b/examples/zefaan/what you want zz vox.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..d55455a9de8b8bbc5464d7c059742362e7bf110c --- /dev/null +++ b/examples/zefaan/what you want zz vox.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4df66ce888d7fc63747d312f69098ff25a81a663d279632bd8e6293f209ae268 +size 4921976 diff --git a/examples/zefaan_timbaland_rap.wav b/examples/zefaan_timbaland_rap.wav new file mode 100644 index 0000000000000000000000000000000000000000..c6f1cd73f893979cefe39cac1cf0549c6d20d8ae --- /dev/null +++ b/examples/zefaan_timbaland_rap.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d349fb938f5d92d379575a825a953b01185e220a04a715998cc34d7c489c3c6d +size 1756844 diff --git a/examples/zefaan_timbaland_rap2.wav b/examples/zefaan_timbaland_rap2.wav new file mode 100644 index 0000000000000000000000000000000000000000..e1f4b47d86ef483b4efe0418bc138ba6c7e18c49 --- /dev/null +++ b/examples/zefaan_timbaland_rap2.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:482d321b81127263912c6f603eb8ec785bade692ef6ed5a1f409a0203aea4728 +size 4566444 diff --git a/inference_server/Dockerfile b/inference_server/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..97564ffe3b58524be7d47143f3de144763298d20 --- /dev/null +++ b/inference_server/Dockerfile @@ -0,0 +1,21 @@ +# syntax=docker/dockerfile:1 + +FROM python:3.10-bullseye + +EXPOSE 8080-8081 + +WORKDIR /app + +COPY . . + +RUN pip3 install -r requirements.txt && \ + pip3 install flask +RUN apt-get update && \ + apt-get upgrade && \ + apt-get install -y ffmpeg +RUN pip3 install ffmpeg-python + +ENV RVCPATH=/third_party/RVC +ENV PYTHONPATH=$PYTHONPATH:$RVCPATH + +CMD ["python3", "/app/server.py"] \ No newline at end of file diff --git a/inference_server/requirements.txt b/inference_server/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..ae93408aea1c7cc895cfe10a3842fa4ed1a0ad4a --- /dev/null +++ b/inference_server/requirements.txt @@ -0,0 +1,41 @@ +joblib>=1.1.0 +numba==0.56.4 +numpy==1.23.5 +scipy==1.9.3 +librosa==0.9.2 +llvmlite==0.39.0 +fairseq==0.12.2 +faiss-cpu==1.7.3 +gradio +Cython +pydub>=0.25.1 +soundfile>=0.12.1 +ffmpeg-python>=0.2.0 +tensorboardX +Jinja2>=3.1.2 +json5 +Markdown +matplotlib>=3.7.0 +matplotlib-inline>=0.1.3 +praat-parselmouth>=0.4.2 +Pillow>=9.1.1 +resampy>=0.4.2 +scikit-learn +starlette>=0.25.0 +tensorboard +tqdm>=4.63.1 +tornado>=6.1 +Werkzeug>=2.2.3 +uc-micro-py>=1.0.1 +sympy>=1.11.1 +tabulate>=0.8.10 +PyYAML>=6.0 +pyasn1>=0.4.8 +pyasn1-modules>=0.2.8 +fsspec>=2022.11.0 +absl-py>=1.2.0 +audioread +uvicorn>=0.21.1 +colorama>=0.4.5 +pyworld>=0.3.2 +flask>=2.3.2 \ No newline at end of file diff --git a/inference_server/server.py b/inference_server/server.py new file mode 100644 index 0000000000000000000000000000000000000000..1c740b82ad817ae161b7cf9ca65c72e534e4afe5 --- /dev/null +++ b/inference_server/server.py @@ -0,0 +1,66 @@ +''' +sudo docker run --gpus all --runtime=nvidia --rm \ + -v /home/fantasyfish/Desktop/dotdemo/third_party:/third_party \ + -v /home/fantasyfish/Desktop/dotdemo/examples:/inputDir \ + -v /home/fantasyfish/Desktop/dotdemo/logs:/logs \ + -v /home/fantasyfish/Desktop/dotdemo/results:/outputDir \ + -v /home/fantasyfish/Desktop/dotdemo/inference_server:/app \ + -p 8081:8081 \ + -it rvc:v0 +curl -X GET http://localhost:8081/inference \ + -H 'Content-Type: application/json' \ + -d '{"expName":"drake-200","audioFileName":"radwimps.mp3", "pitchShift": 0}' +''' +import json +import os +from flask import Flask, request +from logging import exception +import time +from server_utils import model_inference_single +from glob import glob + +print("import successful!") + +app = Flask(__name__) + +@app.route("/ping") +def healthcheck(): + return json.dumps({"code": 200, "message": "responding"}).encode('utf-8') + +@app.route("/inference", methods=['GET']) +def inference(): + if request.headers['Content-Type'] != 'application/json': + exception("Header error") + return json.dumps({"message":"Header error"}), 500 + try: + content = request.get_json() + exp_name = content['expName'] + audio_file_name = content['audioFileName'] + pitch_shift = content['pitchShift'] + + model_path = exp_name + '.pth' + index_path_list = glob("/third_party/RVC/logs/{}/added_IVF*_Flat_nprobe_1.index".format(exp_name)) + assert(len(index_path_list) == 1), "Index file not found" + index_path = index_path_list[0] + audio_path = os.path.join('/inputDir', audio_file_name) + save_path = os.path.join('/outputDir', "{}_{}.wav".format(audio_file_name, exp_name)) + error_log_path = os.path.join("/logs{}.log".format(exp_name)) + + if not os.path.exists('/third_party/RVC/weights/{}'.format(model_path)): + exception("Model doesn't exist") + return json.dumps({"message":"Model doesn't exist"}), 404 + if not os.path.exists(audio_path): + exception("Audio file doesn't exist") + return json.dumps({"message":"Audio file doesn't exist"}), 404 + + start_time = time.time() + model_inference_single(model_path, index_path, audio_path, save_path, error_log_path, pitch_shift) + end_time = time.time() + return json.dumps({"message": "Inference Completed in {} secs.".format(end_time - start_time)}), 200 + + except Exception as e: + exception("Training process failed") + return json.dumps({"message":"Inference process failed due to {}".format(e)}), 500 + +if __name__ == "__main__": + app.run(host="0.0.0.0", port=8081, debug=True) \ No newline at end of file diff --git a/results/21savage_zefaan.wav b/results/21savage_zefaan.wav new file mode 100644 index 0000000000000000000000000000000000000000..042caa58e2b1e4571fd1334d056477d023b77f37 --- /dev/null +++ b/results/21savage_zefaan.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6ee91e0b94287a5d0c541f53d6c8e0559acd9ed55adc83fbbb1df471e3d053f +size 17091244 diff --git a/results/XO mix zz ai vox_drake.mp3 b/results/XO mix zz ai vox_drake.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..84276632755f0d9dc894099a8753e4fe65d8fd92 --- /dev/null +++ b/results/XO mix zz ai vox_drake.mp3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea5e501d79e039bd4acd3b5f0de4745a96e1906afe60498c32aae4ce9d1aba43 +size 3038444 diff --git a/results/bliss ai zz_aaliyah.wav b/results/bliss ai zz_aaliyah.wav new file mode 100644 index 0000000000000000000000000000000000000000..bd01365c50b29926853befde5034da3219b02591 --- /dev/null +++ b/results/bliss ai zz_aaliyah.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eb92954745a645d829ce6f4b027688b0863889a0c2fb810fbf8d73824783d8b8 +size 8033644 diff --git a/results/bliss ai zz_bruno mars.wav b/results/bliss ai zz_bruno mars.wav new file mode 100644 index 0000000000000000000000000000000000000000..0f20727a7f3e8b52c442bee97ebf29ef935afb64 --- /dev/null +++ b/results/bliss ai zz_bruno mars.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:20076545408d8222ee0456c1f8346e7389dd48966e06a260568e32e08ab422d0 +size 8033644 diff --git a/results/bliss ai zz_drake-200.wav b/results/bliss ai zz_drake-200.wav new file mode 100644 index 0000000000000000000000000000000000000000..3bfbaa289c81df32e4ec2af0cfc103abd7524866 --- /dev/null +++ b/results/bliss ai zz_drake-200.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b05cc8d99bbcae45782b7acbf1129a6c2a3d3166c5e6ad7b29ee6c6f5a0099b6 +size 8033644 diff --git a/results/bliss ai zz_drake.wav b/results/bliss ai zz_drake.wav new file mode 100644 index 0000000000000000000000000000000000000000..05fdf68b7eb9891759926f97fb5fe1f336de4297 --- /dev/null +++ b/results/bliss ai zz_drake.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:83973d1a9b14b187fa3f2182341fc650bf2f0c73536f2bdcefc118f0ecb9420b +size 8033644 diff --git a/results/bliss ai zz_drake_50.wav b/results/bliss ai zz_drake_50.wav new file mode 100644 index 0000000000000000000000000000000000000000..e4b4ddcefee292e46f47577f04a0816ebf3cfe39 --- /dev/null +++ b/results/bliss ai zz_drake_50.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6b84479528c3aeba6dfb5ba2f9094444aa403ba95dd0936f628dbb92d803b03 +size 8033644 diff --git a/results/bliss ai zz_eminem.wav b/results/bliss ai zz_eminem.wav new file mode 100644 index 0000000000000000000000000000000000000000..68d21676c60d9006af4300b384c6cf0639afc966 --- /dev/null +++ b/results/bliss ai zz_eminem.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:041cdd3f694d37400ec3cbd855289263f562ac89d2e5dc05057a6910719409bf +size 8033644 diff --git a/results/drake_radwimps.wav b/results/drake_radwimps.wav new file mode 100644 index 0000000000000000000000000000000000000000..d046a9d9f1fde62818f2714d52d4bca01378bc08 --- /dev/null +++ b/results/drake_radwimps.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b24291ea6b7329db6bb5d07c74fd198c35182b36e4665b96692e584e8ccc9bfb +size 16803244 diff --git a/results/drake_zefaan.wav b/results/drake_zefaan.wav new file mode 100644 index 0000000000000000000000000000000000000000..b68f6d825c54a059a184b9d49600273ef8a50b4e --- /dev/null +++ b/results/drake_zefaan.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cdc47d28b67e0babae6a1da8ea5074bc58d70a4508a25ad8c01c79c989847cd +size 12259244 diff --git a/results/radwimps.mp3_drake-200.wav b/results/radwimps.mp3_drake-200.wav new file mode 100644 index 0000000000000000000000000000000000000000..68805540fe9789ec037f428831cfb91a9fe0609c --- /dev/null +++ b/results/radwimps.mp3_drake-200.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f086dce50921635edd785448bc777f6420a4d2dff2f69a07fcc5999a49e4531 +size 16803244 diff --git a/results/sia_zefaan.wav b/results/sia_zefaan.wav new file mode 100644 index 0000000000000000000000000000000000000000..d5d952e4f94a13fc11ec5673827602fa92e73f6b --- /dev/null +++ b/results/sia_zefaan.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c42b59fdfe86e8944a1a5ae5b40f620844f9741f4b3bcf8bacae28aabcb5b922 +size 17288044 diff --git a/results/stacey_aaliyah.wav b/results/stacey_aaliyah.wav new file mode 100644 index 0000000000000000000000000000000000000000..08b7b1eb55bebba5eec60855939b624ad98da406 --- /dev/null +++ b/results/stacey_aaliyah.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa905fdeb908a13c59e86403e42ad5bfce77ef61ab761befb8d8ab2ab4396fe5 +size 16928044 diff --git a/results/zefaan_radwimps.wav b/results/zefaan_radwimps.wav new file mode 100644 index 0000000000000000000000000000000000000000..6bee136ea7729696360efeed2ce08b985400e3b3 --- /dev/null +++ b/results/zefaan_radwimps.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40cc736f85185674ebd95087737cab1bfbcc2d4bcea73021ea880f2eaf7144d2 +size 16803244 diff --git a/third_party/RVC b/third_party/RVC new file mode 160000 index 0000000000000000000000000000000000000000..34bc87c03a51b963e13a6dfb188f3d5f54c6647d --- /dev/null +++ b/third_party/RVC @@ -0,0 +1 @@ +Subproject commit 34bc87c03a51b963e13a6dfb188f3d5f54c6647d diff --git a/train_server/Dockerfile b/train_server/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..97564ffe3b58524be7d47143f3de144763298d20 --- /dev/null +++ b/train_server/Dockerfile @@ -0,0 +1,21 @@ +# syntax=docker/dockerfile:1 + +FROM python:3.10-bullseye + +EXPOSE 8080-8081 + +WORKDIR /app + +COPY . . + +RUN pip3 install -r requirements.txt && \ + pip3 install flask +RUN apt-get update && \ + apt-get upgrade && \ + apt-get install -y ffmpeg +RUN pip3 install ffmpeg-python + +ENV RVCPATH=/third_party/RVC +ENV PYTHONPATH=$PYTHONPATH:$RVCPATH + +CMD ["python3", "/app/server.py"] \ No newline at end of file diff --git a/train_server/requirements.txt b/train_server/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..ae93408aea1c7cc895cfe10a3842fa4ed1a0ad4a --- /dev/null +++ b/train_server/requirements.txt @@ -0,0 +1,41 @@ +joblib>=1.1.0 +numba==0.56.4 +numpy==1.23.5 +scipy==1.9.3 +librosa==0.9.2 +llvmlite==0.39.0 +fairseq==0.12.2 +faiss-cpu==1.7.3 +gradio +Cython +pydub>=0.25.1 +soundfile>=0.12.1 +ffmpeg-python>=0.2.0 +tensorboardX +Jinja2>=3.1.2 +json5 +Markdown +matplotlib>=3.7.0 +matplotlib-inline>=0.1.3 +praat-parselmouth>=0.4.2 +Pillow>=9.1.1 +resampy>=0.4.2 +scikit-learn +starlette>=0.25.0 +tensorboard +tqdm>=4.63.1 +tornado>=6.1 +Werkzeug>=2.2.3 +uc-micro-py>=1.0.1 +sympy>=1.11.1 +tabulate>=0.8.10 +PyYAML>=6.0 +pyasn1>=0.4.8 +pyasn1-modules>=0.2.8 +fsspec>=2022.11.0 +absl-py>=1.2.0 +audioread +uvicorn>=0.21.1 +colorama>=0.4.5 +pyworld>=0.3.2 +flask>=2.3.2 \ No newline at end of file diff --git a/train_server/server.py b/train_server/server.py new file mode 100644 index 0000000000000000000000000000000000000000..0b6189142725bc88e598596336456df955145582 --- /dev/null +++ b/train_server/server.py @@ -0,0 +1,70 @@ +''' +sudo docker run --gpus all --runtime=nvidia --rm \ + -v /home/fantasyfish/Desktop/dotdemo/third_party:/third_party \ + -v /home/fantasyfish/Desktop/dotdemo/examples:/inputDir \ + -v /home/fantasyfish/Desktop/dotdemo/logs:/logs \ + -v /home/fantasyfish/Desktop/dotdemo/train_server:/app \ + -p 8080:8080 \ + -it rvc:v0 +curl -X GET http://localhost:8080/train \ + -H 'Content-Type: application/json' \ + -d '{"expName":"drake-20","trainsetDir":"drake"}' + +curl -X GET http://localhost:8080/check \ + -H 'Content-Type: application/json' \ + -d '{"expName":"drake-20"}' +''' +import json +import os +from flask import Flask, request +from logging import exception +import time +from server_utils import train_model + +print("import successful!") + +app = Flask(__name__) + +@app.route("/ping") +def healthcheck(): + return json.dumps({"code": 200, "message": "responding"}).encode('utf-8') + +@app.route("/train", methods=['GET']) +def train(): + if request.headers['Content-Type'] != 'application/json': + exception("Header error") + return json.dumps({"message":"Header error"}), 500 + try: + content = request.get_json() + exp_name = content['expName'] + trainset_dir = os.path.join('/inputDir', content['trainsetDir']) + log_path = os.path.join("/logs{}.log".format(exp_name)) + if os.path.exists('/third_party/RVC/logs/{}'.format(exp_name)): + os.system('rm -rf /third_party/RVC/logs/{}'.format(exp_name)) + if not os.path.exists(trainset_dir): + exception("Training set doesn't exist") + return json.dumps({"message":"Training set doesn't exist"}), 404 + + start_time = time.time() + train_model(exp_name, trainset_dir, log_path, total_epoch=20) + end_time = time.time() + return json.dumps({"message": "Training Completed in {} secs.".format(end_time - start_time)}), 200 + + except Exception as e: + exception("Training process failed") + return json.dumps({"message":"Training process failed due to {}".format(e)}), 500 + +@app.route("/check", methods=['GET']) +def check(): + if request.headers['Content-Type'] != 'application/json': + exception("Header error") + return json.dumps({"message":"Header error"}), 500 + content = request.get_json() + exp_name = content['expName'] + if os.path.exists('/third_party/RVC/weights/{}.pth'.format(exp_name)): + return json.dumps({"message": "Model found."}), 200 + else: + return json.dumps({"message": "Model not found."}), 200 + +if __name__ == "__main__": + app.run(host="0.0.0.0", port=8080, debug=True) \ No newline at end of file