You are not logged in.

#1 2021-04-30 00:54:36

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

[Request] obs-backgroundremoval

There's a relatively new OBS plugin for automatic background removal based on opencv's face detection. Removes the need for a physical greenscreen (theoretically). I'd like to try it but haven't found the time.

https://github.com/royshil/obs-backgrou … l/issues/8 is another Arch's user's try so far.

Instructions for building it by hand are available on the github and the author is actively responding to queries, but while there are reports on success in Debian I do not know if it is easy to do on Arch yet. If anyone would give this a go I'd be super grateful.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#2 2021-04-30 23:57:16

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: [Request] obs-backgroundremoval

I think you first need a package for onnxruntime as https://aur.archlinux.org/packages/python-onnxruntime/ does not provide the c headers.

Offline

#3 2021-05-01 14:55:51

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: [Request] obs-backgroundremoval

loqs wrote:

I think you first need a package for onnxruntime as https://aur.archlinux.org/packages/python-onnxruntime/ does not provide the c headers.

Good point. Haven't looked into that at all yet. Maybe during sem break.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#4 2021-05-02 04:01:06

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: [Request] obs-backgroundremoval

# Maintainer: Your Name <youremail@domain.com>
pkgname=obs-backgroundremoval
_pkgver=0.2-beta
pkgver=0.2_beta
pkgrel=1
pkgdesc=""
arch=('x86_64')
url=""
license=('GPL')
depends=('opencv' 'obs-studio')
makedepends=('cmake')
checkdepends=()
optdepends=()
provides=()
conflicts=()
replaces=()
backup=()
options=()
install=
changelog=
source=("$pkgname-$pkgver.tar.gz::https://github.com/royshil/$pkgname/archive/refs/tags/$_pkgver.tar.gz")
noextract=()
sha256sums=('d1ede05234fc404e0bc4e9c5b887a1caaee747b57a4a558fd78c206e0bf246e4')
validpgpkeys=()

prepare() {
	cd "$pkgname-$_pkgver"
	sed -i '103d' external/FindLibObs.cmake
	sed -i 's/${PLUGIN_SOURCES} ${PLUGIN_HEADERS}/${PLUGIN_SOURCES}/' CMakeLists.txt
	sed -i 's/(APPLE)/(UNIX)/' external/FindOnnxruntime.cmake
}

build() {
    cmake -B build -S $pkgname-$_pkgver -DLIBOBS_INCLUDE_DIR=/usr/include/obs
    make -C build
}

check() {
	cd "$pkgname-$_pkgver"
}

package() {
	cd "$pkgname-$_pkgver"
}

Note the horrible seds.
Arch's obs-studio does not ship ObsPluginHelpers.cmake so that check is removed for now.
Include files for onnxruntime appear to be expected to all be in one directory unless the OS is APPLE that has one additional path onnxruntime/core/session which matches the package layout used by onnxruntime, with that path it then fails to find onnxruntime/core/providers/cpu/cpu_provider_factory.h.  Also fails to find the generated header that has yet to be generated.

# Contributor: Chih-Hsuan Yen <yan12125@gmail.com>

pkgname=onnxruntime
pkgver=1.7.2
pkgdesc='Cross-platform, high performance scoring engine for ML models'
pkgrel=1
arch=(x86_64)
url='https://github.com/microsoft/onnxruntime'
license=(MIT)
depends=(nsync re2 flatbuffers protobuf)
makedepends=(git cmake gtest gmock nlohmann-json chrono-date boost)
# not de-vendored libraries
# eigen: API changes a lot since extra/eigen 3.3.7 to the commit onnxruntime uses
# onnx: needs shared libonnx (https://github.com/onnx/onnx/issues/3030)
# https://github.com/microsoft/onnxruntime/blob/v1.1.2/onnxruntime/core/protobuf/onnx-ml.proto#L250-L251
source=("git+https://github.com/microsoft/onnxruntime#tag=v$pkgver"
        "git+https://gitlab.com/libeigen/eigen.git"
        "git+https://github.com/onnx/onnx.git"
        "git+https://github.com/dcleblanc/SafeInt.git"
        "git+https://github.com/martinmoene/optional-lite.git"
        build-fixes.patch)
sha512sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            '90e67eb144770734b488bf8ac5ad0dc955d2d860d9ed1c32285ffe913e72d27a3ac5b27588f41042fa4008533234e6cf4740c600f2b3fdce90ef8a3f853827eb')

prepare() {
  cd onnxruntime

  patch -Np1 -i ../build-fixes.patch

  git submodule init
  for mod in eigen onnx SafeInt optional-lite; do
    git config submodule.cmake/external/$mod.url "$srcdir"/$mod
    git submodule update cmake/external/$mod
  done
}

build() {
  cd "$srcdir"/
  # Use protobuf-lite instead of full protobuf to workaround symbol conflicts
  # with onnx; see https://github.com/onnx/onnx/issues/1277 for details.
  cmake -V -B build -S  $pkgname/cmake \
    -DCMAKE_BUILD_TYPE:STRING='None' \
    -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
    -DONNX_CUSTOM_PROTOC_EXECUTABLE=/usr/bin/protoc \
    -Donnxruntime_PREFER_SYSTEM_LIB=ON \
    -Donnxruntime_USE_FULL_PROTOBUF=OFF \
    -Donnxruntime_BUILD_SHARED_LIB=ON
  make -C build
}

check() {
  make -C build test
}

package() {
  make -C build DESTDIR="$pkgdir" install
  for f in LICENSE ThirdPartyNotices.txt ; do
    install -Dm 644 "$pkgname/$f" "$pkgdir"/usr/share/licenses/$pkgname/$f
  done
}

Very few changes from python-onnxruntime.

Offline

Board footer

Powered by FluxBB