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

Updating feature extractor for handling special arg idx is complicated #82

Open
hagenw opened this issue Oct 21, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@hagenw
Copy link
Member

hagenw commented Oct 21, 2022

As shown in the docs, we can handle models that have different heads for different sexes, e.g.

def f0(signal, sampling_rate, idx, gender, f0_range):
    # extract mean f0 using a gender adapted range
    y = librosa.yin(
        signal,
        fmin=f0_range[gender[idx]][0],
        fmax=f0_range[gender[idx]][1],
        sr=sampling_rate,
    ).mean()
    return y, gender[idx]

interface = audinterface.Feature(
    ['f0', 'gender'],
    process_func=f0,
    process_func_args={
        'gender': gender,
        'f0_range': f0_range,
    },
)

The problem is that the gender argument is not really static but depends on the input data.
To update it you would need to create a new Feature object for each new database, which is not what we want for ONNX models, or you could update the process_func_args, which is ok, but they are hidden under interface.process.process_func_args.

So maybe we update the documentation by showing an example how to update them?

@hagenw hagenw changed the title Updating feature extractor for handling special arg idx complicated Updating feature extractor for handling special arg idx is complicated Oct 24, 2022
@hagenw hagenw added the enhancement New feature or request label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant