派生自 libgowrapper/face

zhangmeng
2019-12-16 fcc639d40cab8217c001870ce0ee834c440b3647
update
5个文件已修改
23 ■■■■ 已修改文件
cface.cpp 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cface.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
csrc/face.cpp 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
csrc/face.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
goface.go 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cface.cpp
@@ -2,6 +2,7 @@
extern "C"{
#endif
#include <stdio.h>
#include "cface.h"
#ifdef __cplusplus
@@ -79,7 +80,8 @@
    return s->track(&img, chan, fInfo, fcnt);
}
int resize(void *handle, const int w, const int h, const int chan){
int track_resize(void *handle, const int w, const int h, const int chan){
    sdkface *s = (sdkface*)handle;
    return s->resize(w, h, chan);
    printf("call cpp function\n");
    return s->track_resize(w, h, chan);
}
cface.h
@@ -27,7 +27,7 @@
int propertize(void *handle, const cFacePos *pos, const void *data, const int w, const int h, const int c, const int chan, void **res);
int track(void *handle, const void *data, const int w, const int h, const int c, const int chan, void **fInfo, int *fcnt);
int resize(void *handle, const int w, const int h, const int chan);
int track_resize(void *handle, const int w, const int h, const int chan);
#ifdef __cplusplus
}
csrc/face.cpp
@@ -175,7 +175,7 @@
        param.nSampleSize = sample_size > 0 ? sample_size : width/2;
        param.nDetectionIntervalFrame = interval;
        
        printf("start threads: %d gi: %d size: %dx%d maxface: %d, sample: %d, interval: %d\n",
        printf("##########start threads: %d gi: %d size: %dx%d maxface: %d, sample: %d, interval: %d\n",
            threads_max, gpu, width, height, max_faces, sample_size, interval);
        
        auto nNum = THFT_Create(threads_max, &param);
@@ -185,7 +185,7 @@
            dtors_.emplace_back([]{THFT_Release();});
        }
        printf("end threads: %d gi: %d size: %dx%d maxface: %d, sample: %d, interval: %d\n",
        printf("##########end threads: %d gi: %d size: %dx%d maxface: %d, sample: %d, interval: %d\n",
            threads_max, gpu, width, height, max_faces, sample_size, interval);        
        return nNum;
@@ -208,7 +208,7 @@
        return nNum;
    }
    
    int sdkface::resize(const int w, const int h, const int chan){
    int sdkface::track_resize(const int w, const int h, const int chan){
        THFT_Param tmpParam;
        tmpParam.nDeviceID = param.nDeviceID;
        tmpParam.nImageWidth = w;
@@ -217,10 +217,9 @@
        tmpParam.nSampleSize = param.nSampleSize;
        tmpParam.nDetectionIntervalFrame = param.nDetectionIntervalFrame;
        auto flag = THFT_Reset(chan, &tmpParam);
        printf("sdkface:: resize ret %d, chan %d size: %dx%d\n", flag, chan, w, h);
        printf("##########resize track\n");
        return flag;
        return THFT_Reset(chan, &tmpParam);
    }
} // namespace cppface
csrc/face.h
@@ -33,7 +33,7 @@
        int propertize(const cFacePos &pos, const cIMAGE *img, const int chan, void **res);
        int track(const cIMAGE *img, const int chan, void **fInfo, int *fcnt);
        int resize(const int w, const int h, const int chan);
        int track_resize(const int w, const int h, const int chan);
    private: 
        VecFunc dtors_;
goface.go
@@ -254,7 +254,7 @@
        s.printLog("->face--> TrackerResize Failed, No Tracker Init")
        return false
    }
    ret := C.resize(s.handle, C.int(w), C.int(h), C.int(ch))
    ret := C.track_resize(s.handle, C.int(w), C.int(h), C.int(ch))
    if ret == 1 {
        return true
    }