派生自 libgowrapper/face

zhangmeng
2020-01-15 0ffd95f2278e860736e46f8b73f357470f5a3d91
goface.go
@@ -65,6 +65,8 @@
      s.printLog("->face--> CREATE Detector ERROR: ", ret)
      return false
   }
   s.printLog("->face--> CREATE Detector Threads: ", threadMax, " GPU:", gpu)
   s.detector = true
   return true
}
@@ -80,6 +82,8 @@
      s.printLog("->face--> CREATE Extractor ERROR: ", ret)
      return false
   }
   s.printLog("->face--> CREATE Extractor Threads: ", threadMax, " GPU:", gpu)
   s.extractor = true
   return true
}
@@ -95,6 +99,8 @@
      s.printLog("->face--> CREATE Propertizer ERROR: ", ret)
      return false
   }
   s.printLog("->face--> CREATE Propertizer Threads: ", threadMax)
   s.propertizer = true
   return true
}
@@ -150,9 +156,13 @@
   if !s.extractor {
      return nil
   }
   s.printLog("->face--> facepos: ", fpos)
   var featLen C.int
   pos := (*C.cFacePos)(unsafe.Pointer(&fpos))
   if pos == nil {
      return nil
   }
   p := C.c_api_face_extract(&featLen, pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch))
   if p != nil {
@@ -175,15 +185,15 @@
}
// Propertize prop
func (s *SDKFace) Propertize(fpos sdkstruct.CFacePos, data []byte, w, h, c int, ch int) *sdkstruct.CThftResult {
func (s *SDKFace) Propertize(fpos sdkstruct.CFacePos, data []byte, w, h, c int, ch int) sdkstruct.CThftResult {
   if !s.propertizer {
      return nil
      return sdkstruct.CThftResult{Age: 0}
   }
   pos := (*C.cFacePos)(unsafe.Pointer(&fpos))
   result := C.c_api_face_property(pos, (*C.uchar)(unsafe.Pointer(&data[0])), C.int(w), C.int(h), C.int(ch))
   s.printLog("->face--> Propertize")
   return (*sdkstruct.CThftResult)(unsafe.Pointer(&result))
   return *(*sdkstruct.CThftResult)(unsafe.Pointer(&result))
}
// CFaceInfoArrayToGoArray convert cFaceInfo array to go