Updates so old I can't remember what they are
This commit is contained in:
parent
2c52a8085a
commit
dcd571de3c
6 changed files with 10 additions and 101 deletions
|
|
@ -26,6 +26,7 @@ pyinstaller `
|
||||||
--hidden-import "numpy" `
|
--hidden-import "numpy" `
|
||||||
--collect-submodules "demucs" `
|
--collect-submodules "demucs" `
|
||||||
--collect-submodules "numpy" `
|
--collect-submodules "numpy" `
|
||||||
|
--optimize 2 `
|
||||||
".\src\cli.py"
|
".\src\cli.py"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -37,13 +38,14 @@ On the TODO: dtc_cli.exe is hard-coded and that's gross. I don't want to have to
|
||||||
pyinstaller `
|
pyinstaller `
|
||||||
--onefile `
|
--onefile `
|
||||||
--noconfirm `
|
--noconfirm `
|
||||||
--console `
|
--windowed `
|
||||||
--icon ".\assets\icon.ico" `
|
--icon ".\assets\icon.ico" `
|
||||||
--splash ".\assets\splash.png" `
|
--splash ".\assets\splash.png" `
|
||||||
--name "Drum Track Converter" `
|
--name "Drum Track Converter" `
|
||||||
--add-data ".\src;src/" `
|
--add-data ".\src;src/" `
|
||||||
--add-data=".\assets;assets/" `
|
--add-data=".\assets;assets/" `
|
||||||
--add-data ".\dist\dtc_cli.exe;." `
|
--add-data ".\dist\dtc_cli.exe;." `
|
||||||
|
--optimize 2 `
|
||||||
".\src\gui.py"
|
".\src\gui.py"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,10 @@ I'm not entirely sure if this application _requires_ an Nvidia GPU or not, I act
|
||||||
|
|
||||||
As `demucs` has a dependency on FFmpeg, so does this project. Installation is easy and lightweight. You can install FFMpeg for your operating system of choice from the [official site](https://ffmpeg.org/download.html).
|
As `demucs` has a dependency on FFmpeg, so does this project. Installation is easy and lightweight. You can install FFMpeg for your operating system of choice from the [official site](https://ffmpeg.org/download.html).
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
winget install ffmpeg
|
||||||
|
```
|
||||||
|
|
||||||
# ℹ️ Using Your Nvidia GPU ℹ️
|
# ℹ️ Using Your Nvidia GPU ℹ️
|
||||||
|
|
||||||
If you wish to use your Nvidia GPU, be sure to install the Cuda Toolkit version 11.8 from [here](https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_522.06_windows.exe) before proceeding.
|
If you wish to use your Nvidia GPU, be sure to install the Cuda Toolkit version 11.8 from [here](https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda_11.8.0_522.06_windows.exe) before proceeding.
|
||||||
|
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
::
|
|
||||||
:: RefreshEnv.cmd
|
|
||||||
::
|
|
||||||
:: Batch file to read environment variables from registry and
|
|
||||||
:: set session variables to these values.
|
|
||||||
::
|
|
||||||
:: With this batch file, there should be no need to reload command
|
|
||||||
:: environment every time you want environment changes to propagate
|
|
||||||
|
|
||||||
::echo "RefreshEnv.cmd only works from cmd.exe, please install the Chocolatey Profile to take advantage of refreshenv from PowerShell"
|
|
||||||
echo | set /p dummy="Refreshing environment variables from registry for cmd.exe. Please wait..."
|
|
||||||
|
|
||||||
@echo off
|
|
||||||
|
|
||||||
goto main
|
|
||||||
|
|
||||||
:: Set one environment variable from registry key
|
|
||||||
:SetFromReg
|
|
||||||
"%WinDir%\System32\Reg" QUERY "%~1" /v "%~2" > "%TEMP%\_envset.tmp" 2>NUL
|
|
||||||
for /f "usebackq skip=2 tokens=2,*" %%A IN ("%TEMP%\_envset.tmp") do (
|
|
||||||
echo/set "%~3=%%B"
|
|
||||||
)
|
|
||||||
goto :EOF
|
|
||||||
|
|
||||||
:: Get a list of environment variables from registry
|
|
||||||
:GetRegEnv
|
|
||||||
"%WinDir%\System32\Reg" QUERY "%~1" > "%TEMP%\_envget.tmp"
|
|
||||||
for /f "usebackq skip=2" %%A IN ("%TEMP%\_envget.tmp") do (
|
|
||||||
if /I not "%%~A"=="Path" (
|
|
||||||
call :SetFromReg "%~1" "%%~A" "%%~A"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
goto :EOF
|
|
||||||
|
|
||||||
:main
|
|
||||||
echo/@echo off >"%TEMP%\_env.cmd"
|
|
||||||
|
|
||||||
:: Slowly generating final file
|
|
||||||
call :GetRegEnv "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" >> "%TEMP%\_env.cmd"
|
|
||||||
call :GetRegEnv "HKCU\Environment">>"%TEMP%\_env.cmd" >> "%TEMP%\_env.cmd"
|
|
||||||
|
|
||||||
:: Special handling for PATH - mix both User and System
|
|
||||||
call :SetFromReg "HKLM\System\CurrentControlSet\Control\Session Manager\Environment" Path Path_HKLM >> "%TEMP%\_env.cmd"
|
|
||||||
call :SetFromReg "HKCU\Environment" Path Path_HKCU >> "%TEMP%\_env.cmd"
|
|
||||||
|
|
||||||
:: Caution: do not insert space-chars before >> redirection sign
|
|
||||||
echo/set "Path=%%Path_HKLM%%;%%Path_HKCU%%" >> "%TEMP%\_env.cmd"
|
|
||||||
|
|
||||||
:: Cleanup
|
|
||||||
del /f /q "%TEMP%\_envset.tmp" 2>nul
|
|
||||||
del /f /q "%TEMP%\_envget.tmp" 2>nul
|
|
||||||
|
|
||||||
:: capture user / architecture
|
|
||||||
SET "OriginalUserName=%USERNAME%"
|
|
||||||
SET "OriginalArchitecture=%PROCESSOR_ARCHITECTURE%"
|
|
||||||
|
|
||||||
:: Set these variables
|
|
||||||
call "%TEMP%\_env.cmd"
|
|
||||||
|
|
||||||
:: Cleanup
|
|
||||||
del /f /q "%TEMP%\_env.cmd" 2>nul
|
|
||||||
|
|
||||||
:: reset user / architecture
|
|
||||||
SET "USERNAME=%OriginalUserName%"
|
|
||||||
SET "PROCESSOR_ARCHITECTURE=%OriginalArchitecture%"
|
|
||||||
|
|
||||||
echo | set /p dummy="Finished."
|
|
||||||
echo .```
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
@REM @echo off
|
|
||||||
|
|
||||||
call setup.bat
|
|
||||||
|
|
||||||
cd ..\..
|
|
||||||
|
|
||||||
start /B cmd /C call .venv\Scripts\python.exe -m src.gui
|
|
||||||
|
|
||||||
cd scripts\windows
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
@echo off
|
|
||||||
|
|
||||||
@REM Install Python using WinGet if necessary
|
|
||||||
python --version >nul 2>&1 || ( winget install -e --id Python.Python.3.10 )
|
|
||||||
|
|
||||||
@REM Install ffmpeg using WinGet if necessary
|
|
||||||
ffmpeg -version >nul 2>&1 || ( winget install ffmpeg )
|
|
||||||
|
|
||||||
@REM Refresh the environment vars so any installed commands above are active
|
|
||||||
call refresh_env.bat
|
|
||||||
|
|
||||||
@REM Set up the venv if it needs to be
|
|
||||||
if not exist ..\..\.venv\ ( python -m venv ..\..\.venv )
|
|
||||||
|
|
||||||
@REM Install required scripts
|
|
||||||
..\..\.venv\Scripts\pip.exe install -r ..\..\requirements.txt
|
|
||||||
|
|
||||||
@REM Activate the new venv
|
|
||||||
..\..\.venv\Scripts\activate.bat
|
|
||||||
|
|
@ -75,7 +75,6 @@ class FolderProcessor:
|
||||||
|
|
||||||
src: Path = Path(self.input_dir)
|
src: Path = Path(self.input_dir)
|
||||||
dest: Path = Path(self.output_dir)
|
dest: Path = Path(self.output_dir)
|
||||||
cur_dir: Path = Path(".").resolve() # Used just for logging
|
|
||||||
|
|
||||||
if not src.exists():
|
if not src.exists():
|
||||||
raise Exception("Input directory does not exist!")
|
raise Exception("Input directory does not exist!")
|
||||||
|
|
@ -103,12 +102,12 @@ class FolderProcessor:
|
||||||
file_output_root = Path(file_output_root).resolve()
|
file_output_root = Path(file_output_root).resolve()
|
||||||
# We also need to replace the original {file} extension with .mp3
|
# We also need to replace the original {file} extension with .mp3
|
||||||
filename_with_mp3_ext = f"{Path(file).stem}.mp3"
|
filename_with_mp3_ext = f"{Path(file).stem}.mp3"
|
||||||
file_dest = file_output_root.joinpath(filename_with_mp3_ext)
|
file_dest = file_output_root.joinpath(filename_with_mp3_ext).resolve()
|
||||||
# Make the output subdir(s) and move the no-drums file from the temp output to the final destination
|
# Make the output subdir(s) and move the no-drums file from the temp output to the final destination
|
||||||
os.makedirs(file_output_root, exist_ok=True)
|
os.makedirs(file_dest.parent, exist_ok=True)
|
||||||
shutil.move(no_drums_path, file_dest)
|
shutil.move(no_drums_path, file_dest)
|
||||||
|
|
||||||
self.output.info(f"Done processing {original_path.name} and relocated it to {file_dest.relative_to(cur_dir)}!")
|
self.output.info(f"✅ Done Processing {filename_with_mp3_ext}")
|
||||||
|
|
||||||
# Remove the model output since we don't need it anymore
|
# Remove the model output since we don't need it anymore
|
||||||
if os.path.exists(self.model_name):
|
if os.path.exists(self.model_name):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue