Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 702354 | Differences between
and this patch

Collapse All | Expand All

(-)a/subprojects/shotwell-facedetect/facedetect-opencv.cpp.ORIG (-2 / +4 lines)
Lines 1-6 Link Here
1
#include "shotwell-facedetect.hpp"
1
#include "shotwell-facedetect.hpp"
2
2
3
#include <opencv2/imgcodecs.hpp>
3
#include <opencv2/imgcodecs.hpp>
4
#include <opencv2/imgproc/types_c.h>
5
4
6
5
#define OPENFACE_RECOG_TORCH_NET "openface.nn4.small2.v1.t7"
7
#define OPENFACE_RECOG_TORCH_NET "openface.nn4.small2.v1.t7"
6
#define RESNET_DETECT_CAFFE_NET "res10_300x300_ssd_iter_140000_fp16.caffemodel"
8
#define RESNET_DETECT_CAFFE_NET "res10_300x300_ssd_iter_140000_fp16.caffemodel"
Lines 41-47 Link Here
41
        cv::resize(gray, smallImg, smallImgSize, 0, 0, cv::INTER_LINEAR);
43
        cv::resize(gray, smallImg, smallImgSize, 0, 0, cv::INTER_LINEAR);
42
        cv::equalizeHist(smallImg, smallImg);
44
        cv::equalizeHist(smallImg, smallImg);
43
45
44
        cascade.detectMultiScale(smallImg, faces, 1.1, 2, CV_HAAR_SCALE_IMAGE, cv::Size(30, 30));
46
        cascade.detectMultiScale(smallImg, faces, 1.1, 2, cv::CASCADE_SCALE_IMAGE, cv::Size(30, 30));
45
    } else {
47
    } else {
46
#ifdef HAS_OPENCV_DNN
48
#ifdef HAS_OPENCV_DNN
47
        // DNN based face detection
49
        // DNN based face detection
Lines 159-165 Link Here
159
161
160
std::vector<double> faceToVec(cv::String inputName) {
162
std::vector<double> faceToVec(cv::String inputName) {
161
    std::vector<double> ret;
163
    std::vector<double> ret;
162
    cv::Mat img = imread(inputName, 1);
164
    cv::Mat img = cv::imread(inputName, 1);
163
	if (img.empty()) {
165
	if (img.empty()) {
164
        std::cout << "error;Could not load the file to process. Filename: \"" << inputName << "\"" << std::endl;
166
        std::cout << "error;Could not load the file to process. Filename: \"" << inputName << "\"" << std::endl;
165
        ret.assign(128, 0);
167
        ret.assign(128, 0);

Return to bug 702354