-
Notifications
You must be signed in to change notification settings - Fork 757
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
Libvmaf Feature request: List of built in models #1128
Comments
Here's the list of built in models i'm referring to in libvmaf/src/model.c static const VmafBuiltInModel built_in_models[] = {
#if VMAF_BUILT_IN_MODELS
#if VMAF_FLOAT_FEATURES
{
.version = "vmaf_float_v0.6.1",
.data = &src_vmaf_float_v0_6_1_json,
.data_len = &src_vmaf_float_v0_6_1_json_len,
},
{
.version = "vmaf_float_b_v0.6.3",
.data = &src_vmaf_float_b_v0_6_3_json,
.data_len = &src_vmaf_float_b_v0_6_3_json_len,
},
{
.version = "vmaf_float_v0.6.1neg",
.data = &src_vmaf_float_v0_6_1neg_json,
.data_len = &src_vmaf_float_v0_6_1neg_json_len,
},
{
.version = "vmaf_float_4k_v0.6.1",
.data = &src_vmaf_float_4k_v0_6_1_json,
.data_len = &src_vmaf_float_4k_v0_6_1_json_len,
},
#endif
{
.version = "vmaf_v0.6.1",
.data = &src_vmaf_v0_6_1_json,
.data_len = &src_vmaf_v0_6_1_json_len,
},
{
.version = "vmaf_b_v0.6.3",
.data = &src_vmaf_b_v0_6_3_json,
.data_len = &src_vmaf_b_v0_6_3_json_len,
},
{
.version = "vmaf_v0.6.1neg",
.data = &src_vmaf_v0_6_1neg_json,
.data_len = &src_vmaf_v0_6_1neg_json_len,
},
{
.version = "vmaf_4k_v0.6.1",
.data = &src_vmaf_4k_v0_6_1_json,
.data_len = &src_vmaf_4k_v0_6_1_json_len,
},
#endif
{ 0 }
}; You may not want to expose this struct directly, but a function that returns an array of strings containing the "version" field of these structs would be nice |
Yes, we would need to add a public API for that. I would be open to adding, I think it would be useful. |
Should I create a PR? |
Yes, feel free to give it a shot. I would prefer an iterator function to scan through them. See this one from FFmpeg for inspiration: https://github.com/FFmpeg/FFmpeg/blob/master/libavcodec/codec_desc.h#L109-L116 |
Cool, I'll give it a try |
Wrote an implementation based on avcodec_descriptor_next from avcodec. |
Hey I'm trying to write a rust wrapper library around libvmaf and I'm stuck on the implementation of
VmafModel
It seems that I can pass the name of the model into the "version" param of vmaf_model_load but there doesn't seem to be any variable or function I can use to get a list of valid strings that I can pass to this param. I can see that in model.c there seems to be a list of models that are imported alongisde their respective data in a variable calledbuilt_in_models
which is an array ofVmafBuiltInModel
Neither VmafBuiltInModel nor built_in_models are exposed in the headers of the library, meaning that my bindgen script can't create definitions for them automatically. The alternative is that I would have to manually keep a list of what models that vmaf includes in my wrapper library which seems fragileThe text was updated successfully, but these errors were encountered: