public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/kde:master commit in: kde-apps/libkface/files/, kde-apps/libkface/
@ 2016-03-07 15:13 Michael Palimaka
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Palimaka @ 2016-03-07 15:13 UTC (permalink / raw
  To: gentoo-commits

commit:     2adda79147750e5bc4a2de686f57beec81481e64
Author:     Andreas Sturmlechner <andreas.sturmlechner <AT> gmail <DOT> com>
AuthorDate: Sun Mar  6 11:09:15 2016 +0000
Commit:     Michael Palimaka <kensington <AT> gentoo <DOT> org>
CommitDate: Mon Mar  7 15:13:38 2016 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=2adda791

kde-apps/libkface: Fix build with media-libs/opencv-3.1

Package-Manager: portage-2.2.27

 .../files/libkface-15.12.2-opencv3.1.patch         | 167 +++++++++++++++++++++
 kde-apps/libkface/libkface-15.12.2.ebuild          |   2 +
 kde-apps/libkface/libkface-15.12.49.9999.ebuild    |   4 +-
 kde-apps/libkface/libkface-9999.ebuild             |   4 +-
 4 files changed, 175 insertions(+), 2 deletions(-)

diff --git a/kde-apps/libkface/files/libkface-15.12.2-opencv3.1.patch b/kde-apps/libkface/files/libkface-15.12.2-opencv3.1.patch
new file mode 100644
index 0000000..b6d4c27
--- /dev/null
+++ b/kde-apps/libkface/files/libkface-15.12.2-opencv3.1.patch
@@ -0,0 +1,167 @@
+diff --git a/src/recognition-opencv-lbph/facerec_borrowed.h b/src/recognition-opencv-lbph/facerec_borrowed.h
+index 27ad77a..f197d22 100644
+--- a/src/recognition-opencv-lbph/facerec_borrowed.h
++++ b/src/recognition-opencv-lbph/facerec_borrowed.h
+@@ -125,6 +125,8 @@ public:
+      */
+     void update(cv::InputArrayOfArrays src, cv::InputArray labels);
+ 
++
++#if OPENCV_TEST_VERSION(3,1,0)
+     /**
+      * Predicts the label of a query image in src.
+      */
+@@ -134,6 +136,13 @@ public:
+      * Predicts the label and confidence for a given sample.
+      */
+     void predict(cv::InputArray _src, int &label, double &dist) const;
++#else
++    using cv::face::FaceRecognizer::predict;
++    /*
++     * Predict
++     */
++    void predict(cv::InputArray src, cv::Ptr<cv::face::PredictCollector> collector, const int state = 0) const override;
++#endif
+ 
+     /**
+      * See FaceRecognizer::load().
+diff --git a/src/recognition-opencv-lbph/facerec_borrowed.cpp b/src/recognition-opencv-lbph/facerec_borrowed.cpp
+index 748691e..3c37ce2 100644
+--- a/src/recognition-opencv-lbph/facerec_borrowed.cpp
++++ b/src/recognition-opencv-lbph/facerec_borrowed.cpp
+@@ -36,6 +36,8 @@
+  *
+  * ============================================================ */
+ 
++#define QT_NO_EMIT
++
+ #include "facerec_borrowed.h"
+ 
+ // C++ includes
+@@ -375,7 +377,11 @@ void LBPHFaceRecognizer::train(InputArrayOfArrays _in_src, InputArray _inm_label
+     }
+ }
+ 
++#if OPENCV_TEST_VERSION(3,1,0)
+ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist) const
++#else
++void LBPHFaceRecognizer::predict(cv::InputArray _src, cv::Ptr<cv::face::PredictCollector> collector, const int state) const
++#endif
+ {
+     if(m_histograms.empty())
+     {
+@@ -394,8 +400,12 @@ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist
+                                       m_grid_y,                                                          /* grid size y                 */
+                                       true                                                               /* normed histograms           */
+                                      );
++#if OPENCV_TEST_VERSION(3,1,0)
+     minDist      = DBL_MAX;
+     minClass     = -1;
++#else
++    collector->init((int)m_histograms.size(), state);
++#endif
+ 
+     // This is the standard method
+ 
+@@ -406,11 +416,19 @@ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist
+         {
+             double dist = compareHist(m_histograms[sampleIdx], query, CV_COMP_CHISQR);
+ 
++#if OPENCV_TEST_VERSION(3,1,0)
+             if((dist < minDist) && (dist < m_threshold))
+             {
+                 minDist  = dist;
+                 minClass = m_labels.at<int>((int) sampleIdx);
+             }
++#else
++            int label = m_labels.at<int>((int) sampleIdx);
++            if (!collector->emit(label, dist, state))
++            {
++                return;
++            }
++#endif
+         }
+     }
+ 
+@@ -422,7 +440,7 @@ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist
+         // Create map "label -> vector of distances to all histograms for this label"
+         std::map<int, std::vector<int> > distancesMap;
+ 
+-        for(size_t sampleIdx = 0; sampleIdx < m_histograms.size(); sampleIdx++) 
++        for(size_t sampleIdx = 0; sampleIdx < m_histograms.size(); sampleIdx++)
+         {
+             double dist                 = compareHist(m_histograms[sampleIdx], query, CV_COMP_CHISQR);
+             std::vector<int>& distances = distancesMap[m_labels.at<int>((int) sampleIdx)];
+@@ -445,11 +463,18 @@ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist
+             double mean = sum / it->second.size();
+             s          += QString::fromLatin1("%1: %2 - ").arg(it->first).arg(mean);
+ 
++#if OPENCV_TEST_VERSION(3,1,0)
+             if((mean < minDist) && (mean < m_threshold))
+             {
+                 minDist = mean;
+                 minClass = it->first;
+             }
++#else
++            if (!collector->emit(it->first, mean, state))
++            {
++                return;
++            }
++#endif
+         }
+ 
+         qCDebug(LIBKFACE_LOG) << s;
+@@ -462,7 +487,7 @@ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist
+         // map "label -> number of histograms"
+         std::map<int, int> countMap;
+ 
+-        for(size_t sampleIdx = 0; sampleIdx < m_histograms.size(); sampleIdx++) 
++        for(size_t sampleIdx = 0; sampleIdx < m_histograms.size(); sampleIdx++)
+         {
+             int label   = m_labels.at<int>((int) sampleIdx);
+             double dist = compareHist(m_histograms[sampleIdx], query, CV_COMP_CHISQR);
+@@ -480,7 +505,9 @@ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist
+             scoreMap[it->second]++;
+         }
+ 
++#if OPENCV_TEST_VERSION(3,1,0)
+         minDist = 0;
++#endif
+         QString s = QString::fromLatin1("Nearest Neighbor score: ");
+ 
+         for (std::map<int,int>::iterator it = scoreMap.begin(); it != scoreMap.end(); ++it)
+@@ -488,17 +515,26 @@ void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist
+             double score = double(it->second) / countMap.at(it->first);
+             s           += QString::fromLatin1("%1/%2 %3  ").arg(it->second).arg(countMap.at(it->first)).arg(score);
+ 
++#if OPENCV_TEST_VERSION(3,1,0)
+             if (score > minDist)
+             {
+                 minDist  = score;
+                 minClass = it->first;
+             }
++#else
++            // large is better thus it is -score.
++            if (!collector->emit(it->first, -score, state))
++            {
++                return;
++            }
++#endif
+         }
+ 
+         qCDebug(LIBKFACE_LOG) << s;
+     }
+ }
+ 
++#if OPENCV_TEST_VERSION(3,1,0)
+ int LBPHFaceRecognizer::predict(InputArray _src) const
+ {
+     int    label;
+@@ -506,6 +542,7 @@ int LBPHFaceRecognizer::predict(InputArray _src) const
+     predict(_src, label, dummy);
+     return label;
+ }
++#endif
+ 
+ // Static method ----------------------------------------------------
+ 

diff --git a/kde-apps/libkface/libkface-15.12.2.ebuild b/kde-apps/libkface/libkface-15.12.2.ebuild
index d53eb09..a826543 100644
--- a/kde-apps/libkface/libkface-15.12.2.ebuild
+++ b/kde-apps/libkface/libkface-15.12.2.ebuild
@@ -23,6 +23,8 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}/${P}-opencv3.1.patch" )
+
 src_configure() {
 	local mycmakeargs=(
 		-DENABLE_OPENCV3=ON

diff --git a/kde-apps/libkface/libkface-15.12.49.9999.ebuild b/kde-apps/libkface/libkface-15.12.49.9999.ebuild
index a9b9915..5ad984c 100644
--- a/kde-apps/libkface/libkface-15.12.49.9999.ebuild
+++ b/kde-apps/libkface/libkface-15.12.49.9999.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
+EAPI=6
 
 KDE_BLOCK_SLOT4="false"
 inherit kde5
@@ -23,6 +23,8 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}/${PN}-15.12.2-opencv3.1.patch" )
+
 src_configure() {
 	local mycmakeargs=(
 		-DENABLE_OPENCV3=ON

diff --git a/kde-apps/libkface/libkface-9999.ebuild b/kde-apps/libkface/libkface-9999.ebuild
index a9b9915..5ad984c 100644
--- a/kde-apps/libkface/libkface-9999.ebuild
+++ b/kde-apps/libkface/libkface-9999.ebuild
@@ -2,7 +2,7 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
+EAPI=6
 
 KDE_BLOCK_SLOT4="false"
 inherit kde5
@@ -23,6 +23,8 @@ DEPEND="
 "
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}/${PN}-15.12.2-opencv3.1.patch" )
+
 src_configure() {
 	local mycmakeargs=(
 		-DENABLE_OPENCV3=ON


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/kde:master commit in: kde-apps/libkface/files/, kde-apps/libkface/
@ 2017-11-19 22:33 Andreas Sturmlechner
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Sturmlechner @ 2017-11-19 22:33 UTC (permalink / raw
  To: gentoo-commits

commit:     be678488163ca20922ebd1477e20ad0d288f99e7
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 19 22:30:10 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Nov 19 22:30:10 2017 +0000
URL:        https://gitweb.gentoo.org/proj/kde.git/commit/?id=be678488

kde-apps/libkface: Dropped upstream

See also:
https://mail.kde.org/pipermail/release-team/2017-November/010718.html

 .../libkface-16.11.80-opencv3.2-gentoo-3.1.patch   | 58 ----------------------
 kde-apps/libkface/libkface-9999.ebuild             | 34 -------------
 kde-apps/libkface/metadata.xml                     |  8 ---
 3 files changed, 100 deletions(-)

diff --git a/kde-apps/libkface/files/libkface-16.11.80-opencv3.2-gentoo-3.1.patch b/kde-apps/libkface/files/libkface-16.11.80-opencv3.2-gentoo-3.1.patch
deleted file mode 100644
index bd61e9c52c..0000000000
--- a/kde-apps/libkface/files/libkface-16.11.80-opencv3.2-gentoo-3.1.patch
+++ /dev/null
@@ -1,58 +0,0 @@
---- a/src/recognition-opencv-lbph/facerec_borrowed.h	2016-11-26 14:19:01.492645170 +0100
-+++ b/src/recognition-opencv-lbph/facerec_borrowed.h.new	2016-11-26 14:19:17.655835794 +0100
-@@ -141,7 +141,7 @@
-     /*
-      * Predict
-      */
--    void predict(cv::InputArray src, cv::Ptr<cv::face::PredictCollector> collector, const int state = 0) const override;
-+    void predict(cv::InputArray src, cv::Ptr<cv::face::PredictCollector> collector) const override;
- #endif
- 
-     /**
---- a/src/recognition-opencv-lbph/facerec_borrowed.cpp	2016-11-26 14:19:01.492645170 +0100
-+++ b/src/recognition-opencv-lbph/facerec_borrowed.cpp.new	2016-11-26 14:19:29.184971765 +0100
-@@ -380,7 +380,7 @@
- #if OPENCV_TEST_VERSION(3,1,0)
- void LBPHFaceRecognizer::predict(InputArray _src, int &minClass, double &minDist) const
- #else
--void LBPHFaceRecognizer::predict(cv::InputArray _src, cv::Ptr<cv::face::PredictCollector> collector, const int state) const
-+void LBPHFaceRecognizer::predict(cv::InputArray _src, cv::Ptr<cv::face::PredictCollector> collector) const
- #endif
- {
-     if(m_histograms.empty())
-@@ -404,7 +404,7 @@
-     minDist      = DBL_MAX;
-     minClass     = -1;
- #else
--    collector->init((int)m_histograms.size(), state);
-+    collector->init((int)m_histograms.size());
- #endif
- 
-     // This is the standard method
-@@ -424,7 +424,7 @@
-             }
- #else
-             int label = m_labels.at<int>((int) sampleIdx);
--            if (!collector->emit(label, dist, state))
-+            if (!collector->collect(label, dist))
-             {
-                 return;
-             }
-@@ -470,7 +470,7 @@
-                 minClass = it->first;
-             }
- #else
--            if (!collector->emit(it->first, mean, state))
-+            if (!collector->collect(it->first, mean))
-             {
-                 return;
-             }
-@@ -523,7 +523,7 @@
-             }
- #else
-             // large is better thus it is -score.
--            if (!collector->emit(it->first, -score, state))
-+            if (!collector->collect(it->first, -score))
-             {
-                 return;
-             }

diff --git a/kde-apps/libkface/libkface-9999.ebuild b/kde-apps/libkface/libkface-9999.ebuild
deleted file mode 100644
index 571b7dde0c..0000000000
--- a/kde-apps/libkface/libkface-9999.ebuild
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-KDE_BLOCK_SLOT4="false"
-inherit kde5
-
-DESCRIPTION="Qt/C++ wrapper around LibFace to perform face recognition and detection"
-HOMEPAGE="https://cgit.kde.org/libkface.git"
-
-LICENSE="BSD GPL-2+"
-KEYWORDS=""
-IUSE=""
-
-DEPEND="
-	$(add_qt_dep qtgui)
-	$(add_qt_dep qtsql)
-	$(add_qt_dep qtwidgets)
-	$(add_qt_dep qtxml)
-	media-libs/opencv:=
-	|| ( <media-libs/opencv-3.0.0 >=media-libs/opencv-3.1.0-r6[contrib] )
-"
-RDEPEND="${DEPEND}"
-
-PATCHES=( "${FILESDIR}/${PN}-16.11.80-opencv3.2-gentoo-3.1.patch" ) # not upstreamable like that
-
-src_configure() {
-	local mycmakeargs=(
-		-DENABLE_OPENCV3=$(has_version ">=media-libs/opencv-3" && echo yes || echo no)
-	)
-
-	kde5_src_configure
-}

diff --git a/kde-apps/libkface/metadata.xml b/kde-apps/libkface/metadata.xml
deleted file mode 100644
index 2fdbf33d96..0000000000
--- a/kde-apps/libkface/metadata.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
-<pkgmetadata>
-	<maintainer type="project">
-		<email>kde@gentoo.org</email>
-		<name>Gentoo KDE Project</name>
-	</maintainer>
-</pkgmetadata>


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-19 22:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-19 22:33 [gentoo-commits] proj/kde:master commit in: kde-apps/libkface/files/, kde-apps/libkface/ Andreas Sturmlechner
  -- strict thread matches above, loose matches on Subject: below --
2016-03-07 15:13 Michael Palimaka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox