获取VMAF源码
git clone https://github.com/Netflix/vmaf.git
cd vmaf
git submodule update --init --recursive
编译
安装依赖库
pip3 install numpy scipy matplotlib pandas scikit-learn scikit-image h5py sureal
编译
make
编译过程中可能出现某些头文件找不到的情况,需要修改vmaf/python/setup.py中的配置。如下所示:
import os
from distutils.core import setup
from Cython.Build import cythonize
from distutils.extension import Extension # new add
import numpy
pass
return "0.0-dev"
# new add
ext_modules=[
Extension("adm_dwt2_cy",
sources=["vmaf/core/adm_dwt2_cy.pyx"],
include_dirs=[numpy.get_include(), '../libvmaf/src']
)
]
setup(
'run_vmafossexec_subsampling=vmaf.script.run_vmafossexec_subsampling:main'
]
},
#ext_modules=cythonize(['vmaf/core/adm_dwt2_cy.pyx']), // delete
#include_dirs=[numpy.get_include(), '../libvmaf/src'] // delete
ext_modules=cythonize(ext_modules) # new add
)
再次编译就不会报找不到头文件的错误了。
安装
make install
验证
vmafossexec -help
Usage: vmafossexec fmt width height ref_path dis_path model_path [--log log_path] [--log-fmt log_fmt] [--thread n_thread] [--subsample n_subsample] [--disable-clip] [--disable-avx] [--psnr] [--ssim] [--ms-ssim] [--phone-model] [--pool pool_method] [--ci]
fmt:
yuv420p
yuv422p
yuv444p
yuv420p10le
yuv422p10le
yuv444p10le
log_fmt:
xml (default)
json
csv
n_thread:
maximum threads to use (default 0 - use all threads)
n_subsample:
n indicates computing on one of every n frames (default 1)
pool_method:
mean (default)
harmonic_mean
min
说明安装成功。