You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was reading model.h and came across this function and I'm confused as to why it requires a pointer to a VmafModel as well as a VmafModelCollection. I did some more looking and from what I can tell the very first model in the model collection gets put into **model while the rest of the models go into **model_collection. What are we supposed to do with **model? and why doesn't the first model in the model collection json file get added to the model collection struct?
function model_collection_parse
here's where I found where **model and **model_collection are being set
unsignedi=0;
while (json_peek(s) !=JSON_OBJECT_END&& !json_get_error(s)) {
if (json_next(s) !=JSON_STRING)
return-EINVAL;
constchar*key=json_get_string(s, NULL);
snprintf(generated_key, generated_key_sz, "%d", i);
if (!strcmp(key, generated_key)) {
VmafModel*m;
err=vmaf_read_json_model(&m, &c, s);
if (err) returnerr;
if (i==0) {
// First iteration of this loop. *model is set to m// m is never added to the model collection on the first loop... why?*model=m;
c.name=cfg_name;
} else {
err=vmaf_model_collection_append(model_collection, m);
if (err) returnerr;
}
sprintf((char*)c.name, "%s_%04d", name, ++i);
continue;
}
libvmaf.h
here's where we use our model collection. What are we supposed to be doing with the VmafModel pointer returned by vmaf_model_collection_load?
/** * Register feature extractors required by a specific `VmafModelCollection` * Like `vmaf_use_features_from_model()`, this function may be called * multiple times using different model collections. * * @param vmaf The VMAF context allocated with `vmaf_init()`. * * @param model_collection Opaque model collection context. * * * @return 0 on success, or < 0 (a negative errno code) on error. */intvmaf_use_features_from_model_collection(VmafContext*vmaf,
VmafModelCollection*model_collection);
The text was updated successfully, but these errors were encountered:
I was reading
model.h
and came across this function and I'm confused as to why it requires a pointer to a VmafModel as well as a VmafModelCollection. I did some more looking and from what I can tell the very first model in the model collection gets put into**model
while the rest of the models go into**model_collection
. What are we supposed to do with**model
? and why doesn't the first model in the model collection json file get added to the model collection struct?model.h
read_json_model.c
function
model_collection_parse
here's where I found where
**model
and**model_collection
are being setlibvmaf.h
here's where we use our model collection. What are we supposed to be doing with the VmafModel pointer returned by
vmaf_model_collection_load
?The text was updated successfully, but these errors were encountered: