[shotwell/wip/cleanup-facedetect: 9/15] Remove face_to_vec
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell/wip/cleanup-facedetect: 9/15] Remove face_to_vec
- Date: Sun, 14 Aug 2022 15:32:29 +0000 (UTC)
commit 9ab62d3e57c2850948a6cc477417e13f06f65fd3
Author: Jens Georg <mail jensge org>
Date: Sat Aug 13 22:16:30 2022 +0200
Remove face_to_vec
This code is not used anymore
src/faces/FaceDetect.vala | 2 --
subprojects/shotwell-facedetect/facedetect-opencv.cpp | 17 -----------------
.../shotwell-facedetect/org.gnome.ShotwellFaces1.xml | 10 ----------
subprojects/shotwell-facedetect/shotwell-facedetect.cpp | 11 -----------
subprojects/shotwell-facedetect/shotwell-facedetect.hpp | 1 -
5 files changed, 41 deletions(-)
---
diff --git a/src/faces/FaceDetect.vala b/src/faces/FaceDetect.vala
index 4bf6e6af..0e423d62 100644
--- a/src/faces/FaceDetect.vala
+++ b/src/faces/FaceDetect.vala
@@ -38,8 +38,6 @@ public interface FaceDetectInterface : DBusProxy {
throws IOError, DBusError;
public abstract bool load_net(string netFile)
throws IOError, DBusError;
- public abstract double[] face_to_vec(string inputName)
- throws IOError, DBusError;
public abstract void terminate() throws IOError, DBusError;
}
diff --git a/subprojects/shotwell-facedetect/facedetect-opencv.cpp
b/subprojects/shotwell-facedetect/facedetect-opencv.cpp
index 8504437e..48395297 100644
--- a/subprojects/shotwell-facedetect/facedetect-opencv.cpp
+++ b/subprojects/shotwell-facedetect/facedetect-opencv.cpp
@@ -172,20 +172,3 @@ std::vector<double> faceToVecMat(cv::Mat img) {
return ret;
}
#endif
-
-std::vector<double> faceToVec(cv::String inputName) {
- std::vector<double> ret;
- cv::Mat img = cv::imread(inputName, 1);
- if (img.empty()) {
- std::cout << "error;Could not load the file to process. Filename: \"" << inputName << "\"" <<
std::endl;
- ret.assign(128, 0);
- return ret;
- }
-#ifdef HAS_OPENCV_DNN
- ret = faceToVecMat(img);
-#else
- ret.assign(128, 0);
-#endif
- return ret;
-}
-
diff --git a/subprojects/shotwell-facedetect/org.gnome.ShotwellFaces1.xml
b/subprojects/shotwell-facedetect/org.gnome.ShotwellFaces1.xml
index 6bc84f19..2391bf6f 100644
--- a/subprojects/shotwell-facedetect/org.gnome.ShotwellFaces1.xml
+++ b/subprojects/shotwell-facedetect/org.gnome.ShotwellFaces1.xml
@@ -32,16 +32,6 @@
<arg type="b" name="ret" direction="out" />
</method>
- <!--
- FaceToVec
- @image: Image of face to convert
- Returns 128 element vector
- -->
- <method name="FaceToVec">
- <arg type="s" name="image" direction="in" />
- <arg type="ad" name="vec" direction="out" />
- </method>
-
<!--
Terminate
-->
diff --git a/subprojects/shotwell-facedetect/shotwell-facedetect.cpp
b/subprojects/shotwell-facedetect/shotwell-facedetect.cpp
index df1713ca..8d84ed0d 100644
--- a/subprojects/shotwell-facedetect/shotwell-facedetect.cpp
+++ b/subprojects/shotwell-facedetect/shotwell-facedetect.cpp
@@ -51,16 +51,6 @@ static gboolean on_handle_load_net(ShotwellFaces1 *object, GDBusMethodInvocation
return TRUE;
}
-static gboolean on_handle_face_to_vec(ShotwellFaces1 *object, GDBusMethodInvocation *invocation, const gchar
*arg_image)
-{
- auto vec = faceToVec(arg_image);
-
- shotwell_faces1_complete_face_to_vec(
- object, invocation, g_variant_new_fixed_array(G_VARIANT_TYPE_DOUBLE, vec.data(), vec.size(),
sizeof(double)));
-
- return TRUE;
-}
-
static gboolean on_handle_terminate(ShotwellFaces1 *object,
GDBusMethodInvocation *invocation,
gpointer user_data) {
@@ -79,7 +69,6 @@ static void on_name_acquired(GDBusConnection *connection,
g_signal_connect(interface, "handle-detect-faces", G_CALLBACK (on_handle_detect_faces), nullptr);
g_signal_connect(interface, "handle-terminate", G_CALLBACK (on_handle_terminate), user_data);
g_signal_connect(interface, "handle-load-net", G_CALLBACK (on_handle_load_net), nullptr);
- g_signal_connect(interface, "handle-face-to-vec", G_CALLBACK (on_handle_face_to_vec), nullptr);
g_autoptr(GError) error = nullptr;
g_dbus_interface_skeleton_export(G_DBUS_INTERFACE_SKELETON(interface), connection, FACEDETECT_PATH,
&error);
diff --git a/subprojects/shotwell-facedetect/shotwell-facedetect.hpp
b/subprojects/shotwell-facedetect/shotwell-facedetect.hpp
index a3b0af74..1c596655 100644
--- a/subprojects/shotwell-facedetect/shotwell-facedetect.hpp
+++ b/subprojects/shotwell-facedetect/shotwell-facedetect.hpp
@@ -31,4 +31,3 @@ struct FaceRect {
bool loadNet(cv::String netFile);
std::vector<FaceRect> detectFaces(cv::String inputName, cv::String cascadeName, double scale, bool infer);
-std::vector<double> faceToVec(cv::String inputName);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]