Coder Social home page Coder Social logo

Comments (9)

melhindi avatar melhindi commented on July 20, 2024 2

Hi,
I am running ubuntu 21.04 and I had to do the following to be able to build and install the plugin:

  • Remove OBS-Studio installed via snap and install OBS-Studio via ppa (sudo apt install obs) [this was required due to dependency conflicts with libobs-dev]
  • Install dependencies as mentioned in README
apt install -y libobs-dev libopencv-dev language-pack-en wget git build-essential cmake
wget https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz
tar xzvf onnxruntime-linux-x64-1.7.0.tgz --strip-components=1 -C /usr/local/ --wildcards "*/include/*" "*/lib*/"
  • Run: cmake -S . -B build -DobsIncludePath=/usr/include/obs to configure the build [this was required since LibObs could not be found (missing: LIBOBS_INCLUDE_DIR) ]
  • Run build and install cmake --install build && sudo cmake --install build [sudo was required for installation since we are installing to /usr/...]
  • Last but not least I found that the plugin was installed to the wrong directories (my OBS installation did not load the plugin). So, I had to do the following in addition:
sudo mv /usr/local/share/obs/obs-plugins/obs-backgroundremoval /usr/share/obs/obs-plugins
sudo mv /usr/local/lib/obs-plugins/obs-backgroundremoval.so /usr/lib/obs-plugins

I was not able to find an official statement about the correct plugin install directory, but the information written in this forum helped me: https://forums.linuxmint.com/viewtopic.php?t=278509

If people agree that this is the correct installation procedure/location, I am happy to create a PR.

from obs-backgroundremoval.

Wurschdbude avatar Wurschdbude commented on July 20, 2024 1

@ysalmon THX alot for the hint regarding correct branch. This solved it for me. I also use PPA on Ubuntu 20.04 and cloned the repository for the headers.

I did not install to /usr, instead i moved to the following structure, which i prefer for my obs-installation:

~/.config/obs-studio/plugins/obs-backgroundremoval/
├── bin
│   └── 64bit
│       └── obs-backgroundremoval.so
└── data
    ├── SINet_Softmax.onnx
    └── SINet_Softmax_simple.onnx

In my case i did not need to sudo ldconfig.

from obs-backgroundremoval.

royshil avatar royshil commented on July 20, 2024

@ysalmon @Wurschdbude can y'all plz make a PR with fixes to the README?

from obs-backgroundremoval.

marcelotrevisani avatar marcelotrevisani commented on July 20, 2024

@ysalmon THX alot for the hint regarding correct branch. This solved it for me. I also use PPA on Ubuntu 20.04 and cloned the repository for the headers.

I did not install to /usr, instead i moved to the following structure, which i prefer for my obs-installation:

~/.config/obs-studio/plugins/obs-backgroundremoval/
├── bin
│   └── 64bit
│       └── obs-backgroundremoval.so
└── data
    ├── SINet_Softmax.onnx
    └── SINet_Softmax_simple.onnx

In my case i did not need to sudo ldconfig.

I was not able to use the snap configuration
for some reason is not finding the libonnxruntime

error: os_dlopen(/home/bb8/snap/obs-studio/1195/.config/obs-studio/plugins/obs-backgroundremoval/bin/64bit/obs-backgroundremoval.so->/home/bb8/snap/obs-studio/1195/.config/obs-studio/plugins/obs-backgroundremoval/bin/64bit/obs-backgroundremoval.so): libonnxruntime.so.1.7.0: cannot open shared object file: No such file or directory

warning: Module '/home/bb8/snap/obs-studio/1195/.config/obs-studio/plugins/obs-backgroundremoval/bin/64bit/obs-backgroundremoval.so' not loaded
ldd obs-backgroundremoval.so | grep onnx
	libonnxruntime.so.1.7.0 => /usr/local/lib/libonnxruntime.so.1.7.0 (0x00007f794a5d3000)

however, the file is there

ls /usr/local/lib/libonnxruntime.so.1.7.0
/usr/local/lib/libonnxruntime.so.1.7.0

