Retrieval-based-Voice-Conversion-WebUI icon indicating copy to clipboard operation
Retrieval-based-Voice-Conversion-WebUI copied to clipboard

ONNX is up to date?

Open CircuitCM opened this issue 1 year ago • 12 comments

Hello,

Wondering if onnx_inference.py is up to date? I want to get inferencing working programmatically for my own work. It seems like rmvpe and crepe are not supported? Would it be best for me to rely on the vc.pipeline module instead? Thanks

def get_f0_predictor(f0_predictor, hop_length, sampling_rate, **kargs):
    if f0_predictor == "pm":
        from lib.infer_pack.modules.F0Predictor.PMF0Predictor import PMF0Predictor

        f0_predictor_object = PMF0Predictor(
            hop_length=hop_length, sampling_rate=sampling_rate
        )
    elif f0_predictor == "harvest":
        from lib.infer_pack.modules.F0Predictor.HarvestF0Predictor import (
            HarvestF0Predictor,
        )

        f0_predictor_object = HarvestF0Predictor(
            hop_length=hop_length, sampling_rate=sampling_rate
        )
    elif f0_predictor == "dio":
        from lib.infer_pack.modules.F0Predictor.DioF0Predictor import DioF0Predictor

        f0_predictor_object = DioF0Predictor(
            hop_length=hop_length, sampling_rate=sampling_rate
        )
    else:
        raise Exception("Unknown f0 predictor")
    return f0_predictor_object

CircuitCM avatar Dec 06 '23 20:12 CircuitCM

Dio works, harvest in there is broken, others most likely too. I suppose you'd have to implement other methods on your own I too plan on doing it, somehow, but it might take a heck of time given ain't a programmer, yea but overal, I'd rely on vc.pipeline for referencing yea as onnx demo's code is outdated or just simply stripped

btw, you can get rvc onnx models ( imo best way atm ) simply by using 0618 release, newer are broken that way. ( tho, change opset_version=13, to 16 in infer-web, + get the latest runtime, 1.16.3, works all fine. )

codename0og avatar Dec 09 '23 00:12 codename0og

i think f-tps was corrected on new repo...

THE-SINDOL avatar Dec 16 '23 00:12 THE-SINDOL

i think f-tps was corrected on new repo...

nope, if you mean the most recent " bug fix " then nope, still broken

codename0og avatar Dec 16 '23 05:12 codename0og

@codename0og Luckily I can code a little. I've tested it and at least for inferencing RMVPE is definitely the best. I also found it wasn't relevant to update the ONNX framework because all the online models use .pth .index files and a decent part of the pitch extracting and inferencing code would need to be rewritten anyway. The point of the ONNX export is for it to be easy and low-code but that wasn't the case.

Instead I just finished a fork that is very light weight, easy to install and built just for inference and includes RMVPE. It works for python 3.11 and it's simple to slot into existing code.

Check it out if you want.

CircuitCM avatar Dec 16 '23 22:12 CircuitCM

I fixed the Harvest issue, is this the issue about the problem reported by @codename0og before? Please describe the specific problem or error code

Tps-F avatar Dec 17 '23 14:12 Tps-F

I fixed the Harvest issue, is this the issue about the problem reported by @codename0og before? Please describe the specific problem or error code

how did you fix it?

bzp83 avatar Mar 18 '24 09:03 bzp83

@bzp83 You gotta open up the: infer/lib/infer_pack/modules/F0Predictor/HarvestF0Predictor.py

and replace: fs=self.hop_length,

with: fs=self.sampling_rate,

and that's pretty much it. If you're searching for simple onnx inference, check it out: https://github.com/codename0og/RVC_Onnx_Infer

I have in plans on potentially expanding my rvc fork ( non published yet ) with onnx infer incl. index support and other f0 methods if that's within anyone's interest.

codename0og avatar Mar 18 '24 18:03 codename0og

@bzp83 You gotta open up the: infer/lib/infer_pack/modules/F0Predictor/HarvestF0Predictor.py

and replace: fs=self.hop_length,

with: fs=self.sampling_rate,

and that's pretty much it. If you're searching for simple onnx inference, check it out: https://github.com/codename0og/RVC_Onnx_Infer

I have in plans on potentially expanding my rvc fork ( non published yet ) with onnx infer incl. index support and other f0 methods if that's within anyone's interest.

thanks! it worked.

Your project is good, easier to use. Thanks. I starred it.

Any idea about how to use RMVPE?

thanks!

bzp83 avatar Mar 18 '24 21:03 bzp83

@bzp83 you'd have to implement it as there's just pm, dio, harvest rn

codename0og avatar Mar 19 '24 02:03 codename0og

@bzp83 you'd have to implement it as there's just pm, dio, harvest rn

I can try that if that's the fastest... do you think that is the fastest if I have CPU only? If it's not, what's the best/fastest one for CPU?

thanks!

bzp83 avatar Mar 19 '24 05:03 bzp83

@bzp83 well, tbf, rmvpe is the fastest if we speak of quality but if pure pure performance is what you crave for, I'd say PM and Dio are the fastest

codename0og avatar Mar 20 '24 12:03 codename0og

@bzp83 well, tbf, rmvpe is the fastest if we speak of quality but if pure pure performance is what you crave for, I'd say PM and Dio are the fastest

thank you!!

bzp83 avatar Mar 20 '24 13:03 bzp83