Comments (17)
Yes, this is a good feature. Adding python bindings is planned, and would be a first step in that direction.
from visqol.
Just a heads up I'm working on numpy and protobuf compatible bindings via pybind11, I hope to push to visqol after sorting out some remaining issues. That would be the precursor to the pip installable package.
from visqol.
I have built and containerised ViSQOL v3 here: https://hub.docker.com/r/jonashaag/visqol
from visqol.
If anyone wants to reproduce the build, here's what I'm using:
Build ViSQOL:
FROM ubuntu:18.04
RUN apt update \
&& apt -y install curl gnupg \
&& curl https://bazel.build/bazel-release.pub.gpg | apt-key add - \
&& echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list \
&& apt update && apt -y install git bazel libboost-all-dev
RUN git clone https://github.com/google/visqol \
&& cd visqol \
&& bazel build :visqol -c opt
Extract binaries from container:
docker cp <container id>:/visqol/bazel-bin/visqol visqol
docker cp <container id>:/visqol/model model
Build final image:
FROM ubuntu:18.04
COPY visqol /visqol/
COPY model /visqol/model/
WORKDIR /visqol
ENTRYPOINT ["./visqol"]
from visqol.
Incremental progress: pull request #26 is the pybind11 ViSQOL-side code to run as python. It won't be functional until some changes land in pybind11 repos for abseil/protobuf, but you can take a look as a preview. An interesting feature is that it allows using ViSQOL with numpy and you can use the return protobufs or status automatically.
from visqol.
Sorry for the delay. The current status is that we have this working internally, but I am working with the owners of https://github.com/pybind/pybind11_abseil and https://github.com/pybind/pybind11_protobuf. It's taking a bit to work out the kinks since this is the first external launch of pybind11 for those frameworks, so some general issues need to be resolved first.
from visqol.
#66 just merged and has python support (see tests/visqol_lib_py_test.py for examples). So far it only works on linux and mac. (I put some effort into Windows, so it builds but fails to import). This is not a pip-installable package, but presumably this can be used for that.
Thank you @yuribondarenko for the interim python support.
from visqol.
Great !
Do you have any idea of the timeline for that?
from visqol.
Any update on this?
from visqol.
Hi, any update on visqol as python lib? Thaanks
from visqol.
Since the official python bindings are not ready yet, I made a makeshift python wrapper that uses jonashaag's visqol docker image. It's not very fast, and it's not glamorous, but it works. Check out the python snippet here:
https://gist.github.com/iver56/02daea5f35db744d21bdad2d25c30e22
Hopefully the official python bindings (with less overhead) will be available soon.
from visqol.
Thanks @iver56 that's quite interesting, and I hope that unblocks some people.
The original plan was to use pybind11 for ViSQOL. Sorry that is taking so much longer than planned. This is implemented and works internally, but the github version is still not yet pushed - there is currently support for abseil, but not protobuf (https://github.com/pybind/pybind11_protobuf). However, it is in development.
from visqol.
Docker install for now?
from visqol.
I've updated python bindings implementation and fixed Bazel builds for it here #59. So far it works only for Linux. One can build a shared object with bazel build -c opt //python:pyvisqol.so
. Then use it as a python package (either move it or set PYTHONPATH to the folder with .so). From python:
import pyvisqol
visqol = pyvisqol.ViSQOL("path/to/libsvm_nu_svr_model.txt") # check usage for more options
# load reference ref and degraded audio deg as a list of floats (1D numpy arrays are also supported)
score = visqol.run(ref, ref_sr, deg, deg_sr)
# or use files directly
score = visqol.run("path/to/reference.wav", "path/to/degraded.wav")
from visqol.
So it can't works for windows, what a pity. :(
from visqol.
To be clear, Windows works with the normal C++ usage, but the python support is not yet there. Windows python doesn't work because the pybind11 support was not yet implemented upstream AFAICT. This is not ideal but the other option would be to delay the mac and linux python versions until this was addressed, so I chose to release as is. If anyone wants to contribute upstream, Windows python support is a great place to make an impact in pybind11_bazel/pybind11_protobuf/pybind11_absl.
from visqol.
See #81 which was just merged for a local solution.
from visqol.
Related Issues (20)
- install python package failed HOT 3
- Segmentation fault (core dumped)
- What kind of question is that HOT 3
- Cannot be used for testing Opus encoded files? HOT 2
- Input sample rate 8kHz HOT 2
- M2 Mac issue
- Hello, everyone. When i build visqol, why the warning saying Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/4ce3e4da2e21ae4dfcee9366415e55f408c884ec.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found HOT 2
- Does anyone can share the VISQOL package on Linux or Windows HOT 1
- Reference File is shorter than degraded file -> MemoryError: std::bad_alloc HOT 2
- Please specify the supported Python versions. HOT 1
- bazel build uses system Python instead of current conda environment
- Building fails under Ubuntu 18.04 with GCC 7 HOT 3
- ImportError: initialization failed when trying to import in python HOT 2
- Do not get the maximum of MOS value using two same audio under speech mode HOT 2
- MOS-LQO results are low in speech mode
- Build did NOT complete successfully
- SegFault with Python bindings HOT 1
- Shows Build did NOT complete successfully when building visqol HOT 2
- Build the bazel failed
- build visqol with python
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from visqol.