from obs-backgroundremoval.

coleshaw avatar coleshaw commented on July 20, 2024

@marcelotrevisani , curious if you figured out the issue you were having with OBS not finding libonnxruntime.so.1.7.0? I'm running into the same error using a flatpak installation...

from obs-backgroundremoval.

mjevans avatar mjevans commented on July 20, 2024

I am attempting to build this on Debian stable (11 Bullseye released in 2021), following the current Linux directions with some minor changes.

# # language-pack-en is missing, 
$ sudo apt install -y libobs-dev libopencv-dev wget git build-essential cmake libonnx-dev
$ git clone https://github.com/royshil/obs-backgroundremoval.git .
$ mkdir obs-backgroundremoval/build && cd obs-backgroundremoval/build && \
   cmake .. && cmake --build . && cmake --install .

-- Found Git: /usr/bin/git (found version "2.30.2")
-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find LibObs (missing: LIBOBS_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
external/FindLibObs.cmake:97 (find_package_handle_standard_args)
CMakeLists.txt:69 (find_package)

-- Configuring incomplete, errors occurred!
See also ".../src-obs-backgroundremoval/build/CMakeFiles/CMakeOutput.log".

dpkg -l *onnx*
ii libonnx-dev:amd64 1.7.0+dfsg-3 amd64 Open Neural Network Exchange (ONNX) (dev)
ii libonnx1:amd64 1.7.0+dfsg-3 amd64 Open Neural Network Exchange (ONNX) (libs)
ii libonnxifi:amd64 1.7.0+dfsg-3 amd64 Open Neural Network Exchange (ONNX) (ONNXIFI)

dpkg -l '*obs*'
ii libobs-dev:amd64 1:27.0.1-dmo2 amd64 recorder and streamer for live video content (development files)
ii libobs0:amd64 1:27.0.1-dmo2 amd64 recorder and streamer for live video content (shared library)
ii obs-plugins 1:27.0.1-dmo2 amd64 recorder and streamer for live video content (plugins)
ii obs-studio 1:27.0.1-dmo2 amd64 recorder and streamer for live video content

Didn't get there yet, but in case it does...

find /usr -iname '*libonnx*'
/usr/lib/x86_64-linux-gnu/libonnx.so.1
/usr/lib/x86_64-linux-gnu/libonnx_proto.so.1
/usr/lib/x86_64-linux-gnu/libonnxifi_dummy.so
/usr/lib/x86_64-linux-gnu/libonnxifi_loader.a
/usr/lib/x86_64-linux-gnu/libonnx.so
/usr/lib/x86_64-linux-gnu/libonnx_proto.so
/usr/lib/libonnxifi.so
/usr/share/doc/libonnx1
/usr/share/doc/libonnxifi
/usr/share/doc/libonnx-dev
/usr/share/lintian/overrides/libonnxifi

find /usr -iname '*libobs*'
/usr/lib/x86_64-linux-gnu/pkgconfig/libobs.pc
/usr/lib/x86_64-linux-gnu/cmake/LibObs
/usr/lib/x86_64-linux-gnu/cmake/LibObs/LibObsConfig.cmake
/usr/lib/x86_64-linux-gnu/cmake/LibObs/LibObsConfigVersion.cmake
/usr/lib/x86_64-linux-gnu/cmake/LibObs/LibObsTarget-release.cmake
/usr/lib/x86_64-linux-gnu/cmake/LibObs/LibObsTarget.cmake
/usr/lib/x86_64-linux-gnu/libobs-frontend-api.so.0.0
/usr/lib/x86_64-linux-gnu/libobs-opengl.so.0.0
/usr/lib/x86_64-linux-gnu/libobs.so.0
/usr/lib/x86_64-linux-gnu/libobsglad.so.0
/usr/lib/x86_64-linux-gnu/libobs-frontend-api.so.0
/usr/lib/x86_64-linux-gnu/libobs-opengl.so.0
/usr/lib/x86_64-linux-gnu/libobs-scripting.so
/usr/lib/x86_64-linux-gnu/libobs-frontend-api.so
/usr/lib/x86_64-linux-gnu/libobs-opengl.so
/usr/lib/x86_64-linux-gnu/libobs.so
/usr/lib/x86_64-linux-gnu/libobsglad.so
/usr/share/doc/libobs0
/usr/share/doc/libobs-dev
/usr/share/obs/libobs

from obs-backgroundremoval.

mjevans avatar mjevans commented on July 20, 2024

Rebased instructions based on the archlinux package build
#8 (comment)

src-obs-backgroundremoval$ cmake -B build -DobsIncludePath=/usr/include/obs -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_RPATH="/usr/lib/obs-backgroundremoval" -DOnnxruntime_INCLUDE_DIRS=/usr/include/onnx/ -DOnnxruntime_INCLUDE_DIR=/usr/include/onnx/ -DOnnxruntime_LIBRARIES=/usr/lib/x86_64-linux-gnu/libonnx.so

cd build ; make

... onnxruntime_cxx_api.h isn't included in any package shipped by Debian

https://github.com/microsoft/onnxruntime/releases
Current version
wget https://github.com/microsoft/onnxruntime/releases/download/v1.8.1/onnxruntime-linux-x64-1.8.1.tgz
tar -axf onnxruntime-linux-x64-1.8.1.tgz

$ cmake -B build -DobsIncludePath=/usr/include/obs -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_RPATH="/usr/lib/obs-backgroundremoval"
-DOnnxruntime_INCLUDE_DIRS="$srcdir/$_onnxdir/include/"
-DOnnxruntime_LIBRARIES="$srcdir/$_onnxdir/lib/libonnxruntime.so"
-DOnnxruntime_INCLUDE_DIR="$srcdir/$_onnxdir/include/"

cd build
make
sudo cmake --install
sudo cp -v ../onnxruntime*/lib/* /usr/lib/obs-backgroundremoval/

obs

Now to figure out the v4l2loopback camera...

from obs-backgroundremoval.

marcelotrevisani avatar marcelotrevisani commented on July 20, 2024

Hi,
I am running ubuntu 21.04 and I had to do the following to be able to build and install the plugin:

* Remove OBS-Studio installed via snap and install OBS-Studio via ppa (`sudo apt install obs`) [this was required due to dependency conflicts with libobs-dev]

* Install dependencies as mentioned in README
apt install -y libobs-dev libopencv-dev language-pack-en wget git build-essential cmake
wget https://github.com/microsoft/onnxruntime/releases/download/v1.7.0/onnxruntime-linux-x64-1.7.0.tgz
tar xzvf onnxruntime-linux-x64-1.7.0.tgz --strip-components=1 -C /usr/local/ --wildcards "*/include/*" "*/lib*/"
* Run: `cmake -S . -B build -DobsIncludePath=/usr/include/obs` to configure the build [this was required since LibObs could not be found (missing: LIBOBS_INCLUDE_DIR) ]

* Run build and install `cmake --install build && sudo cmake --install build` [sudo was required for installation since we are installing to /usr/...]

* Last but not least I found that the plugin was installed to the wrong directories (my OBS installation did not load the plugin). So, I had to do the following in addition:
sudo mv /usr/local/share/obs/obs-plugins/obs-backgroundremoval /usr/share/obs/obs-plugins
sudo mv /usr/local/lib/obs-plugins/obs-backgroundremoval.so /usr/lib/obs-plugins

I was not able to find an official statement about the correct plugin install directory, but the information written in this forum helped me: https://forums.linuxmint.com/viewtopic.php?t=278509

If people agree that this is the correct installation procedure/location, I am happy to create a PR.

That worked for me, I just needed to change the location of the plugins to
/usr/lib/x86_64-linux-gnu/obs-plugins/

from obs-backgroundremoval.

royshil avatar royshil commented on July 20, 2024

new build scripts in place for linux

from obs-backgroundremoval.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.