Video quality assessment tool-VMAF
According to official documents, or articles of peers, after installing VMAF, various problems have appeared, and they have been solved one by one after a long time. Only this article records.
Installation record
(1) Install python3.5 and above
(2) Preparation of compilation environment
brew install gcc meson doxygen nasm freetype pkg-config hdf5
brew install numpy scipy
(3) Download and install VMAF
# 下载源码
git clone https://github.com/Netflix/vmaf.git
cd vmaf
git submodule update --init --recursive
# 编译
make
You may encounter an error:'mem.h' file not found
Error message:
A. According to the error message, I see line 22 of vmaf/core/…/…/…/libvmaf/src/feature/adm_tools.c: #include "mem.h" error: mem.h not found
B. find directory Is there mem.h under vmaf
$ find vmaf/ -name mem.h
.//libvmaf/src/mem.h # 该目录下有mem.h文件
C. Problem solving
Open mem.h and look at it, no other files are referenced, so copy mem.h directly to the same level directory of adm_tools.c.
Execute make clean && make again to compile and pass.
Continue to install:
cd python
pip3 install cython
pip3 install -r requirements.txt
pip3 install --user . # 此时,会出现各种报错
Error 2:
vmaf/core/adm_dwt2_cy.c:637:10: fatal error: '../../../libvmaf/src/feature/adm_tools.c' file not found
It is found through ls that the file exists and the relative path is no problem, but the C language is not found. Because C has already been returned to the university teacher, it is temporarily changed to an absolute path (you can leave a message if you know how to solve it)
After the modification, continue to execute pip3 install --user .
, showing that the vmaf installation is successful
(4) Environment variable configuration
Add export PATH="$PATH:$HOME/.local/bin"
to ~/.profile to
execute source ~/.profile
the configuration to take effect
(5) Unit testing
In the vmaf root directory,
./unittest
The results of the execution may be successful or failed. Continue the steps below.
(6) Test verification
PYTHONPATH=python ./python/vmaf/script/run_vmaf.py \
yuv420p 576 324 \
python/test/resource/yuv/src01_hrc00_576x324.yuv \
python/test/resource/yuv/src01_hrc01_576x324.yuv \
--out-fmt json
When executed, an error is reported:Can't import svmutil from /Users/lizhen/Library/Python/3.8/lib/python/third_party/libsvm/python: No module named 'svmutil'
Checking /Users/lizhen/Library/Python/3.8/lib/python/third_party/libsvm/python, I found that the file does not exist, and I look dumbfounded. (Welcome to leave a message if you have solved this problem)
However, it was initially suspected that it was a problem with the python environment, so I used Pycharm to directly open the vmaf/python project to create an env virtual environment.
In the python virtual environment, run:
Another error:
Traceback (most recent call last):
File "./vmaf/script/run_vmaf.py", line 13, in <module>
from vmaf.config import VmafConfig, DisplayConfig
ModuleNotFoundError: No module named 'vmaf'
This is fairly easy to solve:
Continue execution:
python ./vmaf/script/run_vmaf.py yuv420p 576 324 test/resource/yuv/src01_hrc00_576x324.yuv test/resource/yuv/src01_hrc01_576x324.yuv --out-fmt json
Ok, finally done, MD.
- The VMAF_score score is the final score, and the others are the basic indicator scores of VMAF.
- adm2, vif_scalex score range 0 (worst) to 1 (best)
- motion2 score range 0 (stationary) to 20 (high-speed motion)