File was renamed from csdk.cpp |
| | |
| | | extern "C"{ |
| | | #endif |
| | | |
| | | #include "csdk.h" |
| | | #include "cface.h" |
| | | |
| | | #ifdef __cplusplus |
| | | } |
File was renamed from csdk.h |
| | |
| | | extern "C"{ |
| | | #endif |
| | | |
| | | #include "csdk_struct.h" |
| | | #include "csrc/struct.h" |
| | | |
| | | #ifndef uchar |
| | | typedef unsigned char uchar; |
| | |
| | | #ifndef _c_wrapper_face_detector_all_hpp_ |
| | | #define _c_wrapper_face_detector_all_hpp_ |
| | | |
| | | #include "buz/face/detector.cpp" |
| | | #include "buz/face/extractor.cpp" |
| | | #include "buz/face/property.cpp" |
| | | #include "buz/face/tracker.cpp" |
| | | #include "detector.cpp" |
| | | #include "extractor.cpp" |
| | | #include "property.cpp" |
| | | #include "tracker.cpp" |
| | | |
| | | #endif |
File was renamed from csrc/buz/face/detector.cpp |
| | |
| | | |
| | | #include "THFaceImage_i.h" |
| | | |
| | | #include "csdk_struct.h" |
| | | #include "struct.h" |
| | | |
| | | namespace csdk_wrap |
| | | { |
File was renamed from csrc/buz/face/detector.h |
| | |
| | | #ifndef _c_wrapper_face_detector_hpp_ |
| | | #define _c_wrapper_face_detector_hpp_ |
| | | |
| | | #include "../base.hpp" |
| | | #include "base.hpp" |
| | | |
| | | |
| | | struct _cFacePos; |
File was renamed from csrc/buz/face/extractor.cpp |
| | |
| | | #include "extractor.h" |
| | | |
| | | #include "THFeature_i.h" |
| | | #include "csdk_struct.h" |
| | | #include "struct.h" |
| | | |
| | | namespace csdk_wrap{ |
| | | |
File was renamed from csrc/buz/face/extractor.h |
| | |
| | | #ifndef _c_wrapper_face_extractor_h_ |
| | | #define _c_wrapper_face_extractor_h_ |
| | | |
| | | #include "../base.hpp" |
| | | #include "base.hpp" |
| | | |
| | | struct _cFacePos; |
| | | struct _cIMAGE; |
File was renamed from csrc/buz/face/property.cpp |
| | |
| | | #include "property.h" |
| | | |
| | | #include "THFaceProperty_i.h" |
| | | #include "csdk_struct.h" |
| | | #include "struct.h" |
| | | |
| | | namespace csdk_wrap{ |
| | | |
File was renamed from csrc/buz/face/property.h |
| | |
| | | #ifndef _c_wrapper_face_property_h_ |
| | | #define _c_wrapper_face_property_h_ |
| | | |
| | | #include "../base.hpp" |
| | | #include "base.hpp" |
| | | |
| | | struct _cThftResult; |
| | | struct _cFacePos; |
File was renamed from csrc/buz/face/tracker.h |
| | |
| | | #ifndef _c_wrapper_face_tracker_h_ |
| | | #define _c_wrapper_face_tracker_h_ |
| | | |
| | | #include "../base.hpp" |
| | | #include "base.hpp" |
| | | |
| | | struct _cRECT; |
| | | struct _cFaceInfo; |
| | |
| | | #cgo LDFLAGS: -lTHFaceImage -lTHFeature -lTHFaceProperty -lTHFaceTracking |
| | | #cgo LDFLAGS: -lcudart -lcublas -lcurand -lrt -ldl -lpthread |
| | | #include <stdlib.h> |
| | | #include "csdk.h" |
| | | #include "cface.h" |
| | | */ |
| | | import "C" |
| | | import ( |
| | |
| | | func (s *SDKFace) Tracker(w, h, maxFaces, interval, sampleSize, threadMax, gpu int) bool { |
| | | |
| | | if s.tracker { |
| | | return s.tracker |
| | | return true |
| | | } |
| | | ret := C.c_api_face_tracker_init(C.int(threadMax), C.int(gpu), C.int(w), C.int(h), C.int(maxFaces), C.int(interval), C.int(sampleSize)) |
| | | if ret <= 0 { |
| | |
| | | pos := (*C.cFacePos)(unsafe.Pointer(&fpos)) |
| | | |
| | | p := C.c_api_face_extract(&featLen, pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch)) |
| | | defer C.free(unsafe.Pointer(p)) |
| | | b := C.GoBytes(unsafe.Pointer(p), featLen) |
| | | s.printLog("->face--> Extract Nothing, Ret: ", len(b)) |
| | | return b |
| | | if p != nil { |
| | | defer C.free(unsafe.Pointer(p)) |
| | | return C.GoBytes(unsafe.Pointer(p), featLen) |
| | | } |
| | | s.printLog("->face--> Extract Nothing") |
| | | return nil |
| | | } |
| | | |
| | | // Compare face compare |