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

Any docs/examples on how to do the audio separation with HP5_only_main_vocal and DeEcho #23

Open
ybwai opened this issue Mar 20, 2024 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ybwai
Copy link

ybwai commented Mar 20, 2024

Is this available in this version of the project yet? if so any examples, trying to migrate from the old repo where it was working.

thanks,

@Tps-F Tps-F added the help wanted Extra attention is needed label Mar 22, 2024
@Tps-F
Copy link
Member

Tps-F commented Mar 22, 2024

I'll make it!

@ybwai
Copy link
Author

ybwai commented Apr 2, 2024

doing something like this returns me two files that are the same as the input, what am I getting wrong?

from rvc.modules.uvr5.vr import AudioPreprocess

def separate():
    input_path = f"{project_dir}/sandbox/inputs/input.mp3"
    output_path = Path(f"{project_dir}/sandbox/outputs/")

    model_name = "HP5_only_main_vocal.pth"
    model_path = os.path.join(os.getenv("weight_uvr5_root"), model_name)
    agg = 10  

    pre_fun = AudioPreprocess(model_path, agg)
    result = pre_fun.process(input_path)

    wav_instrument, wav_vocals, sr, agg = result
    sf.write(f"{output_path}/instrumental.wav", wav_instrument / 32768, sr)
    sf.write(f"{output_path}/vocals.wav", wav_vocals / 32768, sr)


@ybwai
Copy link
Author

ybwai commented Apr 9, 2024

The cli and api endpoint seem to make use of a wrapper:

    uvr_module.uvr_wrapper(
        inputpath, outputpath, model_name=modelname, export_format=format
    )
    ```
    
    But not sure this actually works, as the wrapper does not accept an output_path, it returns the files.
    
    Have also tried to use the wrapper directly:
    
    ```
        uvr = UVR()
    results = uvr.uvr_wrapper(input_path, agg=10, model_name="HP3_all_vocals.pth")

    for i, result in enumerate(results):
        wav_instrument, wav_vocals, sr, agg = result
        sf.write(f"{output_path}/instrument_{i}.wav", wav_instrument / 32768, sr)
        sf.write(f"{output_path}/vocals_{i}.wav", wav_vocals / 32768, sr)

but sadly I still get the same issue of the instrumental and vocals files being the same (original audio). Any help @Tps-F ?

@Tps-F
Copy link
Member

Tps-F commented Apr 9, 2024

I will check, It could be a bug.

@Tps-F Tps-F added the bug Something isn't working label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants