Skip to content

Commit

Permalink
5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Captain-FLAM committed Nov 13, 2023
1 parent d5bf62c commit 3c03fa0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions App/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,7 @@ def Extract_with_Model(self, type, audio, model):
source = librosa.util.fix_length(source, size = audio.shape[-1])

del sources; mdx23 = mdx23.cpu(); del mdx23; gc.collect()

if torch.cuda.is_available():
torch.cuda.empty_cache()

Expand Down Expand Up @@ -645,6 +646,8 @@ def Extract_with_Model(self, type, audio, model):
# vocals_mid = lr_filter(lr_filter((2 * vocals_mdxb2.T + 2 * vocals_SRS.T + vocals_demucs.T) / 5, 16500, 'lowpass', order=24), 12000, 'highpass', order=12)
# vocals_high = lr_filter((vocals_demucs.T + vocals_SRS.T) / 2, 16500, 'highpass', order=24)
# vocals = (vocals_low + vocals_mid + vocals_high) * 1.0074

del audio_SRS; del source_SRS; gc.collect()

# 2 - Low SRS -> Bigshifts only 1 pass, else bad SDR

Expand Down Expand Up @@ -679,6 +682,8 @@ def Extract_with_Model(self, type, audio, model):

source = App.audio_utils.Make_Ensemble('Max', [source, source_SRS])

del audio_SRS; del source_SRS; gc.collect()

if not self.large_gpu: self.Kill_MDX(name)

source = source * model['Compensation'] # Volume Compensation
Expand Down
3 changes: 2 additions & 1 deletion KaraFan.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# KaraFan works on your PC !!

import os, sys, subprocess, platform
import os, gc, sys, subprocess, platform

try:
import wx
Expand Down Expand Up @@ -46,6 +46,7 @@ try:
frame = Gui.wx_Main.KaraFanForm(None, {'Gdrive': Gdrive, 'Project': Project, 'isColab': False})
frame.Show()
app.MainLoop()
gc.collect()

except Exception as e:
Gui.wx_Error.Report(f"{e.__class__.__name__} : {e}", sys.exc_info()[2], frame)

0 comments on commit 3c03fa0

Please sign in to comment.