matiasdelellis / facerecognition

Nextcloud app that implement a basic facial recognition system.
GNU Affero General Public License v3.0
514 stars 45 forks source link

Add Support for nextcloud 24 #570

Closed jakobroehrl closed 2 years ago

jakobroehrl commented 2 years ago

https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule

guystreeter commented 2 years ago

Do you know of any breaking changes in 24 that might affect face recognition?

TylerVigario commented 2 years ago

Possibly, but doubtful

elpraga commented 2 years ago

Yep, support for NC24 would be greatly appreciated.

adeepn commented 2 years ago

with ubuntu 22.04 and NC24 support for php 8.1 is needed

enoch85 commented 2 years ago

We install this in the Nextcooud VM, and we are about to upgrade to Ubuntu 22.04 with PHP 8.1. Support for that would be great!

https://github.com/nextcloud/vm/blob/master/apps/face-recognition.sh

matiasdelellis commented 2 years ago

Hi all, Some notes..

In general, except for #574 (Fix on https://github.com/matiasdelellis/facerecognition/pull/575/commits/0bc2b115945a6716fad0d4b08f4ae2e0491e8e31), it seems that support NC24... Please test and confirm..

About php 8.1, this app passes the lint test, but I understand that probably Nextcloud is not even ready for it. See https://github.com/nextcloud/server/issues/29287 among many other reports.

About Ubuntu 22.04, note that my repository (Used in that script) does not have packages for this version. But there you absolutely no need to upgrade to this LTS when the old one is still supported until at least 2025.

Please be patient... There is no any reason to upgrade as soon as new versions come out. It never brings good results!. 🙈

enoch85 commented 2 years ago

Nextcloud 24 works fine with PHP 8.1. 👍🏻

So now the questions remains when you will push repos for jammy (22.04) 🙃

matiasdelellis commented 2 years ago

Ok.. One step at a time... We have a repository for ubuntu jammy and dlib package..

echo "deb https://repo.delellis.com.ar jammy jammy" > /etc/apt/sources.list.d/20-pdlib.list
wget -qO - https://repo.delellis.com.ar/repo.gpg.key | sudo apt-key add -
apt update
apt install libdlib-dev

