Video Analysis底层库拆分,sdk的go封装
chenshijun
2019-10-22 b7340a34ff68f018a4aa0e7aada3b7feaabd2fe1
增加人脸跟踪检测的通道分辨率调整接口face_track_resize
12个文件已修改
47 ■■■■■ 已修改文件
csdk.cpp 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
csdk.h 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
csrc/buz/face/face.cpp 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
csrc/buz/face/face.h 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gosdk.go 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sdk/face/include/THFaceTracking_i.h 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
sdk/face/lib/gpu/libTHDetect_dpbin.so 补丁 | 查看 | 原始文档 | blame | 历史
sdk/face/lib/gpu/libTHFaceDetect.so 补丁 | 查看 | 原始文档 | blame | 历史
sdk/face/lib/gpu/libTHFaceTracking.so 补丁 | 查看 | 原始文档 | blame | 历史
sdk/face/lib/gpu/libTHFacialPos.so 补丁 | 查看 | 原始文档 | blame | 历史
sdk/face/lib/gpu/libTHFacialPos_con.so 补丁 | 查看 | 原始文档 | blame | 历史
sdk/face/lib/gpu/libTHFacialPos_lmp.so 补丁 | 查看 | 原始文档 | blame | 历史
csdk.cpp
@@ -31,12 +31,16 @@
}
int c_api_face_tracker_init(const int tm, const int gi, const int wid, const int hei,
                              const int maxFaces, const int detinterval, const int sampleSize){
                            const int maxFaces, const int detinterval, const int sampleSize){
    if (!face) face = new sdkface();
    if (face) printf("create sdk face success\n");
    return face->init_face_tracker(tm, gi, wid, hei, maxFaces, detinterval, sampleSize);
}
int c_api_face_track_resize(const int chan, const int wid, const int hei){
    return face->face_track_resize(chan, wid, hei);
}
YoloHandle c_api_yolo_init(
    const char *fcfg, const char *fweights, const char *fname,
    const int gpu_index){
csdk.h
@@ -18,7 +18,7 @@
int c_api_face_extractor_init(const int tm, const int gi);
int c_api_face_tracker_init(const int tm, const int gi, const int wid, const int hei,
                              const int maxFaces, const int detinterval, const int sampleSize);
int c_api_face_track_resize(const int chan, const int w, const int h);
YoloHandle c_api_yolo_init(
    const char *fcfg, const char *fweights, const char *fname,
    const int gpu_index);
csrc/buz/face/face.cpp
@@ -199,4 +199,21 @@
        }
        return nNum;
    }
    //THFACETRACKING_API int    THFT_Reset(short nChannelID, THFT_Param* pParam);
    int sdkface::face_track_resize(const int chan, const int w, const int h){
        THFT_Param tmpParam;
        tmpParam.nDeviceID = param.nDeviceID;
        tmpParam.nImageWidth = w;
        tmpParam.nImageHeight = h;
        tmpParam.nMaxFaceNum = param.nMaxFaceNum;
        tmpParam.nSampleSize = param.nSampleSize;
        tmpParam.nDetectionIntervalFrame = param.nDetectionIntervalFrame;
        printf("chan %d size: %dx%d", chan, w, h);
        auto flag = THFT_Reset(chan, &tmpParam);
        return flag;
    }
}
csrc/buz/face/face.h
@@ -27,6 +27,7 @@
        int init_face_tracker(const int tm, const int gi,const int w, const int h,
                              const int maxFaces, const int detinterval, const int sampleSize);
        int face_track(const cIMAGE *img, const int chan, void **fInfo, int *fcnt);
        int face_track_resize(const int chan, const int w, const int h);
    private: 
        VecFunc dtors_;
        // face detect
gosdk.go
@@ -69,6 +69,12 @@
    C.c_api_face_tracker_init(C.int(tm), C.int(gi), C.int(w), C.int(h), C.int(maxFaces), C.int(interval), C.int(sample))
}
// ResizeFaceTracker init face tracker
func ResizeFaceTracker(ch, w, h int) int {
    return int(C.c_api_face_track_resize(C.int(ch), C.int(w), C.int(h)))
}
// Free free sdk
func Free() {
    C.c_api_release()
sdk/face/include/THFaceTracking_i.h
@@ -176,5 +176,20 @@
    3.if image has face(s),face number less than or equal to nMaxFaceNums
*/
THFACETRACKING_API int    THFT_Reset(short nChannelID, THFT_Param* pParam);
/*
The THFT_Reset function will reset parameters for an algorithm channel
Parameters:
    nChannelID[input],channel ID(from 0 to nChannelNum-1)
    pParam[input],algorithm channel parameter.
Return Values:
    If the function succeeds, the return value is 0.
    If the function fails, the return value is  negative;
error code:
    -99,invalid license.
Remarks:
    NULL
*/
#endif
sdk/face/lib/gpu/libTHDetect_dpbin.so
old mode 100644 new mode 100755 Binary files differ
sdk/face/lib/gpu/libTHFaceDetect.so
old mode 100644 new mode 100755 Binary files differ
sdk/face/lib/gpu/libTHFaceTracking.so
old mode 100644 new mode 100755 Binary files differ
sdk/face/lib/gpu/libTHFacialPos.so
old mode 100644 new mode 100755 Binary files differ
sdk/face/lib/gpu/libTHFacialPos_con.so
old mode 100644 new mode 100755 Binary files differ
sdk/face/lib/gpu/libTHFacialPos_lmp.so
old mode 100644 new mode 100755 Binary files differ