To achieve that, I had to prepare an entire development environment (which I already have working elsewhere, but ubuntu now uses Zstd, and basically it doesn't work anywhere other than ubuntu > 21.10). :flushed: Then, first I try to compile pdlib using the official ubuntu package, and obviously it fails because the ubuntu package doesn't add the f**g pkg-config file. :weary: (the dev package is almost useless)

Well.. I compile dlib again and seems that work. 🤔 I copy this to my repository server, add the distribution to reprepro, and try to add the package to that, and as obviously it couldn't be easy, it failed because reprepro doesn't understand Zstd packages either.. :tired_face:

Well. I go back to my original packaging environment, I have to repackage reprepro with Zstd support.. Luckily it compiled correctly, but being a sensible component, you never know. 🤔 I copied it to my server, installed it with my fingers crossed and it seems to work. 🎉 (I still don't know if I broke something else 😅)

So, I was able to add the dlib package, and with that, if I'm in a better mood 🙈 (and have time 😅 ), I compile pdlib using that package that just uploaded. :tired_face:

Please at least test that the repository works and that package can be installed. 🙏🏻

p.s: Excuse the catharsis, (and believe me that this is summarized). haha

matiasdelellis commented 2 years ago

Well.. I woke up in a better mood.. 😅 ... and did the php8.1-pdlib package.. 😄

echo "deb [arch=amd64] https://repo.delellis.com.ar jammy jammy" > /etc/apt/sources.list.d/20-pdlib.list
wget -qO- https://repo.delellis.com.ar/repo.gpg.key | sudo tee /etc/apt/trusted.gpg.d/pdlib.asc
apt update
apt install php8.1-pdlib

EDIT: Changed with the new apt-key way.. EDIT 2: Change repo to only look for amd64 packages to avoid a warning in apt update..

TylerVigario commented 2 years ago

@matiasdelellis Is an RPM for Fedora 36 in the works?

matiasdelellis commented 2 years ago

@TylerVigario https://copr.fedorainfracloud.org/coprs/matias/dlib/

😉

TylerVigario commented 2 years ago

@matiasdelellis Maybe we can compile pdlib targeting dlib 19.23?

[root@tylervigario ~]# dnf install pdlib
Last metadata expiration check: 0:22:44 ago on Sat 14 May 2022 01:31:55 PM PDT.
Error:
 Problem: conflicting requests
  - nothing provides libdlib.so.19.22.0()(64bit) needed by pdlib-1.0.2-4.x86_64
(try to add '--skip-broken' to skip uninstallable packages)
[root@tylervigario ~]# dnf info dlib
Last metadata expiration check: 0:23:34 ago on Sat 14 May 2022 01:31:55 PM PDT.
Available Packages
Name         : dlib
Version      : 19.18
Release      : 1.fc32
Architecture : src
Size         : 11 M
Source       : None
Repository   : copr:copr.fedorainfracloud.org:matias:dlib
Summary      : A modern C++ toolkit containing machine learning algorithms
URL          : http://dlib.net
License      : Boost
Description  : Dlib is a general purpose cross-platform open source software library written
             : in the C++ programming language. Its design is heavily influenced by ideas from
             : design by contract and component-based software engineering. It contains
             : components for dealing with networking, threads, graphical user interfaces,
             : data structures, linear algebra, machine learning, image processing, data
             : mining, XML and text parsing, numerical optimization, Bayesian networks, and
             : numerous other tasks.

Name         : dlib
Version      : 19.23
Release      : 1.fc36
Architecture : i686
Size         : 791 k
Source       : dlib-19.23-1.fc36.src.rpm
Repository   : fedora
Summary      : A modern C++ toolkit containing machine learning algorithms
URL          : http://dlib.net
License      : Boost
Description  : Dlib is a general purpose cross-platform open source software library written
             : in the C++ programming language. Its design is heavily influenced by ideas from
             : design by contract and component-based software engineering. It contains
             : components for dealing with networking, threads, graphical user interfaces,
             : data structures, linear algebra, machine learning, image processing, data
             : mining, XML and text parsing, numerical optimization, Bayesian networks, and
             : numerous other tasks.

Name         : dlib
Version      : 19.23
Release      : 1.fc36
Architecture : x86_64
Size         : 734 k
Source       : dlib-19.23-1.fc36.src.rpm
Repository   : fedora
Summary      : A modern C++ toolkit containing machine learning algorithms
URL          : http://dlib.net
License      : Boost
Description  : Dlib is a general purpose cross-platform open source software library written
             : in the C++ programming language. Its design is heavily influenced by ideas from
             : design by contract and component-based software engineering. It contains
             : components for dealing with networking, threads, graphical user interfaces,
             : data structures, linear algebra, machine learning, image processing, data
             : mining, XML and text parsing, numerical optimization, Bayesian networks, and
             : numerous other tasks.
matiasdelellis commented 2 years ago

@TylerVigario Ohhh.. Try again.. Maybe you should clear dnf cache since it is the same version.

enoch85 commented 2 years ago

This is now implemented in the Nextcloud VM.

TylerVigario commented 2 years ago

@matiasdelellis It works now!

matiasdelellis commented 2 years ago

@matiasdelellis Forget my original comment! It works now!

I had to recompile as you pointed out, but to make it fast I didn't even bother to change the version of the package. 😅

Thanks to everyone!.

guystreeter commented 2 years ago

The official Docker image for Nextcloud 24 runs Debian Bullseye, but has PHP 8.0.18. Is it possible for you to pre-build pdlib for that?

matiasdelellis commented 2 years ago

Hi @guystreeter

The official Docker image for Nextcloud 24 runs Debian Bullseye, but has PHP 8.0.18. Is it possible for you to pre-build pdlib for that?

Well, it is impossible make a pdlib package when inside the docker image they don't use official repositories.. For my part, what I can offer you is the dlib package that works in Bullseye, and compiling pdlib against that is relatively easy.

See:

NOTE: Obviously it's not impossible, but it doesn't make sense, since there is no control over dependencies which is essential for a package system to work.

p.s: I'm not an docker fan for services as Nextcloud, so I was never able to document it well, but docker-php-ext-install seems to simplify everything.

matiasdelellis commented 2 years ago

@guystreeter

[matias@nube docker]$ cat Dockerfile 
FROM nextcloud:apache

RUN apt update \
  && apt install -y wget gnupg2 unzip

# Install dlib
RUN echo "deb https://repo.delellis.com.ar bullseye bullseye" > /etc/apt/sources.list.d/20-pdlib.list \
  && wget -qO - https://repo.delellis.com.ar/repo.gpg.key | apt-key add -
RUN apt update \
  && apt install -y libdlib-dev

# Install pdlib extension
RUN wget https://github.com/goodspb/pdlib/archive/master.zip \
  && mkdir -p /usr/src/php/ext/ \
  && unzip -d /usr/src/php/ext/ master.zip \
  && rm master.zip
RUN docker-php-ext-install pdlib-master

# These last lines are just for testing the extension.. You can delete them.
RUN wget https://github.com/matiasdelellis/pdlib-min-test-suite/archive/master.zip \
  && unzip -d /tmp/ master.zip \
  && rm master.zip
RUN cd /tmp/pdlib-min-test-suite-master \
    && make

😉

enoch85 commented 2 years ago

@matiasdelellis I must say, you're an amazing maintainer!

mrAceT commented 1 year ago

I am running AlmaLinux. Any chance of a pdlib "dnf installer" for PHP version 8.1 ?

# dnf search pdlib | grep php
Last metadata expiration check: 3:07:51 ago on Thu 29 Dec 2022 01:36:30 PM CET.
php70-php-pdlib.x86_64 : A PHP extension for Dlib
php71-php-pdlib.x86_64 : A PHP extension for Dlib
php72-php-pdlib.x86_64 : A PHP extension for Dlib
php73-php-pdlib.x86_64 : A PHP extension for Dlib
php74-php-pdlib.x86_64 : A PHP extension for Dlib
php80-php-pdlib.x86_64 : A PHP extension for Dlib
dibya-ikea commented 1 year ago

echo "deb [arch=amd64] https://repo.delellis.com.ar jammy jammy" > /etc/apt/sources.list.d/20-pdlib.list wget -qO- https://repo.delellis.com.ar/repo.gpg.key | sudo tee /etc/apt/trusted.gpg.d/pdlib.asc

Seems the repo is down? I keep getting 404

enoch85 commented 1 year ago

@dibya-ikea https://github.com/matiasdelellis/facerecognition/issues/631