diff --git a/README.md b/README.md index 646f898c..76ecefa4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- + GPUPixel

@@ -35,7 +35,7 @@ ⛰️ GPUPixel is a real-time, high-performance image and video filter library, extremely easy to compile and integrate with small library size. -🔑 GPUPixel is written in C++11 and is based on OpenGL/ES, incorporating a built-in beauty face filter that achieves commercial-grade beauty effects. +🔑 GPUPixel is written in C++11 and is based on OpenGL/ES, incorporating a built-in beauty face filter. 🔌 GPUPixel supports platforms including `iOS`, `Android`, `Mac`, `Win` and `Linux`. It can theoretically be ported to any platform that supports OpenGL/ES. @@ -44,11 +44,9 @@ 👉 **Video: YouTube | BiliBili** -| **Origin** | **Smooth** | **White** | **ThinFace** | -| :---------------------------------------------: | :-----------------------------------------------: | :----------------------------------------------: | :-----------------------------------------------: | -| | | | | -| **BigEye** | **Lipstick** | **Blusher** | **ON-OFF** | -| | | | | +| **Origin** | **Smooth** | **White** | +| :---------------------------------------------: | :-----------------------------------------------: | :----------------------------------------------: | +| | | | ## Architecture ![](./docs/image/arch-en.svg) @@ -63,11 +61,7 @@ This table compares the features supported by **GPUPixel** and **GPUImage** and | :-------------------- | :---------------------------------------------: | :------------------------------------------------: | :----------------------------------------------------------: | | 📷 **Filters:** | ✅ | ❌ | ❌ | | Skin Smoothing Filter | ✅ | ❌ | ❌ | -| Skin Whitening Filter | ✅ | ❌ | ❌ | -| Face Slimming Filter | ✅ | ❌ | ❌ | -| Big Eyes Filter | ✅ | ❌ | ❌ | -| Lipstick Filter | ✅ | ❌ | ❌ | -| Blush Filter | ✅ | ❌ | ❌ | +| Skin Whitening Filter | ✅ | ❌ | ❌ | | More Build in Filter | ✅ | ✅ | ✅ | | 🎬 **Input Formats:** | | | | | YUV420P(I420) | ✅ | ❌ | ❌ | @@ -141,7 +135,6 @@ At the same time, please consider supporting GPUPixel by sharing it on social me 1. [GPUImage](https://github.com/BradLarson/GPUImage) 2. [CainCamera](https://github.com/CainKernel/CainCamera) 3. [AwemeLike](https://github.com/ZZZZou/AwemeLike) -4. [VNN](https://github.com/joyycom/VNN) ## License This repository is available under the [MIT License](https://github.com/pixpark/gpupixel?tab=MIT-1-ov-file#readme). diff --git a/examples/app.cmake b/examples/app.cmake index 7cc5b1d5..6e95cef0 100644 --- a/examples/app.cmake +++ b/examples/app.cmake @@ -77,8 +77,6 @@ IF(${CURRENT_OS} STREQUAL "linux") GL glfw) SET(GPUPIXEL_LIBS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgpupixel.so) - FIlE(GLOB VNN_LIBS - ${CMAKE_CURRENT_SOURCE_DIR}/../src/third_party/vnn/libs/${CURRENT_OS}/* ) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-rpath,./") ELSEIF(${CURRENT_OS} STREQUAL "windows") @@ -87,10 +85,6 @@ ELSEIF(${CURRENT_OS} STREQUAL "windows") opengl32 glfw3) - FIlE(GLOB VNN_LIBS - ${CMAKE_CURRENT_SOURCE_DIR}/../src/third_party/vnn/libs/${CURRENT_OS}/x64/* - ) - SET(GPUPIXEL_LIBS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/gpupixel.dll) set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-rpath,./") ENDIF() @@ -102,7 +96,6 @@ FILE(GLOB RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../src/resources/*" ) list(APPEND RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../examples/desktop/demo.png") -list(APPEND RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/../src/third_party/vnn/models/vnn_face278_data/face_pc[1.0.0].vnnmodel") MACRO(EXPORT_INCLUDE) ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} PRE_BUILD @@ -110,10 +103,8 @@ ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} PRE_BUILD ${RESOURCE_FILES} ${APP_RESOURCE_DIR} COMMENT "Copying resource files to output/app directory.") -# copy gpupixel and vnn lib +# copy gpupixel lib ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different - ${VNN_LIBS} ${COPY_DST_RUNTIME_DIR} COMMAND ${CMAKE_COMMAND} -E copy_if_different ${GPUPIXEL_LIBS} ${COPY_DST_RUNTIME_DIR} ) diff --git a/src/core/gpupixel.h b/src/core/gpupixel.h index dd9e1e9b..12238e23 100755 --- a/src/core/gpupixel.h +++ b/src/core/gpupixel.h @@ -42,11 +42,6 @@ // face filters #include "beauty_face_filter.h" -#include "face_makeup_filter.h" -#include "lipstick_filter.h" -#include "blusher_filter.h" -#include "face_reshape_filter.h" - #include "box_blur_filter.h" #include "box_high_pass_filter.h" diff --git a/src/face_detect/face_detector.cc b/src/face_detect/face_detector.cc deleted file mode 100755 index d2e855c8..00000000 --- a/src/face_detect/face_detector.cc +++ /dev/null @@ -1,131 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#include "face_detector.h" - -#include "vnn_kit.h" -#include "vnn_face.h" - -#include "util.h" -NS_GPUPIXEL_BEGIN - - -FaceDetector::FaceDetector() { - // init - VNN_SetLogLevel(VNN_LOG_LEVEL_ALL); -#if defined(GPUPIXEL_IOS) || defined(GPUPIXEL_ANDROID) - auto model_path = Util::getResourcePath("face_mobile[1.0.0].vnnmodel"); -#elif defined(GPUPIXEL_WIN) || defined(GPUPIXEL_MAC) || defined(GPUPIXEL_LINUX) - auto model_path = Util::getResourcePath("face_pc[1.0.0].vnnmodel"); -#endif - const void *argv[] = { - model_path.c_str(), - }; - - const int argc = sizeof(argv)/sizeof(argv[0]); - VNN_Result ret = VNN_Create_Face(&vnn_handle_, argc, argv); -} - -FaceDetector::~FaceDetector() { - if(vnn_handle_ > 0) - VNN_Destroy_Face(&vnn_handle_); -} - -int FaceDetector::RegCallback(FaceDetectorCallback callback) { - _face_detector_callbacks.push_back(callback); - return 0; -} - -int FaceDetector::Detect(const uint8_t* data, - int width, - int height, - GPUPIXEL_MODE_FMT fmt, - GPUPIXEL_FRAME_TYPE type) { - if(vnn_handle_ == 0) { - return -1; - } - - VNN_Set_Face_Attr(vnn_handle_, "_use_278pts", &use_278pts); - - VNN_Image input; - input.width = width; - input.height = height; - input.channels = 4; - switch (type) { - case GPUPIXEL_FRAME_TYPE_RGBA8888: { - input.pix_fmt = VNN_PIX_FMT_BGRA8888; - } - break; - case GPUPIXEL_FRAME_TYPE_YUVI420: { - input.pix_fmt = VNN_PIX_FMT_YUVI420; - } - break; - default: - break; - } - - input.data = (VNNVoidPtr)data; - if(fmt == GPUPIXEL_MODE_FMT_VIDEO) { - input.mode_fmt = VNN_MODE_FMT_VIDEO; - } - - if(fmt == GPUPIXEL_MODE_FMT_PICTURE) { - input.mode_fmt = VNN_MODE_FMT_PICTURE; - } - - input.ori_fmt = VNN_ORIENT_FMT_DEFAULT; - - VNN_FaceFrameDataArr output; - VNN_Result ret = VNN_Apply_Face_CPU(vnn_handle_, &input, &output); - - std::vector landmarks; - if(output.facesNum > 0) { - for (int i = 0; i < output.facesArr[0].faceLandmarksNum; i++) { - landmarks.push_back(output.facesArr[0].faceLandmarks[i].x); - landmarks.push_back(output.facesArr[0].faceLandmarks[i].y); - } - - // 106 - auto point_x = (output.facesArr[0].faceLandmarks[102].x + output.facesArr[0].faceLandmarks[98].x)/2; - auto point_y = (output.facesArr[0].faceLandmarks[102].y + output.facesArr[0].faceLandmarks[98].y)/2; - landmarks.push_back(point_x); - landmarks.push_back(point_y); - - // 107 - point_x = (output.facesArr[0].faceLandmarks[35].x + output.facesArr[0].faceLandmarks[65].x)/2; - point_y = (output.facesArr[0].faceLandmarks[35].y + output.facesArr[0].faceLandmarks[65].y)/2; - landmarks.push_back(point_x); - landmarks.push_back(point_y); - - - // 108 - point_x = (output.facesArr[0].faceLandmarks[70].x + output.facesArr[0].faceLandmarks[40].x)/2; - point_y = (output.facesArr[0].faceLandmarks[70].y + output.facesArr[0].faceLandmarks[40].y)/2; - landmarks.push_back(point_x); - landmarks.push_back(point_y); - - // 109 - point_x = (output.facesArr[0].faceLandmarks[5].x + output.facesArr[0].faceLandmarks[80].x)/2; - point_y = (output.facesArr[0].faceLandmarks[5].y + output.facesArr[0].faceLandmarks[80].y)/2; - landmarks.push_back(point_x); - landmarks.push_back(point_y); - - // 110 - point_x = (output.facesArr[0].faceLandmarks[81].x + output.facesArr[0].faceLandmarks[27].x)/2; - point_y = (output.facesArr[0].faceLandmarks[81].y + output.facesArr[0].faceLandmarks[27].y)/2; - landmarks.push_back(point_x); - landmarks.push_back(point_y); - } - - // do callbck - for(auto cb : _face_detector_callbacks) { - cb(landmarks); - } - return 0; -} - -NS_GPUPIXEL_END diff --git a/src/face_detect/face_detector.h b/src/face_detect/face_detector.h deleted file mode 100755 index ffae7299..00000000 --- a/src/face_detect/face_detector.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#pragma once - -#include -#include -#include -#include "gpupixel_macros.h" - -NS_GPUPIXEL_BEGIN -GPUPIXEL_API typedef std::function landmarks)> -FaceDetectorCallback; - -GPUPIXEL_API typedef enum { - GPUPIXEL_FRAME_TYPE_UNKNOW, /* Unknow pixel format, as a cube */ - GPUPIXEL_FRAME_TYPE_YUVI420, /* YUV 4:2:0 12bpp ( 3 planes, the first is Y, the second is U, the third is V */ - GPUPIXEL_FRAME_TYPE_RGBA8888, /* RGBA 8:8:8:8 32bpp ( 4 channel, 8x4=32bit RGBA pixel ) */ - } GPUPIXEL_FRAME_TYPE; - -GPUPIXEL_API typedef enum { - GPUPIXEL_MODE_FMT_VIDEO = 0x00000000, - GPUPIXEL_MODE_FMT_PICTURE = 0x00000001, - GPUPIXEL_MODE_FMT_DEFAULT = 0x00000000, - } GPUPIXEL_MODE_FMT; - -class GPUPIXEL_API FaceDetector { - public: - FaceDetector(); - - ~FaceDetector(); - - int Detect(const uint8_t* data, - int width, - int height, - GPUPIXEL_MODE_FMT fmt, - GPUPIXEL_FRAME_TYPE type); - - int RegCallback(FaceDetectorCallback callback); - private: - uint32_t vnn_handle_; - int use_278pts = 0; - std::vector _face_detector_callbacks; - }; -NS_GPUPIXEL_END diff --git a/src/filter/blusher_filter.cc b/src/filter/blusher_filter.cc deleted file mode 100755 index 732e9e49..00000000 --- a/src/filter/blusher_filter.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#include "blusher_filter.h" -#include "face_detector.h" -#include "source_image.h" - -NS_GPUPIXEL_BEGIN -std::shared_ptr BlusherFilter::create() { - auto ret = std::shared_ptr(new BlusherFilter()); - if (ret && !ret->init()) { - ret.reset(); - } - return ret; -} - -bool BlusherFilter::init() { - auto blusher = SourceImage::create(Util::getResourcePath("blusher.png")); - setImageTexture(blusher); - setTextureBounds(FrameBounds{395, 520, 489, 209}); - return FaceMakeupFilter::init(); -} - -NS_GPUPIXEL_END diff --git a/src/filter/blusher_filter.h b/src/filter/blusher_filter.h deleted file mode 100755 index baef4031..00000000 --- a/src/filter/blusher_filter.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#pragma once - -#include "face_makeup_filter.h" - -NS_GPUPIXEL_BEGIN -class GPUPIXEL_API BlusherFilter : public FaceMakeupFilter { -public: - static std::shared_ptr create(); - bool init() override; -}; - -NS_GPUPIXEL_END diff --git a/src/filter/face_makeup_filter.cc b/src/filter/face_makeup_filter.cc deleted file mode 100755 index 0e02f12f..00000000 --- a/src/filter/face_makeup_filter.cc +++ /dev/null @@ -1,612 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#include "face_makeup_filter.h" -#include "gpupixel_context.h" -#include "source_image.h" -#include "face_detector.h" - -NS_GPUPIXEL_BEGIN - -const std::string FaceMakeupFilterVertexShaderString = R"( - attribute vec3 position; attribute vec2 inputTextureCoordinate; - varying vec2 textureCoordinate; - varying vec2 textureCoordinate2; - - void main(void) { - gl_Position = vec4(position, 1.); - textureCoordinate = inputTextureCoordinate; - textureCoordinate2 = position.xy * 0.5 + 0.5; // landmark - })"; -#if defined(GPUPIXEL_IOS) || defined(GPUPIXEL_ANDROID) -const std::string FaceMakeupFilterFragmentShaderString = R"( - precision mediump float; - varying highp vec2 textureCoordinate; - varying highp vec2 textureCoordinate2; - uniform sampler2D inputImageTexture; - uniform sampler2D inputImageTexture2; // mouth - - uniform float intensity; - uniform int blendMode; - - float blendHardLight(float base, float blend) { - return blend < 0.5 ? (2.0 * base * blend) - : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)); - } - - vec3 blendHardLight(vec3 base, vec3 blend) { - return vec3(blendHardLight(base.r, blend.r), - blendHardLight(base.g, blend.g), - blendHardLight(base.b, blend.b)); - } - - float blendSoftLight(float base, float blend) { - return (blend < 0.5) ? (base + (2.0 * blend - 1.0) * (base - base * base)) - : (base + (2.0 * blend - 1.0) * (sqrt(base) - base)); - } vec3 blendSoftLight(vec3 base, vec3 blend) { - return vec3(blendSoftLight(base.r, blend.r), - blendSoftLight(base.g, blend.g), - blendSoftLight(base.b, blend.b)); - } - - vec3 blendMultiply(vec3 base, vec3 blend) { return base * blend; } - - float blendOverlay(float base, float blend) { - return base < 0.5 ? (2.0 * base * blend) - : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)); - } vec3 blendOverlay(vec3 base, vec3 blend) { - return vec3(blendOverlay(base.r, blend.r), blendOverlay(base.g, blend.g), - blendOverlay(base.b, blend.b)); - } - - vec3 blendFunc(vec3 base, vec3 blend, int blendMode) { - if (blendMode == 0) { - return blend; - } else if (blendMode == 15) { - return blendMultiply(base, blend); - } else if (blendMode == 17) { - return blendOverlay(base, blend); - } else if (blendMode == 22) { - return blendHardLight(base, blend); - } - return blend; - } - - void main() { - vec4 fgColor = texture2D(inputImageTexture2, textureCoordinate); // mouth - fgColor = fgColor * intensity; - vec4 bgColor = texture2D(inputImageTexture, textureCoordinate2); - if (fgColor.a == 0.0) { - gl_FragColor = bgColor; - return; - } - - vec3 color = blendFunc(bgColor.rgb, - clamp(fgColor.rgb * (1.0 / fgColor.a), 0.0, 1.0), - blendMode); - // color = color * intensity; - gl_FragColor = - vec4(bgColor.rgb * (1.0 - fgColor.a) + color.rgb * fgColor.a, 1.0); - })"; -#elif defined(GPUPIXEL_MAC) || defined(GPUPIXEL_WIN) || defined(GPUPIXEL_LINUX) -const std::string FaceMakeupFilterFragmentShaderString = R"( - varying vec2 textureCoordinate; - varying vec2 textureCoordinate2; - uniform sampler2D inputImageTexture; - uniform sampler2D inputImageTexture2; // mouth - - uniform float intensity; - uniform int blendMode; - - float blendHardLight(float base, float blend) { - return blend < 0.5 ? (2.0 * base * blend) - : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)); - } - - vec3 blendHardLight(vec3 base, vec3 blend) { - return vec3(blendHardLight(base.r, blend.r), - blendHardLight(base.g, blend.g), - blendHardLight(base.b, blend.b)); - } - - float blendSoftLight(float base, float blend) { - return (blend < 0.5) ? (base + (2.0 * blend - 1.0) * (base - base * base)) - : (base + (2.0 * blend - 1.0) * (sqrt(base) - base)); - } vec3 blendSoftLight(vec3 base, vec3 blend) { - return vec3(blendSoftLight(base.r, blend.r), - blendSoftLight(base.g, blend.g), - blendSoftLight(base.b, blend.b)); - } - - vec3 blendMultiply(vec3 base, vec3 blend) { return base * blend; } - - float blendOverlay(float base, float blend) { - return base < 0.5 ? (2.0 * base * blend) - : (1.0 - 2.0 * (1.0 - base) * (1.0 - blend)); - } vec3 blendOverlay(vec3 base, vec3 blend) { - return vec3(blendOverlay(base.r, blend.r), blendOverlay(base.g, blend.g), - blendOverlay(base.b, blend.b)); - } - - vec3 blendFunc(vec3 base, vec3 blend, int blendMode) { - if (blendMode == 0) { - return blend; - } else if (blendMode == 15) { - return blendMultiply(base, blend); - } else if (blendMode == 17) { - return blendOverlay(base, blend); - } else if (blendMode == 22) { - return blendHardLight(base, blend); - } - return blend; - } - - void main() { - vec4 fgColor = texture2D(inputImageTexture2, textureCoordinate); // mouth - fgColor = fgColor * intensity; - vec4 bgColor = texture2D(inputImageTexture, textureCoordinate2); - if (fgColor.a == 0.0) { - gl_FragColor = bgColor; - return; - } - - vec3 color = blendFunc(bgColor.rgb, - clamp(fgColor.rgb * (1.0 / fgColor.a), 0.0, 1.0), - blendMode); - // color = color * intensity; - gl_FragColor = - vec4(bgColor.rgb * (1.0 - fgColor.a) + color.rgb * fgColor.a, 1.0); - })"; -#endif -FaceMakeupFilter::FaceMakeupFilter() {} - -FaceMakeupFilter::~FaceMakeupFilter() {} - -std::shared_ptr FaceMakeupFilter::create() { - auto ret = std::shared_ptr(new FaceMakeupFilter()); - if (ret && !ret->init()) { - ret.reset(); - } - return ret; -} - -bool FaceMakeupFilter::init() { - if (!Filter::initWithShaderString(FaceMakeupFilterVertexShaderString, - FaceMakeupFilterFragmentShaderString)) { - return false; - } - - // lipstick render program - _filterPositionAttribute = _filterProgram->getAttribLocation("position"); - _filterTexCoordAttribute = - _filterProgram->getAttribLocation("inputTextureCoordinate"); - - // base render program - _filterProgram2 = GLProgram::createByShaderString(kDefaultVertexShader, - kDefaultFragmentShader); - _filterPositionAttribute2 = _filterProgram2->getAttribLocation("position"); - _filterTexCoordAttribute2 = - _filterProgram2->getAttribLocation("inputTextureCoordinate"); - - registerProperty("blend_level", 0, "The smoothing of filter with range between -1 and 1.", [this](float& val) { - setBlendLevel(val); - }); - - std::vector defaut; - registerProperty("face_landmark", defaut, "The face landmark of filter with range between -1 and 1.", [this](std::vector val) { - SetFaceLandmarks(val); - }); - return true; -} - -void FaceMakeupFilter::SetFaceLandmarks(std::vector landmarks) { - if (landmarks.size() == 0) { - has_face_ = false; - return; - } - std::vector vect; - for (auto it : landmarks) { - vect.push_back(2 * it - 1); - } - face_land_marks_ = vect; - has_face_ = true; -} - -void FaceMakeupFilter::setImageTexture(std::shared_ptr texture) { - image_texture_ = texture; -} - - -bool FaceMakeupFilter::proceed(bool bUpdateTargets, int64_t frameTime) { - static const GLfloat imageVertices[] = { - -1.0f, -1.0f, - 1.0f, -1.0f, - -1.0f, 1.0f, - 1.0f, 1.0f, - }; - - _framebuffer->active(); - // render origin frame --- begin -----// - GPUPixelContext::getInstance()->setActiveShaderProgram(_filterProgram2); - CHECK_GL(glClearColor(_backgroundColor.r, _backgroundColor.g, - _backgroundColor.b, _backgroundColor.a)); - CHECK_GL(glClear(GL_COLOR_BUFFER_BIT)); - - CHECK_GL(glActiveTexture(GL_TEXTURE4)); - CHECK_GL(glBindTexture(GL_TEXTURE_2D, - _inputFramebuffers[0].frameBuffer->getTexture())); - _filterProgram2->setUniformValue("inputImageTexture", 4); - - // vertex - CHECK_GL(glEnableVertexAttribArray(_filterPositionAttribute2)); - CHECK_GL(glVertexAttribPointer(_filterPositionAttribute2, 2, GL_FLOAT, 0, 0, - imageVertices)); - - CHECK_GL(glEnableVertexAttribArray(_filterTexCoordAttribute2)); - CHECK_GL(glVertexAttribPointer(_filterTexCoordAttribute2, 2, GL_FLOAT, 0, 0, - _getTexureCoordinate(NoRotation))); - - CHECK_GL(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4)); - - // render image --- begin --- // - GPUPixelContext::getInstance()->setActiveShaderProgram(_filterProgram); - - CHECK_GL(glEnableVertexAttribArray(_filterPositionAttribute)); - if (face_land_marks_.size() != 0) { - CHECK_GL(glVertexAttribPointer(_filterPositionAttribute, 2, GL_FLOAT, 0, 0, - face_land_marks_.data())); - } - - auto coord = this->faceTextureCoordinates(); - std::vector textureCoordinates(coord.size()); - auto point_count = coord.size() / 2; - for (int i = 0; i < point_count; i++) { - textureCoordinates[i * 2 + 0] = - (coord[i * 2 + 0] * 1280 - texture_bounds_.x) / texture_bounds_.width; - textureCoordinates[i * 2 + 1] = - (coord[i * 2 + 1] * 1280 - texture_bounds_.y) / texture_bounds_.height; - } - // texcoord attribute - CHECK_GL(glEnableVertexAttribArray(_filterTexCoordAttribute)); - CHECK_GL(glVertexAttribPointer(_filterTexCoordAttribute, 2, GL_FLOAT, 0, 0, - textureCoordinates.data())); - - _filterProgram->setUniformValue("intensity", this->blend_level_); - - _filterProgram->setUniformValue("blendMode", 15); - - std::shared_ptr fb = _inputFramebuffers[0].frameBuffer; - CHECK_GL(glActiveTexture(GL_TEXTURE0)); - CHECK_GL(glBindTexture(GL_TEXTURE_2D, fb->getTexture())); - _filterProgram->setUniformValue("inputImageTexture", 0); // origin image - - glActiveTexture(GL_TEXTURE3); - // assert(image_texture_); - glBindTexture(GL_TEXTURE_2D, image_texture_->getFramebuffer()->getTexture()); - _filterProgram->setUniformValue("inputImageTexture2", 3); - - if (has_face_) { - auto face_indexs = this->getFaceIndexs(); - glDrawElements(GL_TRIANGLES, (GLsizei)face_indexs.size(), GL_UNSIGNED_INT, - face_indexs.data()); - } - _framebuffer->inactive(); - - return Source::proceed(bUpdateTargets, frameTime); -} - -std::vector FaceMakeupFilter::getFaceIndexs() { - static std::vector faceIndexs{ - // 左眉毛 10个三角形 - 33, 34, 64, - 64, 34, 65, - 65, 34, 107, - 107, 34, 35, - 35, 36, 107, - 107, 36, 66, - 66, 107, 65, - 66, 36, 67, - 67, 36, 37, - 37, 67, 43, - // 右眉毛 10个三角形 - 43, 38, 68, - 68, 38, 39, - 39, 68, 69, - 39, 40, 108, - 39, 108, 69, - 69, 108, 70, - 70, 108, 41, - 41, 108, 40, - 41, 70, 71, - 71, 41, 42, - // 左眼 21个三角形 - 0, 33, 52, - 33, 52, 64, - 52, 64, 53, - 64, 53, 65, - 65, 53, 72, - 65, 72, 66, - 66, 72, 54, - 66, 54, 67, - 54, 67, 55, - 67, 55, 78, - 67, 78, 43, - 52, 53, 57, - 53, 72, 74, - 53, 74, 57, - 74, 57, 73, - 72, 54, 104, - 72, 104, 74, - 74, 104, 73, - 73, 104, 56, - 104, 56, 54, - 54, 56, 55, - // 右眼 21个三角形 - 68, 43, 79, - 68, 79, 58, - 68, 58, 59, - 68, 59, 69, - 69, 59, 75, - 69, 75, 70, - 70, 75, 60, - 70, 60, 71, - 71, 60, 61, - 71, 61, 42, - 42, 61, 32, - 61, 60, 62, - 60, 75, 77, - 60, 77, 62, - 77, 62, 76, - 75, 77, 105, - 77, 105, 76, - 105, 76, 63, - 105, 63, 59, - 105, 59, 75, - 59, 63, 58, - // 左脸颊 16个 - 0, 52, 1, - 1, 52, 2, - 2, 52, 57, - 2, 57, 3, - 3, 57, 4, - 4, 57, 109, - 57, 109, 74, - 74, 109, 56, - 56, 109, 80, - 80, 109, 82, - 82, 109, 7, - 7, 109, 6, - 6, 109, 5, - 5, 109, 4, - 56, 80, 55, - 55, 80, 78, - // 右脸颊 16个 - 32, 61, 31, - 31, 61, 30, - 30, 61, 62, - 30, 62, 29, - 29, 62, 28, - 28, 62, 110, - 62, 110, 76, - 76, 110, 63, - 63, 110, 81, - 81, 110, 83, - 83, 110, 25, - 25, 110, 26, - 26, 110, 27, - 27, 110, 28, - 63, 81, 58, - 58, 81, 79, - // 鼻子部分 16个 - 78, 43, 44, - 43, 44, 79, - 78, 44, 80, - 79, 81, 44, - 80, 44, 45, - 44, 81, 45, - 80, 45, 46, - 45, 81, 46, - 80, 46, 82, - 81, 46, 83, - 82, 46, 47, - 47, 46, 48, - 48, 46, 49, - 49, 46, 50, - 50, 46, 51, - 51, 46, 83, - // 鼻子和嘴巴中间三角形 14个 - 7, 82, 84, - 82, 84, 47, - 84, 47, 85, - 85, 47, 48, - 48, 85, 86, - 86, 48, 49, - 49, 86, 87, - 49, 87, 88, - 88, 49, 50, - 88, 50, 89, - 89, 50, 51, - 89, 51, 90, - 51, 90, 83, - 83, 90, 25, - // 上嘴唇部分 10个 - 84, 85, 96, - 96, 85, 97, - 97, 85, 86, - 86, 97, 98, - 86, 98, 87, - 87, 98, 88, - 88, 98, 99, - 88, 99, 89, - 89, 99, 100, - 89, 100, 90, - // 下嘴唇部分 10个 - 90, 100, 91, - 100, 91, 101, - 101, 91, 92, - 101, 92, 102, - 102, 92, 93, - 102, 93, 94, - 102, 94, 103, - 103, 94, 95, - 103, 95, 96, - 96, 95, 84, - // 唇间部分 8个 - 96, 97, 103, - 97, 103, 106, - 97, 106, 98, - 106, 103, 102, - 106, 102, 101, - 106, 101, 99, - 106, 98, 99, - 99, 101, 100, - // 嘴巴与下巴之间的部分(关键点7 到25 与嘴巴鼻翼围起来的区域) 24个 - 7, 84, 8, - 8, 84, 9, - 9, 84, 10, - 10, 84, 95, - 10, 95, 11, - 11, 95, 12, - 12, 95, 94, - 12, 94, 13, - 13, 94, 14, - 14, 94, 93, - 14, 93, 15, - 15, 93, 16, - 16, 93, 17, - 17, 93, 18, - 18, 93, 92, - 18, 92, 19, - 19, 92, 20, - 20, 92, 91, - 20, 91, 21, - 21, 91, 22, - 22, 91, 90, - 22, 90, 23, - 23, 90, 24, - 24, 90, 25 - }; - return faceIndexs; -} - -std::vector FaceMakeupFilter::faceTextureCoordinates() { - static std::vector arr = { - 0.302451, 0.384169, - 0.302986, 0.409377, - 0.304336, 0.434977, - 0.306984, 0.460683, - 0.311010, 0.486447, - 0.316537, 0.511947, - 0.323069, 0.536942, - 0.331312, 0.561627, - 0.342011, 0.585088, - 0.355477, 0.607217, - 0.371142, 0.627774, - 0.388459, 0.646991, - 0.407041, 0.665229, - 0.426325, 0.682694, - 0.447468, 0.697492, - 0.471782, 0.707060, - 0.500000, 0.709867, - 0.528218, 0.707060, - 0.552532, 0.697492, - 0.573675, 0.682694, - 0.592959, 0.665229, - 0.611541, 0.646991, - 0.628858, 0.627774, - 0.644523, 0.607217, - 0.657989, 0.585088, - 0.668688, 0.561627, - 0.676931, 0.536942, - 0.683463, 0.511947, - 0.688990, 0.486447, - 0.693016, 0.460683, - 0.695664, 0.434977, - 0.697014, 0.409377, - 0.697549, 0.384169, - 0.331655, 0.354725, - 0.354609, 0.331785, - 0.387080, 0.325436, - 0.420446, 0.330125, - 0.452685, 0.339996, - 0.547315, 0.339996, - 0.579554, 0.330125, - 0.612920, 0.325436, - 0.645391, 0.331785, - 0.668345, 0.354725, - 0.500000, 0.405156, - 0.500000, 0.442322, - 0.500000, 0.480116, - 0.500000, 0.517378, - 0.457729, 0.542442, - 0.476911, 0.546376, - 0.500000, 0.550557, - 0.523089, 0.546376, - 0.542271, 0.542442, - 0.366597, 0.404028, - 0.385132, 0.392425, - 0.428177, 0.397495, - 0.442446, 0.414082, - 0.422818, 0.419177, - 0.382917, 0.415929, - 0.557554, 0.414082, - 0.571823, 0.397495, - 0.614868, 0.392425, - 0.633403, 0.404028, - 0.617083, 0.415929, - 0.577182, 0.419177, - 0.360880, 0.349748, - 0.391440, 0.348304, - 0.421788, 0.352051, - 0.451601, 0.358026, - 0.548399, 0.358026, - 0.578212, 0.352051, - 0.608560, 0.348304, - 0.639120, 0.349748, - 0.407165, 0.390906, - 0.402591, 0.420584, - 0.406113, 0.405280, - 0.592835, 0.390906, - 0.597409, 0.420584, - 0.593887, 0.405280, - 0.471223, 0.409619, - 0.528777, 0.409619, - 0.455607, 0.495169, - 0.544393, 0.495169, - 0.441855, 0.523363, - 0.558145, 0.523363, - 0.426186, 0.593516, - 0.453348, 0.586128, - 0.481258, 0.582594, - 0.500000, 0.584476, - 0.518742, 0.582594, - 0.546652, 0.586128, - 0.573814, 0.593516, - 0.556544, 0.620391, - 0.531320, 0.639672, - 0.500000, 0.644911, - 0.468680, 0.639672, - 0.443456, 0.620391, - 0.433718, 0.595595, - 0.466898, 0.597025, - 0.500000, 0.599883, - 0.533102, 0.597025, - 0.566282, 0.595595, - 0.534634, 0.610720, - 0.500000, 0.616173, - 0.465366, 0.610720, - 0.406113, 0.405280, - 0.593887, 0.405280, - 0.500000, 0.608028, - 0.389259, 0.336870, - 0.610740, 0.336870, - 0.386071, 0.503558, - 0.613928, 0.503558 - }; - return arr; -} -NS_GPUPIXEL_END diff --git a/src/filter/face_makeup_filter.h b/src/filter/face_makeup_filter.h deleted file mode 100755 index dbb839f4..00000000 --- a/src/filter/face_makeup_filter.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#pragma once - -#include "filter.h" - -NS_GPUPIXEL_BEGIN -class SourceImage; - -GPUPIXEL_API typedef struct { - float x; - float y; - float width; - float height; -} FrameBounds; - -class GPUPIXEL_API FaceMakeupFilter : public Filter { - public: - static std::shared_ptr create(); - ~FaceMakeupFilter(); - virtual bool init(); - virtual bool proceed(bool bUpdateTargets = true, - int64_t frameTime = 0) override; - - - inline void setBlendLevel(float level) { this->blend_level_ = level; } - void SetFaceLandmarks(std::vector landmarks); - protected: - FaceMakeupFilter(); - void setImageTexture(std::shared_ptr texture); - void setTextureBounds(FrameBounds bounds) { texture_bounds_ = bounds; } - - private: - std::vector getFaceIndexs(); - std::vector faceTextureCoordinates(); - - private: - std::vector face_land_marks_; - float blend_level_ = 0; //[0. 0.5] - bool has_face_ = false; - // - GLProgram* _filterProgram2; - GLuint _filterPositionAttribute2; - GLuint _filterTexCoordAttribute = 0; - GLuint _filterTexCoordAttribute2 = 0; - - FrameBounds texture_bounds_; - std::shared_ptr image_texture_; -}; - -NS_GPUPIXEL_END diff --git a/src/filter/face_reshape_filter.cc b/src/filter/face_reshape_filter.cc deleted file mode 100755 index 9c8a9dc8..00000000 --- a/src/filter/face_reshape_filter.cc +++ /dev/null @@ -1,281 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#include "face_reshape_filter.h" -#include "gpupixel_context.h" -#include "face_detector.h" -NS_GPUPIXEL_BEGIN - -#if defined(GPUPIXEL_IOS) || defined(GPUPIXEL_ANDROID) -const std::string kGPUPixelThinFaceFragmentShaderString = R"( - precision highp float; - varying highp vec2 textureCoordinate; - uniform sampler2D inputImageTexture; - - uniform int hasFace; - uniform float facePoints[106 * 2]; - - uniform highp float aspectRatio; - uniform float thinFaceDelta; - uniform float bigEyeDelta; - - vec2 enlargeEye(vec2 textureCoord, vec2 originPosition, float radius, float delta) { - - float weight = distance(vec2(textureCoord.x, textureCoord.y / aspectRatio), vec2(originPosition.x, originPosition.y / aspectRatio)) / radius; - - weight = 1.0 - (1.0 - weight * weight) * delta; - weight = clamp(weight,0.0,1.0); - textureCoord = originPosition + (textureCoord - originPosition) * weight; - return textureCoord; - } - - vec2 curveWarp(vec2 textureCoord, vec2 originPosition, vec2 targetPosition, float delta) { - - vec2 offset = vec2(0.0); - vec2 result = vec2(0.0); - vec2 direction = (targetPosition - originPosition) * delta; - - float radius = distance(vec2(targetPosition.x, targetPosition.y / aspectRatio), vec2(originPosition.x, originPosition.y / aspectRatio)); - float ratio = distance(vec2(textureCoord.x, textureCoord.y / aspectRatio), vec2(originPosition.x, originPosition.y / aspectRatio)) / radius; - - ratio = 1.0 - ratio; - ratio = clamp(ratio, 0.0, 1.0); - offset = direction * ratio; - - result = textureCoord - offset; - - return result; - } - - vec2 thinFace(vec2 currentCoordinate) { - - vec2 faceIndexs[9]; - faceIndexs[0] = vec2(3., 44.); - faceIndexs[1] = vec2(29., 44.); - faceIndexs[2] = vec2(7., 45.); - faceIndexs[3] = vec2(25., 45.); - faceIndexs[4] = vec2(10., 46.); - faceIndexs[5] = vec2(22., 46.); - faceIndexs[6] = vec2(14., 49.); - faceIndexs[7] = vec2(18., 49.); - faceIndexs[8] = vec2(16., 49.); - - for(int i = 0; i < 9; i++) - { - int originIndex = int(faceIndexs[i].x); - int targetIndex = int(faceIndexs[i].y); - vec2 originPoint = vec2(facePoints[originIndex * 2], facePoints[originIndex * 2 + 1]); - vec2 targetPoint = vec2(facePoints[targetIndex * 2], facePoints[targetIndex * 2 + 1]); - currentCoordinate = curveWarp(currentCoordinate, originPoint, targetPoint, thinFaceDelta); - } - return currentCoordinate; - } - - vec2 bigEye(vec2 currentCoordinate) { - - vec2 faceIndexs[2]; - faceIndexs[0] = vec2(74., 72.); - faceIndexs[1] = vec2(77., 75.); - - for(int i = 0; i < 2; i++) - { - int originIndex = int(faceIndexs[i].x); - int targetIndex = int(faceIndexs[i].y); - - vec2 originPoint = vec2(facePoints[originIndex * 2], facePoints[originIndex * 2 + 1]); - vec2 targetPoint = vec2(facePoints[targetIndex * 2], facePoints[targetIndex * 2 + 1]); - - float radius = distance(vec2(targetPoint.x, targetPoint.y / aspectRatio), vec2(originPoint.x, originPoint.y / aspectRatio)); - radius = radius * 5.; - currentCoordinate = enlargeEye(currentCoordinate, originPoint, radius, bigEyeDelta); - } - return currentCoordinate; - } - - void main() - { - vec2 positionToUse = textureCoordinate; - - if (hasFace == 1) { - positionToUse = thinFace(positionToUse); - positionToUse = bigEye(positionToUse); - } - - gl_FragColor = texture2D(inputImageTexture, positionToUse); - - } - )"; -#elif defined(GPUPIXEL_MAC) || defined(GPUPIXEL_WIN) || defined(GPUPIXEL_LINUX) -const std::string kGPUPixelThinFaceFragmentShaderString = R"( - varying vec2 textureCoordinate; - uniform sampler2D inputImageTexture; - - uniform int hasFace; - uniform float facePoints[106 * 2]; - - uniform float aspectRatio; - uniform float thinFaceDelta; - uniform float bigEyeDelta; - - vec2 enlargeEye(vec2 textureCoord, vec2 originPosition, float radius, float delta) { - - float weight = distance(vec2(textureCoord.x, textureCoord.y / aspectRatio), vec2(originPosition.x, originPosition.y / aspectRatio)) / radius; - - weight = 1.0 - (1.0 - weight * weight) * delta; - weight = clamp(weight,0.0,1.0); - textureCoord = originPosition + (textureCoord - originPosition) * weight; - return textureCoord; - } - - vec2 curveWarp(vec2 textureCoord, vec2 originPosition, vec2 targetPosition, float delta) { - - vec2 offset = vec2(0.0); - vec2 result = vec2(0.0); - vec2 direction = (targetPosition - originPosition) * delta; - - float radius = distance(vec2(targetPosition.x, targetPosition.y / aspectRatio), vec2(originPosition.x, originPosition.y / aspectRatio)); - float ratio = distance(vec2(textureCoord.x, textureCoord.y / aspectRatio), vec2(originPosition.x, originPosition.y / aspectRatio)) / radius; - - ratio = 1.0 - ratio; - ratio = clamp(ratio, 0.0, 1.0); - offset = direction * ratio; - - result = textureCoord - offset; - - return result; - } - - vec2 thinFace(vec2 currentCoordinate) { - - vec2 faceIndexs[9]; - faceIndexs[0] = vec2(3., 44.); - faceIndexs[1] = vec2(29., 44.); - faceIndexs[2] = vec2(7., 45.); - faceIndexs[3] = vec2(25., 45.); - faceIndexs[4] = vec2(10., 46.); - faceIndexs[5] = vec2(22., 46.); - faceIndexs[6] = vec2(14., 49.); - faceIndexs[7] = vec2(18., 49.); - faceIndexs[8] = vec2(16., 49.); - - for(int i = 0; i < 9; i++) - { - int originIndex = int(faceIndexs[i].x); - int targetIndex = int(faceIndexs[i].y); - vec2 originPoint = vec2(facePoints[originIndex * 2], facePoints[originIndex * 2 + 1]); - vec2 targetPoint = vec2(facePoints[targetIndex * 2], facePoints[targetIndex * 2 + 1]); - currentCoordinate = curveWarp(currentCoordinate, originPoint, targetPoint, thinFaceDelta); - } - return currentCoordinate; - } - - vec2 bigEye(vec2 currentCoordinate) { - - vec2 faceIndexs[2]; - faceIndexs[0] = vec2(74., 72.); - faceIndexs[1] = vec2(77., 75.); - - for(int i = 0; i < 2; i++) - { - int originIndex = int(faceIndexs[i].x); - int targetIndex = int(faceIndexs[i].y); - - vec2 originPoint = vec2(facePoints[originIndex * 2], facePoints[originIndex * 2 + 1]); - vec2 targetPoint = vec2(facePoints[targetIndex * 2], facePoints[targetIndex * 2 + 1]); - - float radius = distance(vec2(targetPoint.x, targetPoint.y / aspectRatio), vec2(originPoint.x, originPoint.y / aspectRatio)); - radius = radius * 5.; - currentCoordinate = enlargeEye(currentCoordinate, originPoint, radius, bigEyeDelta); - } - return currentCoordinate; - } - - void main() - { - vec2 positionToUse = textureCoordinate; - - if (hasFace == 1) { - positionToUse = thinFace(positionToUse); - positionToUse = bigEye(positionToUse); - } - - gl_FragColor = texture2D(inputImageTexture, positionToUse); - } - )"; -#endif -FaceReshapeFilter::FaceReshapeFilter() {} - -FaceReshapeFilter::~FaceReshapeFilter() {} - -std::shared_ptr FaceReshapeFilter::create() { - auto ret = std::shared_ptr(new FaceReshapeFilter()); - if (ret && !ret->init()) { - ret.reset(); - } - return ret; -} - -bool FaceReshapeFilter::init() { - if (!initWithFragmentShaderString(kGPUPixelThinFaceFragmentShaderString)) { - return false; - } - registerProperty("thin_face", 0, "The smoothing of filter with range between -1 and 1.", [this](float& val) { - setFaceSlimLevel(val); - }); - - registerProperty("big_eye", 0, "The smoothing of filter with range between -1 and 1.", [this](float& val) { - setEyeZoomLevel(val); - }); - - std::vector defaut; - registerProperty("face_landmark", defaut, "The face landmark of filter with range between -1 and 1.", [this](std::vector val) { - SetFaceLandmarks(val); - }); - - this->thinFaceDelta_ = 0.0; - // [0, 0.15] - this->bigEyeDelta_ = 0.0; - return true; -} - -void FaceReshapeFilter::SetFaceLandmarks(std::vector landmarks) { - if (landmarks.size() == 0) { - has_face_ = false; - return; - } - - face_land_marks_ = landmarks; - has_face_ = true; -} - -bool FaceReshapeFilter::proceed(bool bUpdateTargets, int64_t frameTime) { - float aspect = (float)_framebuffer->getWidth() / _framebuffer->getHeight(); - _filterProgram->setUniformValue("aspectRatio", aspect); - - _filterProgram->setUniformValue("thinFaceDelta", this->thinFaceDelta_); - - _filterProgram->setUniformValue("bigEyeDelta", this->bigEyeDelta_); - - _filterProgram->setUniformValue("hasFace", has_face_); - if (has_face_) { - _filterProgram->setUniformValue("facePoints", face_land_marks_.data(), - static_cast(face_land_marks_.size())); - } - return Filter::proceed(bUpdateTargets, frameTime); -} - -#pragma mark - face slim -void FaceReshapeFilter::setFaceSlimLevel(float level) { - thinFaceDelta_ = level; -} - -#pragma mark - eye zoom -void FaceReshapeFilter::setEyeZoomLevel(float level) { - bigEyeDelta_ = level; -} - -NS_GPUPIXEL_END diff --git a/src/filter/face_reshape_filter.h b/src/filter/face_reshape_filter.h deleted file mode 100755 index 401db906..00000000 --- a/src/filter/face_reshape_filter.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#pragma once - -#include "filter.h" -#include "face_detector.h" - -NS_GPUPIXEL_BEGIN -class GPUPIXEL_API FaceReshapeFilter : public Filter { - public: - static std::shared_ptr create(); - ~FaceReshapeFilter(); - bool init(); - virtual bool proceed(bool bUpdateTargets = true, - int64_t frameTime = 0) override; - - void setFaceSlimLevel(float level); - void setEyeZoomLevel(float level); - void SetFaceLandmarks(std::vector landmarks); - protected: - FaceReshapeFilter(); - float thinFaceDelta_ = 0; - float bigEyeDelta_ = 0; - - std::vector face_land_marks_; - int has_face_ = 0; -}; - -NS_GPUPIXEL_END diff --git a/src/filter/filter.cc b/src/filter/filter.cc index 22bf6e22..4837ff5d 100755 --- a/src/filter/filter.cc +++ b/src/filter/filter.cc @@ -13,10 +13,6 @@ NS_GPUPIXEL_BEGIN std::map()>> initFilterFactory() { std::map()>> factory; - factory["BeautyFaceFilter"] = BeautyFaceFilter::create; - factory["FaceReshapeFilter"] = FaceReshapeFilter::create; - factory["LipstickFilter"] = LipstickFilter::create; - factory["BlusherFilter"] = BlusherFilter::create; return factory; } std::map()>> Filter::_filterFactories = initFilterFactory(); diff --git a/src/filter/lipstick_filter.cc b/src/filter/lipstick_filter.cc deleted file mode 100755 index 65fa23e7..00000000 --- a/src/filter/lipstick_filter.cc +++ /dev/null @@ -1,28 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#include "lipstick_filter.h" -#include "face_detector.h" -#include "source_image.h" - -NS_GPUPIXEL_BEGIN -std::shared_ptr LipstickFilter::create() { - auto ret = std::shared_ptr(new LipstickFilter()); - if (ret && !ret->init()) { - ret.reset(); - } - return ret; -} - -bool LipstickFilter::init() { - auto mouth = SourceImage::create(Util::getResourcePath("mouth.png")); - setImageTexture(mouth); - setTextureBounds(FrameBounds{502.5, 710, 262.5, 167.5}); - return FaceMakeupFilter::init(); -} - -NS_GPUPIXEL_END diff --git a/src/filter/lipstick_filter.h b/src/filter/lipstick_filter.h deleted file mode 100755 index c6b6c732..00000000 --- a/src/filter/lipstick_filter.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * GPUPixel - * - * Created by PixPark on 2021/6/24. - * Copyright © 2021 PixPark. All rights reserved. - */ - -#pragma once - -#include "face_makeup_filter.h" - -NS_GPUPIXEL_BEGIN -class GPUPIXEL_API LipstickFilter : public FaceMakeupFilter { -public: - static std::shared_ptr create(); - bool init() override; -}; - -NS_GPUPIXEL_END diff --git a/src/lib.cmake b/src/lib.cmake index 385fad49..2d1f6ac9 100644 --- a/src/lib.cmake +++ b/src/lib.cmake @@ -48,7 +48,6 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/third_party/stb ${CMAKE_CURRENT_SOURCE_DIR}/third_party/glad/include ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libyuv/include - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/include ) # Add common source file @@ -75,13 +74,7 @@ FILE(GLOB EXPORT_HEADER FILE(GLOB RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/*" ) -if(${CURRENT_OS} STREQUAL "ios" OR ${CURRENT_OS} STREQUAL "android") - list(APPEND RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/models/vnn_face278_data/face_mobile[1.0.0].vnnmodel") -else() - list(APPEND RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/models/vnn_face278_data/face_pc[1.0.0].vnnmodel") -endif() - - + # Add platform source and header and lib link search path IF(${CURRENT_OS} STREQUAL "windows") set(CMAKE_SHARED_LIBRARY_PREFIX "") # windows @@ -113,8 +106,6 @@ ELSEIF(${CURRENT_OS} STREQUAL "android") # android # Source FILE(GLOB JNI_SOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/android/jni/*") list(APPEND SOURCE_FILES ${JNI_SOURCE_FILE}) - - LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/${ANDROID_ABI}) ENDIF() # Config project @@ -124,39 +115,9 @@ ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${RESOURCE_FILES}) # set platform project IF(${CURRENT_OS} STREQUAL "linux") - # 设置要构建的目标库的名称和类型 - add_library(vnn_kit SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_kit PROPERTIES IMPORTED_LOCATION - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/libvnn_kit.so) - - add_library(vnn_face SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_face PROPERTIES IMPORTED_LOCATION - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/libvnn_face.so) - - add_library(vnn_core SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_core PROPERTIES IMPORTED_LOCATION - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/libvnn_core.so) - set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-Wl,-rpath,./") ELSEIF(${CURRENT_OS} STREQUAL "windows") - # 设置要构建的目标库的名称和类型 - add_library(vnn_kit SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_kit PROPERTIES IMPORTED_IMPLIB - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/x64/vnn_kit.lib) - - add_library(vnn_core SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_core PROPERTIES IMPORTED_IMPLIB - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/x64/vnn_core.lib) - - add_library(vnn_face SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_face PROPERTIES IMPORTED_IMPLIB - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/x64/vnn_face.lib) + ELSEIF(${CURRENT_OS} STREQUAL "macos" OR ${CURRENT_OS} STREQUAL "ios") set_target_properties(${PROJECT_NAME} PROPERTIES XCODE_ATTRIBUTE_PRODUCT_NAME ${PROJECT_NAME} @@ -169,24 +130,10 @@ ELSEIF(${CURRENT_OS} STREQUAL "macos" OR ${CURRENT_OS} STREQUAL "ios") FRAMEWORK_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/ PUBLIC_HEADER "${EXPORT_HEADER}" RESOURCE "${RESOURCE_FILES}" - LINK_FLAGS "-Wl,-F${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}" ) ELSEIF(${CURRENT_OS} STREQUAL "android") # 设置要构建的目标库的名称和类型 - add_library(vnn_kit SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_kit PROPERTIES IMPORTED_LOCATION - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/${ANDROID_ABI}/libvnn_kit.so) - - add_library(vnn_core SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_core PROPERTIES IMPORTED_LOCATION - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/${ANDROID_ABI}/libvnn_core.so) - - add_library(vnn_face SHARED IMPORTED) - # 设置目标库的实际路径 - set_target_properties(vnn_face PROPERTIES IMPORTED_LOCATION - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}/${ANDROID_ABI}/libvnn_face.so) + ELSEIF(${CURRENT_OS} STREQUAL "wasm") set_target_properties(${PROJECT_NAME} PROPERTIES SUFFIX ".wasm" @@ -200,18 +147,12 @@ IF(${CURRENT_OS} STREQUAL "linux" OR ${CURRENT_OS} STREQUAL "wasm") TARGET_LINK_LIBRARIES( ${PROJECT_NAME} GL - glfw - vnn_core - vnn_kit - vnn_face) + glfw) ELSEIF(${CURRENT_OS} STREQUAL "windows") TARGET_LINK_LIBRARIES( ${PROJECT_NAME} opengl32 - glfw3 - vnn_core - vnn_kit - vnn_face) + glfw3) ELSEIF(${CURRENT_OS} STREQUAL "macos") TARGET_LINK_LIBRARIES( ${PROJECT_NAME} "-framework OpenGL \ @@ -220,23 +161,17 @@ ELSEIF(${CURRENT_OS} STREQUAL "macos") -framework CoreVideo \ -framework CoreGraphics \ -framework AVFoundation \ - -framework CoreMedia - -framework vnn_kit_osx \ - -framework vnn_core_osx \ - -framework vnn_face_osx" + -framework CoreMedia" ) ELSEIF(${CURRENT_OS} STREQUAL "ios") TARGET_LINK_LIBRARIES( - ${PROJECT_NAME} "-framework OpenGLES \ + ${PROJECT_NAME} "-framework OpenGLES \ -framework UIKit \ -framework QuartzCore \ -framework CoreVideo \ -framework CoreGraphics \ -framework AVFoundation \ - -framework CoreMedia \ - -framework vnn_kit_ios \ - -framework vnn_core_ios \ - -framework vnn_face_ios" + -framework CoreMedia" ) ELSEIF(${CURRENT_OS} STREQUAL "android") TARGET_LINK_LIBRARIES( @@ -245,10 +180,7 @@ ELSEIF(${CURRENT_OS} STREQUAL "android") android GLESv3 EGL - jnigraphics - vnn_core - vnn_kit - vnn_face) + jnigraphics) ENDIF() MACRO(EXPORT_INCLUDE) @@ -261,14 +193,7 @@ MACRO(EXPORT_INCLUDE) COMMAND ${CMAKE_COMMAND} -E copy ${EXPORT_HEADER} ${CMAKE_INCLUDE_OUTPUT_DIRECTORY} COMMENT "Copying headers and resource to output directory.") - - # copy gpupixel and vnn lib - SET(VNN_LIBS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/vnn/libs/${CURRENT_OS}) - ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vnn - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${VNN_LIBS} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vnn - ) + ENDMACRO() EXPORT_INCLUDE() \ No newline at end of file diff --git a/src/source/source.cc b/src/source/source.cc index cb43b44e..916e5ed6 100755 --- a/src/source/source.cc +++ b/src/source/source.cc @@ -136,15 +136,6 @@ int Source::getRotatedFramebufferWidth() const { return 0; } } - -int Source::RegLandmarkCallback(FaceDetectorCallback callback) { - if(_face_detector == nullptr) { - // init face detector - _face_detector = std::make_shared(); - } - - return _face_detector->RegCallback(callback); -} int Source::getRotatedFramebufferHeight() const { if (_framebuffer) { diff --git a/src/source/source.h b/src/source/source.h index f1f5db4f..5e2ce556 100755 --- a/src/source/source.h +++ b/src/source/source.h @@ -14,7 +14,6 @@ #if defined(GPUPIXEL_IOS) || defined(GPUPIXEL_MAC) #import "gpupixel_target.h" #endif -#include "face_detector.h" NS_GPUPIXEL_BEGIN class GPUPIXEL_API Filter; @@ -55,13 +54,11 @@ class GPUPIXEL_API Source { std::shared_ptr upToFilter, int width = 0, int height = 0); - int RegLandmarkCallback(FaceDetectorCallback callback); protected: std::shared_ptr _framebuffer; RotationMode _outputRotation; std::map, int> _targets; float _framebufferScale; - std::shared_ptr _face_detector; }; NS_GPUPIXEL_END diff --git a/src/source/source_camera.cc b/src/source/source_camera.cc index 11779259..038c525e 100755 --- a/src/source/source_camera.cc +++ b/src/source/source_camera.cc @@ -49,11 +49,7 @@ void SourceCamera::setFrameData( GPUPixelContext::getInstance()->getFramebufferCache()->fetchFramebuffer( width, height, true); } - if(_face_detector) { - _face_detector->Detect(static_cast(pixels), width, height, - GPUPIXEL_MODE_FMT_VIDEO, - GPUPIXEL_FRAME_TYPE_RGBA8888); - } + this->setFramebuffer(_framebuffer, outputRotation); CHECK_GL(glBindTexture(GL_TEXTURE_2D, this->getFramebuffer()->getTexture())); diff --git a/src/source/source_image.cc b/src/source/source_image.cc index aca7d280..966ace53 100755 --- a/src/source/source_image.cc +++ b/src/source/source_image.cc @@ -16,7 +16,6 @@ #define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" -#include "face_detector.h" USING_NS_GPUPIXEL std::shared_ptr SourceImage::create_from_memory(int width, @@ -76,16 +75,7 @@ void SourceImage::init(int width, int height, int channel_count, const unsigned CHECK_GL(glBindTexture(GL_TEXTURE_2D, 0)); } -void SourceImage::Render() { - GPUPIXEL_FRAME_TYPE type; - if(_face_detector) { - _face_detector->Detect(image_bytes.data(), - _framebuffer->getWidth(), - _framebuffer->getHeight(), - GPUPIXEL_MODE_FMT_PICTURE, - GPUPIXEL_FRAME_TYPE_RGBA8888); - } - +void SourceImage::Render() { Source::proceed(); } diff --git a/src/source/source_raw_data_input.cc b/src/source/source_raw_data_input.cc index 8cabf9d0..2174d806 100755 --- a/src/source/source_raw_data_input.cc +++ b/src/source/source_raw_data_input.cc @@ -8,7 +8,6 @@ #include "source_raw_data_input.h" #include "gpupixel_context.h" #include "util.h" -#include "face_detector.h" USING_NS_GPUPIXEL const std::string kI420VertexShaderString = R"( @@ -123,10 +122,7 @@ void SourceRawDataInput::uploadBytes(const uint8_t* pixels, int stride, int64_t ts) { GPUPixelContext::getInstance()->runSync([=] { - if(_face_detector) { - _face_detector->Detect(pixels, width, height, GPUPIXEL_MODE_FMT_VIDEO,GPUPIXEL_FRAME_TYPE_RGBA8888); - } - genTextureWithRGBA(pixels, width, height, stride, ts); + genTextureWithRGBA(pixels, width, height, stride, ts); }); } @@ -144,10 +140,6 @@ void SourceRawDataInput::uploadBytes(int width, int strideV, int64_t ts) { GPUPixelContext::getInstance()->runSync([=] { - if(_face_detector) { - _face_detector->Detect(dataY, width, height, GPUPIXEL_MODE_FMT_VIDEO, GPUPIXEL_FRAME_TYPE_YUVI420); - } - genTextureWithI420(width, height, dataY, strideY, dataU, strideU, dataV, strideV, ts); }); diff --git a/src/third_party/vnn/include/vnn_common.h b/src/third_party/vnn/include/vnn_common.h deleted file mode 100644 index cc9b1710..00000000 --- a/src/third_party/vnn/include/vnn_common.h +++ /dev/null @@ -1,297 +0,0 @@ -//------------------------------------------------------------------------------------------------------- -// Copyright (c) 2021 Guangzhou Joyy Information Technology Co., Ltd. All rights reserved. -// Licensed under the MIT license. See license.txt file in the project root for full license information. -//------------------------------------------------------------------------------------------------------- -#ifndef _VNN_COMMON_H_ -#define _VNN_COMMON_H_ -#include "vnn_define.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/* ------------------------------------------- */ -/* Some base interface definition. */ - -typedef enum _VNN_PIX_FMT { - VNN_PIX_FMT_UNKNOW, /* Unknow pixel format, as a cube */ - VNN_PIX_FMT_YUVI420, /* YUV 4:2:0 12bpp ( 3 planes, the first is Y, the second is U, the third is V */ - VNN_PIX_FMT_YUV420F, /* YUV 4:2:0 12bpp ( 2 planes, ios FullRange, the first is Y - luminance channel, the other channel was UV alternate permutation.) */ - VNN_PIX_FMT_YUV420V, /* YUV 4:2:0 12bpp ( 2 planes, ios VideoRange, the first is Y - luminance channel, the other channel was UV alternate permutation.) */ - VNN_PIX_FMT_YUV420P_888_SKIP1, /* YUV 4:2:0 12bpp ( 3 planes, android Camera2, the first is Y - luminance channel, the second is U channel with skip 1, the third is V channel with skip 1.) */ - VNN_PIX_FMT_BGRA8888, /* BGRA 8:8:8:8 32bpp ( 4 channel, 8x4=32bit BGRA pixel ) */ - VNN_PIX_FMT_RGBA8888, /* RGBA 8:8:8:8 32bpp ( 4 channel, 8x4=32bit RGBA pixel ) */ - VNN_PIX_FMT_GRAY8, /* Y 1 8bpp ( 1 channel, 8bit luminance pixel ) */ - VNN_PIX_FMT_NV12, /* YUV 4:2:0 12bpp ( 2 planes, the first is Y - luminance channel, the other channel was UV alternate permutation ) */ - VNN_PIX_FMT_NV21, /* YUV 4:2:0 12bpp ( 2 planes, andoird default, the first is Y - luminance channel, the other channel was VU alternate permutation ) */ - VNN_PIX_FMT_BGR888, /* BGR 8:8:8 24bpp ( 3 channel, 8x3=24bit BGR pixel ) */ - VNN_PIX_FMT_RGB888, /* RGB 8:8:8 24bpp ( 3 channel, 8x3=24bit RGB pixel ) */ - VNN_PIX_FMT_GRAY32, /* Y 1 8bpp ( 1 channel, 32bit float luminance pixel ) */ - VNN_PIX_FMT_CHW_U8, /* As a cube , data layerout was chw, data type was unsigned char */ - VNN_PIX_FMT_CHW_F32, /* As a cube , data layerout was chw, data type was float 32 */ - VNN_PIX_FMT_ERROR /* Error pixel format */ -} VNN_PIX_FMT; - -typedef enum _VNN_ORIENT_FMT { - /* - Like value as VNN_ORIENT_FMT_ROTATE_90L|VNN_ORIENT_FMT_FLIP_V, means fristly anticlockwise rotate 90 degree, and then flip vertically; - So, the priority rotation is higher then flip. - */ - VNN_ORIENT_FMT_DEFAULT = 0x00000000, /* Unknow orientated format, as a default option, no rotate and no flip */ - VNN_ORIENT_FMT_ROTATE_90L = 0x00000001, /* anticlockwise rotate 90 degree (clockwise rotate 270 degree) */ - VNN_ORIENT_FMT_ROTATE_90R = 0x00000002, /* clockwise rotate 90 degree */ - VNN_ORIENT_FMT_ROTATE_180 = 0x00000004, /* rotate 180 degree */ - VNN_ORIENT_FMT_FLIP_V = 0x00000008, /* flip vertically */ - VNN_ORIENT_FMT_FLIP_H = 0x00000010, /* flip horizontally */ - VNN_ORIENT_FMT_ROTATE_360 = 0x00000020, /* android case: post carma orientation = 270 degree */ - VNN_ORIENT_FMT_ROTATE_180L = 0x00000040, /* android case: post carma orientation = 270 degree */ - VNN_ORIENT_FMT_ERROR = 0xFFFFFFFF, /* ERROR */ -} VNN_ORIENT_FMT; - -typedef enum _VNN_MODE_FMT { - VNN_MODE_FMT_VIDEO = 0x00000000, - VNN_MODE_FMT_PICTURE = 0x00000001, - VNN_MODE_FMT_DEFAULT = 0x00000000, -} VNN_MODE_FMT; - -typedef struct _VNN_Texture { - VNNUInt32 textureID; /* OpenGL texture id.*/ - VNNUInt32 target; /* OpenGL texture target, e.g. GL_TEXTURE_2D.*/ - VNNUInt32 format; /* OpenGL texture format, e.g. GL_RGBA.*/ - VNNInt32 width; /* OpenGL texture width.*/ - VNNInt32 height; /* OpenGL texture height.*/ -} VNN_Texture; - -typedef struct _VNN_Rect2D { - VNNFloat32 x0; /* left */ - VNNFloat32 y0; /* top */ - VNNFloat32 x1; /* right */ - VNNFloat32 y1; /* bottom */ -} VNN_Rect2D; - -typedef struct _VNN_Point2D { - VNNFloat32 x; - VNNFloat32 y; -} VNN_Point2D; - -typedef struct _VNN_Image { - VNN_ORIENT_FMT ori_fmt; /* orientation format enum of img*/ - VNN_PIX_FMT pix_fmt; /* pixel format enum of img */ - VNN_MODE_FMT mode_fmt; /* mode format enum of detection, can use video/picture/default */ - VNNInt32 width; /* width of img */ - VNNInt32 height; /* height of img */ - VNNInt32 channels; /* channels of img */ - VNN_Rect2D rect; /* rect record the place in target image where this image should be put into, when used as output this member may help.*/ - VNNVoidPtr data; /* if is cpu-backend, data means the raw data of img, default type is "unsigned char". But data is NULL in gpu-backend. */ - VNNVoidPtr texture; /* if is cpu-backend, texture is NULL. But if is gpu-backend, texture may be a VNN_Texture(android|ios) or a CVPixelbuffer(ios). */ -} VNN_Image; - - - -/* ------------------------------------------- */ - -/* ------------------------------------------- */ -/* Some definition of Object Count. */ -typedef struct _VNN_ObjectCountDataArr { - VNNInt32 count; - VNN_Rect2D * objRectArr; -} VNN_ObjCountDataArr; -VNN_API void VNN_ObjCountDataArr_Free(VNN_ObjCountDataArr *); -/* ------------------------------------------- */ - - - -/* ------------------------------------------- */ -/* Some definition of Frame mask */ -//typedef struct _VNN_FrameInstanceMaskData { -// VNNInt32 width; -// VNNInt32 height; -// VNN_Rect2D maskRect; -// VNNVoidPtr data; -//}VNN_FrameInstanceMaskData; - - -/* ------------------------------------------- */ -/* Some Face definition. */ - -#define VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM 278 -#define VNN_FRAMEDATAARR_MAX_FACES_NUM 5 - -typedef struct _VNN_FaceFrameData { - VNNFloat32 faceScore; - VNN_Rect2D faceRect; - VNNUInt32 inputWidth; - VNNUInt32 inputHeight; - VNNUInt32 faceLandmarksNum; - VNN_Point2D faceLandmarks[VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM]; - VNNFloat32 faceLandmarkScores[VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM]; - /* Face Attributes */ - VNNBool ifCloseLeftEye; - VNNBool ifCloseRightEye; - VNNBool ifBlinkLeftEye; - VNNBool ifBlinkRightEye; - VNNBool ifOpenMouth; - VNNBool ifShakeHead; - VNNBool ifNodHead; - VNNBool ifOpenCloseMouth; - VNNFloat32 smileScore; - VNNFloat32 faceYaw; -} VNN_FaceFrameData; - -typedef struct _VNN_FaceFrameDataArr { - VNNUInt32 facesNum; - VNN_FaceFrameData facesArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -} VNN_FaceFrameDataArr; - -//typedef struct _VNN_FaceMaskDataArr { -// VNNUInt32 facesNum; -// VNN_FrameInstanceMaskData faceMaskArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -//} VNN_FaceMaskDataArr; - -#define VNN_FACE_APPLY_VIDEO_MODE 0 -#define VNN_FACE_APPLY_PICTURE_MODE 1 - -/* ------------------------------------------- */ - - -/* ------------------------------------------- */ -/* Some Gesture definition. */ - -#define VNN_FRAMEDATAARR_MAX_GESTURE_NUM 15 - -typedef enum _VNN_GestureType { - VNN_GestureType_Unknow = 0x00, - VNN_GestureType_V = 0x01, // Pinyin: jian dao shou - VNN_GestureType_ThumbUp = 0x02, // Pinyin: dian zan - VNN_GestureType_OneHandHeart = 0x03, // Pinyin: dan shou bi xin - VNN_GestureType_SpiderMan = 0x04, // Pinyin: zhi zhu xia - VNN_GestureType_Lift = 0x05, // Pinyin: tuo ju - VNN_GestureType_666 = 0x06, // 6 6 6 - VNN_GestureType_TwoHandHeart = 0x07, // Pinyin: shuang shou bi xin - VNN_GestureType_PalmTogether = 0x08, // Pinyin: bao quan - VNN_GestureType_PalmOpen = 0x09, // Pinyin: zhang kai shou zhang - VNN_GestureType_ZuoYi = 0x0a, // Pinyin: zuo yi | bao quan - VNN_GestureType_OK = 0x0b, // OK - VNN_GestureType_ERROR = 0xff, -} VNN_GestureType; - -typedef struct _VNN_GestureFrameData { - VNN_GestureType type; /* Gesture type */ - VNN_Rect2D rect; /* Gesture rect, left-top-right-bottom */ - VNNFloat32 score; /* Gesture confidence socre */ -} VNN_GestureFrameData; - -typedef struct _VNN_GestureFrameDataArr { - VNNUInt32 gestureNum; - VNN_GestureFrameData gestureArr[VNN_FRAMEDATAARR_MAX_GESTURE_NUM]; -} VNN_GestureFrameDataArr; - -/* ------------------------------------------- */ - - -/* ------------------------------------------- */ -/* Some struct definitions for pose sdk. */ - -#define VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM 22 -#define VNN_FRAMEDATAARR_MAX_BODYS_NUM 5 -typedef enum _VNN_BodyResultDesc { - VNN_BodyResultDesc_Normal = 0, - VNN_BodyResultDesc_NoPerson = 1, // "没有人" - VNN_BodyResultDesc_MorethanOnePerson = 2, // "注意:仅支持1人" - VNN_BodyResultDesc_NoKneeSeen = 3, // "看不到膝盖,请退后" - VNN_BodyResultDesc_NoFootSeen = 4, // "看不到脚部,请退后" - VNN_BodyResultDesc_NoHipSeen = 5 // "看不到腰部,请退后" -}VNN_BodyResultDesc; -typedef struct _VNN_BodyFrameData { - VNNFloat32 bodyScore; - VNN_Rect2D bodyRect; - VNNUInt32 bodyLandmarksNum; - VNN_Point2D bodyLandmarks[VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM]; - VNNFloat32 bodyLandmarkScores[VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM]; - VNNUInt32 isWriggleWaist; - VNNUInt32 isCrouch; - VNNUInt32 isRun; - VNN_BodyResultDesc bodyResultDesc; -} VNN_BodyFrameData; - -typedef struct _VNN_BodyFrameDataArr { - VNNUInt32 bodiesNum; - VNN_BodyFrameData bodiesArr[VNN_FRAMEDATAARR_MAX_BODYS_NUM]; -} VNN_BodyFrameDataArr; - -/* ------------------------------------------- */ - -/* ---------------------------------------------------------- */ -/* Some struct definitions for hand reconstruction sdk. */ - -#define VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS 10 -#define VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS 33 -#define VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS 3 - - -typedef struct _VNN_HandReconstructionFrameData { - VNNFloat32 rightHandShapeCoefs[VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 rightHandPoseCoefs[VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 rightHandCamCoefs[VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS]; - VNNFloat32 leftHandShapeCoefs[VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 leftHandPoseCoefs[VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 leftHandCamCoefs[VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS]; -} VNN_HandReconstructionFrameData; - -/* ---------------------------------------------------------- */ - - -/* ---------------------------------------------------------- */ -/* Some struct definitions for body reconstruction sdk. */ - -#define VNN_BODYRECONSTRUCTION_POSE_COEF_DIMS 207 -#define VNN_BODYRECONSTRUCTION_SHAPE_COEF_DIMS 10 -#define VNN_BODYRECONSTRUCTION_GLOBAL_ROTATE_COEF_DIMS 9 -#define VNN_BODYLECONSTRUCTION_CAM_OFFSET_COEF_DIMS 3 - - -typedef struct _VNN_BodyReconstructionFrameData { - VNNFloat32 bodyPoseCoefs[VNN_BODYRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 bodyShapeCoefs[VNN_BODYRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 bodyGlobalRotateCoefs[VNN_BODYRECONSTRUCTION_GLOBAL_ROTATE_COEF_DIMS]; - VNNFloat32 bodyCamOffsetCoefs[VNN_BODYLECONSTRUCTION_CAM_OFFSET_COEF_DIMS]; -} VNN_BodyReconstructionFrameData; - -/* ---------------------------------------------------------- */ - -/* ------------------------------------------- */ -/* Some definition of Classification. */ -#define VNN_CLASSIFICATION_ACC_TOP_N 5 -#define VNN_MAX_MULTI_CLASSFICATION_NUM 10 -#define VNN_MAX_LABEL_LENGTH 100 -typedef struct _VNN_Classification_Accuracy_Top_N { - VNNUInt32 categories[VNN_CLASSIFICATION_ACC_TOP_N]; - char labels[VNN_CLASSIFICATION_ACC_TOP_N][VNN_MAX_LABEL_LENGTH]; - VNNFloat32 probabilities[VNN_CLASSIFICATION_ACC_TOP_N]; - VNNInt32 usedTopN; -} VNN_ClsTopNAcc; - -typedef struct _VNN_ClassificationTopNDataArr { - VNNUInt32 numCls; - VNN_ClsTopNAcc clsArr[VNN_MAX_MULTI_CLASSFICATION_NUM]; - -} VNN_ClsTopNAccArr; - -typedef struct _VNN_MultiClassificationTopNDataArr { - VNNUInt32 numOut; - VNN_ClsTopNAccArr multiClsArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; //used for multi face - -} VNN_MultiClsTopNAccArr; -/* ------------------------------------------- */ - -typedef struct _VNN_ImageArr { - VNNInt32 imgsNum; - VNN_Image imgsArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -}VNN_ImageArr; - -#ifdef __cplusplus -} -#endif - -#endif // _VNN_COMMON_H_ diff --git a/src/third_party/vnn/include/vnn_define.h b/src/third_party/vnn/include/vnn_define.h deleted file mode 100644 index 3e4798bc..00000000 --- a/src/third_party/vnn/include/vnn_define.h +++ /dev/null @@ -1,100 +0,0 @@ -//------------------------------------------------------------------------------------------------------- -// Copyright (c) 2021 Guangzhou Joyy Information Technology Co., Ltd. All rights reserved. -// Licensed under the MIT license. See license.txt file in the project root for full license information. -//------------------------------------------------------------------------------------------------------- -#ifndef VNN_DEFINE_H -#define VNN_DEFINE_H -#define VNN_NULL 0 -#define VNN_TRUE 1 -#define VNN_FALSE 0 - - -/* ------------------------------------------- */ -/* Base type definition */ - -#if defined(VNN_WIN32) || defined(_WIN32) || defined(WIN32) -typedef __int8 VNNInt8; -typedef __int16 VNNInt16; -typedef __int32 VNNInt32; -typedef __int64 VNNInt64; -typedef unsigned __int8 VNNUInt8; -typedef unsigned __int16 VNNUInt16; -typedef unsigned __int32 VNNUInt32; -typedef unsigned __int64 VNNUInt64; -#ifdef _WIN64 -typedef unsigned __int64 VNNUIntPtr; -typedef __int64 VNNIntPtr; -#else /* _WIN64 */ -typedef __w64 unsigned int VNNUIntPtr; -typedef __w64 int VNNIntPtr; -#endif /* _WIN64 */ -#else -#include -typedef int8_t VNNInt8; -typedef int16_t VNNInt16; -typedef int32_t VNNInt32; -typedef int64_t VNNInt64; -typedef uint8_t VNNUInt8; -typedef uint16_t VNNUInt16; -typedef uint32_t VNNUInt32; -typedef uint64_t VNNUInt64; -typedef uintptr_t VNNUIntPtr; -typedef intptr_t VNNIntPtr; -typedef void VNNVoid; -#endif -typedef void* VNNVoidPtr; -typedef int VNNBool; -typedef char VNNPath[1024]; -typedef char VNNText[1024]; -typedef char VNNName[256]; -typedef char VNNUUID[64]; -typedef VNNUInt32 VNNHandle; -typedef float VNNFloat32; -typedef double VNNFloat64; - -/* ------------------------------------------- */ - -/* ------------------------------------------- */ -/* Global API result definition */ - -typedef enum _VNN_Result { - VNN_Result_Success = 0, - VNN_Result_Failed = -1, - VNN_Result_InvalidModel = -2, - VNN_Result_InvalidFrameHandler = -3, - VNN_Result_InvalidInput = -4, - VNN_Result_InvalidParamName = -5, - VNN_Result_InvalidParamValue = -6, - VNN_Result_BadMalloc = -7, - VNN_Result_NotImplemented = -8, - VNN_Result_InvalidSDKVersion = -9, - VNN_Result_UnsurportedFormat = -10, - VNN_Result_Failed_GLVersion = -11, - VNN_Result_Failed_GLEnvironment = -12, -} VNN_Result; - -/* ------------------------------------------- */ -/* Global Log level definition */ -typedef enum _VNN_LogLevel { - VNN_LOG_LEVEL_VERBOSE = 0x00000001, // 0b 0...00000001 - VNN_LOG_LEVEL_DEBUG = 0x00000002, // 0b 0...00000010 - VNN_LOG_LEVEL_INFO = 0x00000004, // 0b 0...00000100 - VNN_LOG_LEVEL_WARN = 0x00000008, // 0b 0...00001000 - VNN_LOG_LEVEL_ERROR = 0x00000010, // 0b 0...00010000 - VNN_LOG_LEVEL_ALL = 0x000000ff, // 0b 0...11111111 (Easy setting to enable all log-level informations) -} VNN_LogLevel; - -// New macro definition -#if defined(_WIN32) || defined(WIN32) -# ifdef VNN_LIB -# define VNN_API __declspec(dllexport) -# else -# define VNN_API -# endif -#elif defined(ANDROID) || defined(__APPLE__) -# define VNN_API __attribute__ ((visibility("default"))) -#else -# define VNN_API -#endif - -#endif //VNN_DEFINE_H diff --git a/src/third_party/vnn/include/vnn_face.h b/src/third_party/vnn/include/vnn_face.h deleted file mode 100644 index 771c1051..00000000 --- a/src/third_party/vnn/include/vnn_face.h +++ /dev/null @@ -1,32 +0,0 @@ -//------------------------------------------------------------------------------------------------------- -// Copyright (c) 2021 Guangzhou Joyy Information Technology Co., Ltd. All rights reserved. -// Licensed under the MIT license. See license.txt file in the project root for full license information. -//------------------------------------------------------------------------------------------------------- -#ifndef VNN_FACE_H -#define VNN_FACE_H - -#include "vnn_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -VNN_API VNN_Result VNN_Create_Face( VNNHandle * handle, const int argc, const void * argv[] ); - -VNN_API VNN_Result VNN_Destroy_Face( VNNHandle* handle ); - -VNN_API VNN_Result VNN_Apply_Face_CPU( VNNHandle handle, const void * input, void * output ); - -VNN_API VNN_Result VNN_Apply_Face_GPU( VNNHandle handle, const void * input, void * output ); - -VNN_API VNN_Result VNN_Set_Face_Attr( VNNHandle handle, const char * name, const void * value ); - -VNN_API VNN_Result VNN_Get_Face_Attr( VNNHandle handle, const char * name, void * value ); - - -#ifdef __cplusplus -} -#endif - -#endif /* VNN_FACE_H */ - diff --git a/src/third_party/vnn/include/vnn_kit.h b/src/third_party/vnn/include/vnn_kit.h deleted file mode 100644 index 9bb40c50..00000000 --- a/src/third_party/vnn/include/vnn_kit.h +++ /dev/null @@ -1,78 +0,0 @@ -//------------------------------------------------------------------------------------------------------- -// Copyright (c) 2021 Guangzhou Joyy Information Technology Co., Ltd. All rights reserved. -// Licensed under the MIT license. See license.txt file in the project root for full license information. -//------------------------------------------------------------------------------------------------------- -#ifndef VNN_KIT_H -#define VNN_KIT_H - -#include "vnn_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -VNN_API VNN_Result VNN_GetKitVersion(VNNUInt32 &major_ver, VNNUInt32 &minor_ver); - -VNN_API VNN_Result VNN_SetLogTag(const char *i_tag); - -typedef int (*VNNLOGCALLBACK) (const char* i_log); -VNN_API VNN_Result VNN_SetLogCallback(VNNLOGCALLBACK i_callback); - -VNN_API VNN_Result VNN_SetLogLevel(VNNUInt32 i_level); - -VNN_API VNN_Result VNN_GetLogLevel(VNNUInt32* o_level); - -VNN_API VNN_Result VNN_Init(VNNHandle* i_contextID); - -VNN_API VNN_Result VNN_Uninit(VNNHandle i_contextID); - -VNN_API VNN_Result VNN_CheckGLVersion(); - -VNN_API VNN_Result VNN_Get_VNNImage_Bytes(const void * i_img, unsigned int * o_bytes); - -VNN_API VNN_Result VNN_Create_VNNImage_From_PixelBuffer(const void * i_cvpixelbuffer, void * o_vnimage, const bool i_gpu_only); - -VNN_API VNN_Result VNN_Free_VNNImage(const void * i_cvpixelbuffer, void * io_vnimage, const bool i_gpu_only); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_Rotate(VNN_FaceFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_Mirror(VNN_FaceFrameDataArr* data); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_FlipV(VNN_FaceFrameDataArr* data); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_Rotate(VNN_GestureFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_Mirror(VNN_GestureFrameDataArr* data); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_FlipV(VNN_GestureFrameDataArr* data); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_Rotate(VNN_ObjCountDataArr* data, int rotate); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_Mirror(VNN_ObjCountDataArr* data); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_FlipV(VNN_ObjCountDataArr* data); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_Rotate(VNN_BodyFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_Mirror(VNN_BodyFrameDataArr* data); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_FlipV(VNN_BodyFrameDataArr* data); - -VNN_API VNN_Result VNN_Rect2D_Result_Rotate(VNN_Rect2D* data, int rotate); - -VNN_API VNN_Result VNN_Rect2D_Result_Mirror(VNN_Rect2D* data); - -VNN_API VNN_Result VNN_Rect2D_Result_FlipV(VNN_Rect2D* data); - -#ifdef _OPENMP -VNN_API VNN_Result VNN_Get_Num_Procs(int* num_procs); -VNN_API VNN_Result VNN_Set_NUM_Threads(int num_threads); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif // VNN_KIT_H - diff --git a/src/third_party/vnn/libs/android/arm64-v8a/libvnn_core.so b/src/third_party/vnn/libs/android/arm64-v8a/libvnn_core.so deleted file mode 100644 index 6b9c3566..00000000 Binary files a/src/third_party/vnn/libs/android/arm64-v8a/libvnn_core.so and /dev/null differ diff --git a/src/third_party/vnn/libs/android/arm64-v8a/libvnn_face.so b/src/third_party/vnn/libs/android/arm64-v8a/libvnn_face.so deleted file mode 100644 index 5380f5b9..00000000 Binary files a/src/third_party/vnn/libs/android/arm64-v8a/libvnn_face.so and /dev/null differ diff --git a/src/third_party/vnn/libs/android/arm64-v8a/libvnn_kit.so b/src/third_party/vnn/libs/android/arm64-v8a/libvnn_kit.so deleted file mode 100644 index 87bd4689..00000000 Binary files a/src/third_party/vnn/libs/android/arm64-v8a/libvnn_kit.so and /dev/null differ diff --git a/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_core.so b/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_core.so deleted file mode 100644 index ca9cec64..00000000 Binary files a/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_core.so and /dev/null differ diff --git a/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_face.so b/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_face.so deleted file mode 100644 index 39510f47..00000000 Binary files a/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_face.so and /dev/null differ diff --git a/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_kit.so b/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_kit.so deleted file mode 100644 index 9afd9191..00000000 Binary files a/src/third_party/vnn/libs/android/armeabi-v7a/libvnn_kit.so and /dev/null differ diff --git a/src/third_party/vnn/libs/ios/vnn_core_ios.framework/Headers/vnn_define.h b/src/third_party/vnn/libs/ios/vnn_core_ios.framework/Headers/vnn_define.h deleted file mode 100644 index 557aef8e..00000000 --- a/src/third_party/vnn/libs/ios/vnn_core_ios.framework/Headers/vnn_define.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef VNN_DEFINE_H -#define VNN_DEFINE_H -#define VNN_NULL 0 -#define VNN_TRUE 1 -#define VNN_FALSE 0 - - -/* ------------------------------------------- */ -/* Base type definition */ - -#if defined(VNN_WIN32) || defined(_WIN32) || defined(WIN32) -typedef __int8 VNNInt8; -typedef __int16 VNNInt16; -typedef __int32 VNNInt32; -typedef __int64 VNNInt64; -typedef unsigned __int8 VNNUInt8; -typedef unsigned __int16 VNNUInt16; -typedef unsigned __int32 VNNUInt32; -typedef unsigned __int64 VNNUInt64; -#ifdef _WIN64 -typedef unsigned __int64 VNNUIntPtr; -typedef __int64 VNNIntPtr; -#else /* _WIN64 */ -typedef __w64 unsigned int VNNUIntPtr; -typedef __w64 int VNNIntPtr; -#endif /* _WIN64 */ -#else -#include -typedef int8_t VNNInt8; -typedef int16_t VNNInt16; -typedef int32_t VNNInt32; -typedef int64_t VNNInt64; -typedef uint8_t VNNUInt8; -typedef uint16_t VNNUInt16; -typedef uint32_t VNNUInt32; -typedef uint64_t VNNUInt64; -typedef uintptr_t VNNUIntPtr; -typedef intptr_t VNNIntPtr; -typedef void VNNVoid; -#endif -typedef void* VNNVoidPtr; -typedef int VNNBool; -typedef char VNNPath[1024]; -typedef char VNNText[1024]; -typedef char VNNName[256]; -typedef char VNNUUID[64]; -typedef VNNUInt32 VNNHandle; -typedef float VNNFloat32; -typedef double VNNFloat64; - -/* ------------------------------------------- */ - -/* ------------------------------------------- */ -/* Global API result definition */ - -typedef enum _VNN_Result { - VNN_Result_Success = 0, - VNN_Result_Failed = -1, - VNN_Result_InvalidModel = -2, - VNN_Result_InvalidFrameHandler = -3, - VNN_Result_InvalidInput = -4, - VNN_Result_InvalidParamName = -5, - VNN_Result_InvalidParamValue = -6, - VNN_Result_BadMalloc = -7, - VNN_Result_NotImplemented = -8, - VNN_Result_FileOpenFailed = -9, - VNN_Result_UnsurportedFormat = -10, - VNN_Result_Failed_GLVersion = -11, - VNN_Result_Failed_GLEnvironment = -12, -} VNN_Result; - -/* ------------------------------------------- */ -/* Global Log level definition */ -typedef enum _VNN_LogLevel { - VNN_LOG_LEVEL_VERBOSE = 0x00000001, // 0b 0...00000001 - VNN_LOG_LEVEL_DEBUG = 0x00000002, // 0b 0...00000010 - VNN_LOG_LEVEL_INFO = 0x00000004, // 0b 0...00000100 - VNN_LOG_LEVEL_WARN = 0x00000008, // 0b 0...00001000 - VNN_LOG_LEVEL_ERROR = 0x00000010, // 0b 0...00010000 - VNN_LOG_LEVEL_ALL = 0x000000ff, // 0b 0...11111111 (Easy setting to enable all log-level informations) -} VNN_LogLevel; - -// New macro definition -#if defined(_WIN32) || defined(WIN32) -# ifdef VNN_LIB -# define VNN_API __declspec(dllexport) -# else -# define VNN_API -# endif -#elif defined(ANDROID) || defined(__APPLE__) -# define VNN_API __attribute__ ((visibility("default"))) -#else -# define VNN_API -#endif -VNN_API VNN_Result VNN_Get_Core_Version(VNNUInt32 &major_ver, VNNUInt32 &minor_ver); -#endif //VNN_DEFINE_H diff --git a/src/third_party/vnn/libs/ios/vnn_core_ios.framework/Info.plist b/src/third_party/vnn/libs/ios/vnn_core_ios.framework/Info.plist deleted file mode 100644 index 50e7fcfe..00000000 Binary files a/src/third_party/vnn/libs/ios/vnn_core_ios.framework/Info.plist and /dev/null differ diff --git a/src/third_party/vnn/libs/ios/vnn_core_ios.framework/vnn_core_ios b/src/third_party/vnn/libs/ios/vnn_core_ios.framework/vnn_core_ios deleted file mode 100644 index b364746f..00000000 Binary files a/src/third_party/vnn/libs/ios/vnn_core_ios.framework/vnn_core_ios and /dev/null differ diff --git a/src/third_party/vnn/libs/ios/vnn_face_ios.framework/Headers/vnn_face.h b/src/third_party/vnn/libs/ios/vnn_face_ios.framework/Headers/vnn_face.h deleted file mode 100644 index 2e6e8e0e..00000000 --- a/src/third_party/vnn/libs/ios/vnn_face_ios.framework/Headers/vnn_face.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef VNN_FACE_H -#define VNN_FACE_H - -#include "vnn_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -VNN_API VNN_Result VNN_Create_Face( VNNHandle * handle, const int argc, const void * argv[] ); - -VNN_API VNN_Result VNN_Destroy_Face(VNNHandle* handle ); - -VNN_API VNN_Result VNN_Apply_Face_CPU( VNNHandle handle, const void * input, void * output ); - -VNN_API VNN_Result VNN_Apply_Face_GPU( VNNHandle handle, const void * input, void * output ); - -VNN_API VNN_Result VNN_Set_Face_Attr( VNNHandle handle, const char * name, const void * value ); - -VNN_API VNN_Result VNN_Get_Face_Attr( VNNHandle handle, const char * name, void * value ); - -#ifdef __cplusplus -} -#endif - -#endif /* VNN_FACE_H */ - diff --git a/src/third_party/vnn/libs/ios/vnn_face_ios.framework/Info.plist b/src/third_party/vnn/libs/ios/vnn_face_ios.framework/Info.plist deleted file mode 100644 index 5cf98463..00000000 Binary files a/src/third_party/vnn/libs/ios/vnn_face_ios.framework/Info.plist and /dev/null differ diff --git a/src/third_party/vnn/libs/ios/vnn_face_ios.framework/vnn_face_ios b/src/third_party/vnn/libs/ios/vnn_face_ios.framework/vnn_face_ios deleted file mode 100644 index 49031600..00000000 Binary files a/src/third_party/vnn/libs/ios/vnn_face_ios.framework/vnn_face_ios and /dev/null differ diff --git a/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Headers/vnn_common.h b/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Headers/vnn_common.h deleted file mode 100644 index a33f46c0..00000000 --- a/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Headers/vnn_common.h +++ /dev/null @@ -1,293 +0,0 @@ -#ifndef _VNN_COMMON_H_ -#define _VNN_COMMON_H_ -#include "vnn_define.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/* ------------------------------------------- */ -/* Some base interface definition. */ - -typedef enum _VNN_PIX_FMT { - VNN_PIX_FMT_UNKNOW, /* Unknow pixel format, as a cube */ - VNN_PIX_FMT_YUVI420, /* YUV 4:2:0 12bpp ( 3 planes, the first is Y, the second is U, the third is V */ - VNN_PIX_FMT_YUV420F, /* YUV 4:2:0 12bpp ( 2 planes, ios FullRange, the first is Y - luminance channel, the other channel was UV alternate permutation.) */ - VNN_PIX_FMT_YUV420V, /* YUV 4:2:0 12bpp ( 2 planes, ios VideoRange, the first is Y - luminance channel, the other channel was UV alternate permutation.) */ - VNN_PIX_FMT_YUV420P_888_SKIP1, /* YUV 4:2:0 12bpp ( 3 planes, android Camera2, the first is Y - luminance channel, the second is U channel with skip 1, the third is V channel with skip 1.) */ - VNN_PIX_FMT_BGRA8888, /* BGRA 8:8:8:8 32bpp ( 4 channel, 8x4=32bit BGRA pixel ) */ - VNN_PIX_FMT_RGBA8888, /* RGBA 8:8:8:8 32bpp ( 4 channel, 8x4=32bit RGBA pixel ) */ - VNN_PIX_FMT_GRAY8, /* Y 1 8bpp ( 1 channel, 8bit luminance pixel ) */ - VNN_PIX_FMT_NV12, /* YUV 4:2:0 12bpp ( 2 planes, the first is Y - luminance channel, the other channel was UV alternate permutation ) */ - VNN_PIX_FMT_NV21, /* YUV 4:2:0 12bpp ( 2 planes, andoird default, the first is Y - luminance channel, the other channel was VU alternate permutation ) */ - VNN_PIX_FMT_BGR888, /* BGR 8:8:8 24bpp ( 3 channel, 8x3=24bit BGR pixel ) */ - VNN_PIX_FMT_RGB888, /* RGB 8:8:8 24bpp ( 3 channel, 8x3=24bit RGB pixel ) */ - VNN_PIX_FMT_GRAY32, /* Y 1 8bpp ( 1 channel, 32bit float luminance pixel ) */ - VNN_PIX_FMT_CHW_U8, /* As a cube , data layerout was chw, data type was unsigned char */ - VNN_PIX_FMT_CHW_F32, /* As a cube , data layerout was chw, data type was float 32 */ - VNN_PIX_FMT_ERROR /* Error pixel format */ -} VNN_PIX_FMT; - -typedef enum _VNN_ORIENT_FMT { - /* - Like value as VNN_ORIENT_FMT_ROTATE_90L|VNN_ORIENT_FMT_FLIP_V, means fristly anticlockwise rotate 90 degree, and then flip vertically; - So, the priority rotation is higher then flip. - */ - VNN_ORIENT_FMT_DEFAULT = 0x00000000, /* Unknow orientated format, as a default option, no rotate and no flip */ - VNN_ORIENT_FMT_ROTATE_90L = 0x00000001, /* anticlockwise rotate 90 degree (clockwise rotate 270 degree) */ - VNN_ORIENT_FMT_ROTATE_90R = 0x00000002, /* clockwise rotate 90 degree */ - VNN_ORIENT_FMT_ROTATE_180 = 0x00000004, /* rotate 180 degree */ - VNN_ORIENT_FMT_FLIP_V = 0x00000008, /* flip vertically */ - VNN_ORIENT_FMT_FLIP_H = 0x00000010, /* flip horizontally */ - VNN_ORIENT_FMT_ROTATE_360 = 0x00000020, /* android case: post carma orientation = 270 degree */ - VNN_ORIENT_FMT_ROTATE_180L = 0x00000040, /* android case: post carma orientation = 270 degree */ - VNN_ORIENT_FMT_ERROR = 0xFFFFFFFF, /* ERROR */ -} VNN_ORIENT_FMT; - -typedef enum _VNN_MODE_FMT { - VNN_MODE_FMT_VIDEO = 0x00000000, - VNN_MODE_FMT_PICTURE = 0x00000001, - VNN_MODE_FMT_DEFAULT = 0x00000000, -} VNN_MODE_FMT; - -typedef struct _VNN_Texture { - VNNUInt32 textureID; /* OpenGL texture id.*/ - VNNUInt32 target; /* OpenGL texture target, e.g. GL_TEXTURE_2D.*/ - VNNUInt32 format; /* OpenGL texture format, e.g. GL_RGBA.*/ - VNNInt32 width; /* OpenGL texture width.*/ - VNNInt32 height; /* OpenGL texture height.*/ -} VNN_Texture; - -typedef struct _VNN_Rect2D { - VNNFloat32 x0; /* left */ - VNNFloat32 y0; /* top */ - VNNFloat32 x1; /* right */ - VNNFloat32 y1; /* bottom */ -} VNN_Rect2D; - -typedef struct _VNN_Point2D { - VNNFloat32 x; - VNNFloat32 y; -} VNN_Point2D; - -typedef struct _VNN_Image { - VNN_ORIENT_FMT ori_fmt; /* orientation format enum of img*/ - VNN_PIX_FMT pix_fmt; /* pixel format enum of img */ - VNN_MODE_FMT mode_fmt; /* mode format enum of detection, can use video/picture/default */ - VNNInt32 width; /* width of img */ - VNNInt32 height; /* height of img */ - VNNInt32 channels; /* channels of img */ - VNN_Rect2D rect; /* rect record the place in target image where this image should be put into, when used as output this member may help.*/ - VNNVoidPtr data; /* if is cpu-backend, data means the raw data of img, default type is "unsigned char". But data is NULL in gpu-backend. */ - VNNVoidPtr texture; /* if is cpu-backend, texture is NULL. But if is gpu-backend, texture may be a VNN_Texture(android|ios) or a CVPixelbuffer(ios). */ -} VNN_Image; - - - -/* ------------------------------------------- */ - -/* ------------------------------------------- */ -/* Some definition of Object Count. */ -typedef struct _VNN_ObjectCountDataArr { - VNNInt32 count; - VNN_Rect2D * objRectArr; -} VNN_ObjCountDataArr; -VNN_API void VNN_ObjCountDataArr_Free(VNN_ObjCountDataArr *); -/* ------------------------------------------- */ - - - -/* ------------------------------------------- */ -/* Some definition of Frame mask */ -//typedef struct _VNN_FrameInstanceMaskData { -// VNNInt32 width; -// VNNInt32 height; -// VNN_Rect2D maskRect; -// VNNVoidPtr data; -//}VNN_FrameInstanceMaskData; - - -/* ------------------------------------------- */ -/* Some Face definition. */ - -#define VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM 278 -#define VNN_FRAMEDATAARR_MAX_FACES_NUM 5 - -typedef struct _VNN_FaceFrameData { - VNNFloat32 faceScore; - VNN_Rect2D faceRect; - VNNUInt32 inputWidth; - VNNUInt32 inputHeight; - VNNUInt32 faceLandmarksNum; - VNN_Point2D faceLandmarks[VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM]; - VNNFloat32 faceLandmarkScores[VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM]; - /* Face Attributes */ - VNNBool ifCloseLeftEye; - VNNBool ifCloseRightEye; - VNNBool ifBlinkLeftEye; - VNNBool ifBlinkRightEye; - VNNBool ifOpenMouth; - VNNBool ifShakeHead; - VNNBool ifNodHead; - VNNBool ifOpenCloseMouth; - VNNFloat32 smileScore; - VNNFloat32 faceYaw; -} VNN_FaceFrameData; - -typedef struct _VNN_FaceFrameDataArr { - VNNUInt32 facesNum; - VNN_FaceFrameData facesArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -} VNN_FaceFrameDataArr; - -//typedef struct _VNN_FaceMaskDataArr { -// VNNUInt32 facesNum; -// VNN_FrameInstanceMaskData faceMaskArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -//} VNN_FaceMaskDataArr; - -#define VNN_FACE_APPLY_VIDEO_MODE 0 -#define VNN_FACE_APPLY_PICTURE_MODE 1 - -/* ------------------------------------------- */ - - -/* ------------------------------------------- */ -/* Some Gesture definition. */ - -#define VNN_FRAMEDATAARR_MAX_GESTURE_NUM 15 - -typedef enum _VNN_GestureType { - VNN_GestureType_Unknow = 0x00, - VNN_GestureType_V = 0x01, // Pinyin: jian dao shou - VNN_GestureType_ThumbUp = 0x02, // Pinyin: dian zan - VNN_GestureType_OneHandHeart = 0x03, // Pinyin: dan shou bi xin - VNN_GestureType_SpiderMan = 0x04, // Pinyin: zhi zhu xia - VNN_GestureType_Lift = 0x05, // Pinyin: tuo ju - VNN_GestureType_666 = 0x06, // 6 6 6 - VNN_GestureType_TwoHandHeart = 0x07, // Pinyin: shuang shou bi xin - VNN_GestureType_PalmTogether = 0x08, // Pinyin: bao quan - VNN_GestureType_PalmOpen = 0x09, // Pinyin: zhang kai shou zhang - VNN_GestureType_ZuoYi = 0x0a, // Pinyin: zuo yi | bao quan - VNN_GestureType_OK = 0x0b, // OK - VNN_GestureType_ERROR = 0xff, -} VNN_GestureType; - -typedef struct _VNN_GestureFrameData { - VNN_GestureType type; /* Gesture type */ - VNN_Rect2D rect; /* Gesture rect, left-top-right-bottom */ - VNNFloat32 score; /* Gesture confidence socre */ -} VNN_GestureFrameData; - -typedef struct _VNN_GestureFrameDataArr { - VNNUInt32 gestureNum; - VNN_GestureFrameData gestureArr[VNN_FRAMEDATAARR_MAX_GESTURE_NUM]; -} VNN_GestureFrameDataArr; - -/* ------------------------------------------- */ - - -/* ------------------------------------------- */ -/* Some struct definitions for pose sdk. */ - -#define VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM 22 -#define VNN_FRAMEDATAARR_MAX_BODYS_NUM 5 -typedef enum _VNN_BodyResultDesc { - VNN_BodyResultDesc_Normal = 0, - VNN_BodyResultDesc_NoPerson = 1, // "没有人" - VNN_BodyResultDesc_MorethanOnePerson = 2, // "注意:仅支持1人" - VNN_BodyResultDesc_NoKneeSeen = 3, // "看不到膝盖,请退后" - VNN_BodyResultDesc_NoFootSeen = 4, // "看不到脚部,请退后" - VNN_BodyResultDesc_NoHipSeen = 5 // "看不到腰部,请退后" -}VNN_BodyResultDesc; -typedef struct _VNN_BodyFrameData { - VNNFloat32 bodyScore; - VNN_Rect2D bodyRect; - VNNUInt32 bodyLandmarksNum; - VNN_Point2D bodyLandmarks[VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM]; - VNNFloat32 bodyLandmarkScores[VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM]; - VNNUInt32 isWriggleWaist; - VNNUInt32 isCrouch; - VNNUInt32 isRun; - VNN_BodyResultDesc bodyResultDesc; -} VNN_BodyFrameData; - -typedef struct _VNN_BodyFrameDataArr { - VNNUInt32 bodiesNum; - VNN_BodyFrameData bodiesArr[VNN_FRAMEDATAARR_MAX_BODYS_NUM]; -} VNN_BodyFrameDataArr; - -/* ------------------------------------------- */ - -/* ---------------------------------------------------------- */ -/* Some struct definitions for hand reconstruction sdk. */ - -#define VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS 10 -#define VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS 33 -#define VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS 3 - - -typedef struct _VNN_HandReconstructionFrameData { - VNNFloat32 rightHandShapeCoefs[VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 rightHandPoseCoefs[VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 rightHandCamCoefs[VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS]; - VNNFloat32 leftHandShapeCoefs[VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 leftHandPoseCoefs[VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 leftHandCamCoefs[VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS]; -} VNN_HandReconstructionFrameData; - -/* ---------------------------------------------------------- */ - - -/* ---------------------------------------------------------- */ -/* Some struct definitions for body reconstruction sdk. */ - -#define VNN_BODYRECONSTRUCTION_POSE_COEF_DIMS 207 -#define VNN_BODYRECONSTRUCTION_SHAPE_COEF_DIMS 10 -#define VNN_BODYRECONSTRUCTION_GLOBAL_ROTATE_COEF_DIMS 9 -#define VNN_BODYLECONSTRUCTION_CAM_OFFSET_COEF_DIMS 3 - - -typedef struct _VNN_BodyReconstructionFrameData { - VNNFloat32 bodyPoseCoefs[VNN_BODYRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 bodyShapeCoefs[VNN_BODYRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 bodyGlobalRotateCoefs[VNN_BODYRECONSTRUCTION_GLOBAL_ROTATE_COEF_DIMS]; - VNNFloat32 bodyCamOffsetCoefs[VNN_BODYLECONSTRUCTION_CAM_OFFSET_COEF_DIMS]; -} VNN_BodyReconstructionFrameData; - -/* ---------------------------------------------------------- */ - -/* ------------------------------------------- */ -/* Some definition of Classification. */ -#define VNN_CLASSIFICATION_ACC_TOP_N 5 -#define VNN_MAX_MULTI_CLASSFICATION_NUM 10 -#define VNN_MAX_LABEL_LENGTH 100 -typedef struct _VNN_Classification_Accuracy_Top_N { - VNNUInt32 categories[VNN_CLASSIFICATION_ACC_TOP_N]; - char labels[VNN_CLASSIFICATION_ACC_TOP_N][VNN_MAX_LABEL_LENGTH]; - VNNFloat32 probabilities[VNN_CLASSIFICATION_ACC_TOP_N]; - VNNInt32 usedTopN; -} VNN_ClsTopNAcc; - -typedef struct _VNN_ClassificationTopNDataArr { - VNNUInt32 numCls; - VNN_ClsTopNAcc clsArr[VNN_MAX_MULTI_CLASSFICATION_NUM]; - -} VNN_ClsTopNAccArr; - -typedef struct _VNN_MultiClassificationTopNDataArr { - VNNUInt32 numOut; - VNN_ClsTopNAccArr multiClsArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; //used for multi face - -} VNN_MultiClsTopNAccArr; -/* ------------------------------------------- */ - -typedef struct _VNN_ImageArr { - VNNInt32 imgsNum; - VNN_Image imgsArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -}VNN_ImageArr; - -#ifdef __cplusplus -} -#endif - -#endif // _VNN_COMMON_H_ diff --git a/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Headers/vnn_kit.h b/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Headers/vnn_kit.h deleted file mode 100644 index 12607026..00000000 --- a/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Headers/vnn_kit.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef VNN_KIT_H -#define VNN_KIT_H - -#include "vnn_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -VNN_API VNN_Result VNN_GetKitVersion(VNNUInt32 &major_ver, VNNUInt32 &minor_ver); - -VNN_API VNN_Result VNN_SetLogTag(const char *i_tag); - -typedef int (*VNNLOGCALLBACK) (const char* i_log); -VNN_API VNN_Result VNN_SetLogCallback(VNNLOGCALLBACK i_callback); - -VNN_API VNN_Result VNN_SetLogLevel(VNNUInt32 i_level); - -VNN_API VNN_Result VNN_GetLogLevel(VNNUInt32* o_level); - -VNN_API VNN_Result VNN_Init(VNNHandle* i_contextID); - -VNN_API VNN_Result VNN_Uninit(VNNHandle i_contextID); - -VNN_API VNN_Result VNN_CheckGLVersion(); - -VNN_API VNN_Result VNN_Get_VNNImage_Bytes(const void * i_img, unsigned int * o_bytes); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_Rotate(VNN_FaceFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_Mirror(VNN_FaceFrameDataArr* data); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_FlipV(VNN_FaceFrameDataArr* data); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_Rotate(VNN_GestureFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_Mirror(VNN_GestureFrameDataArr* data); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_FlipV(VNN_GestureFrameDataArr* data); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_Rotate(VNN_ObjCountDataArr* data, int rotate); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_Mirror(VNN_ObjCountDataArr* data); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_FlipV(VNN_ObjCountDataArr* data); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_Rotate(VNN_BodyFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_Mirror(VNN_BodyFrameDataArr* data); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_FlipV(VNN_BodyFrameDataArr* data); - -VNN_API VNN_Result VNN_Rect2D_Result_Rotate(VNN_Rect2D* data, int rotate); - -VNN_API VNN_Result VNN_Rect2D_Result_Mirror(VNN_Rect2D* data); - -VNN_API VNN_Result VNN_Rect2D_Result_FlipV(VNN_Rect2D* data); - -#ifdef _OPENMP -VNN_API VNN_Result VNN_Get_Num_Procs(int* num_procs); -VNN_API VNN_Result VNN_Set_NUM_Threads(int num_threads); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif // VNN_KIT_H - diff --git a/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Info.plist b/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Info.plist deleted file mode 100644 index 720af417..00000000 Binary files a/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/Info.plist and /dev/null differ diff --git a/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/vnn_kit_ios b/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/vnn_kit_ios deleted file mode 100644 index 0587666c..00000000 Binary files a/src/third_party/vnn/libs/ios/vnn_kit_ios.framework/vnn_kit_ios and /dev/null differ diff --git a/src/third_party/vnn/libs/linux/libvnn_core.so b/src/third_party/vnn/libs/linux/libvnn_core.so deleted file mode 100644 index 8cb075eb..00000000 Binary files a/src/third_party/vnn/libs/linux/libvnn_core.so and /dev/null differ diff --git a/src/third_party/vnn/libs/linux/libvnn_face.so b/src/third_party/vnn/libs/linux/libvnn_face.so deleted file mode 100644 index 23812467..00000000 Binary files a/src/third_party/vnn/libs/linux/libvnn_face.so and /dev/null differ diff --git a/src/third_party/vnn/libs/linux/libvnn_kit.so b/src/third_party/vnn/libs/linux/libvnn_kit.so deleted file mode 100644 index 0aa95ba4..00000000 Binary files a/src/third_party/vnn/libs/linux/libvnn_kit.so and /dev/null differ diff --git a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Headers b/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Headers deleted file mode 120000 index a177d2a6..00000000 --- a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Resources b/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Resources deleted file mode 120000 index 953ee36f..00000000 --- a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Resources +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Resources \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/Headers/vnn_define.h b/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/Headers/vnn_define.h deleted file mode 100644 index 557aef8e..00000000 --- a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/Headers/vnn_define.h +++ /dev/null @@ -1,96 +0,0 @@ -#ifndef VNN_DEFINE_H -#define VNN_DEFINE_H -#define VNN_NULL 0 -#define VNN_TRUE 1 -#define VNN_FALSE 0 - - -/* ------------------------------------------- */ -/* Base type definition */ - -#if defined(VNN_WIN32) || defined(_WIN32) || defined(WIN32) -typedef __int8 VNNInt8; -typedef __int16 VNNInt16; -typedef __int32 VNNInt32; -typedef __int64 VNNInt64; -typedef unsigned __int8 VNNUInt8; -typedef unsigned __int16 VNNUInt16; -typedef unsigned __int32 VNNUInt32; -typedef unsigned __int64 VNNUInt64; -#ifdef _WIN64 -typedef unsigned __int64 VNNUIntPtr; -typedef __int64 VNNIntPtr; -#else /* _WIN64 */ -typedef __w64 unsigned int VNNUIntPtr; -typedef __w64 int VNNIntPtr; -#endif /* _WIN64 */ -#else -#include -typedef int8_t VNNInt8; -typedef int16_t VNNInt16; -typedef int32_t VNNInt32; -typedef int64_t VNNInt64; -typedef uint8_t VNNUInt8; -typedef uint16_t VNNUInt16; -typedef uint32_t VNNUInt32; -typedef uint64_t VNNUInt64; -typedef uintptr_t VNNUIntPtr; -typedef intptr_t VNNIntPtr; -typedef void VNNVoid; -#endif -typedef void* VNNVoidPtr; -typedef int VNNBool; -typedef char VNNPath[1024]; -typedef char VNNText[1024]; -typedef char VNNName[256]; -typedef char VNNUUID[64]; -typedef VNNUInt32 VNNHandle; -typedef float VNNFloat32; -typedef double VNNFloat64; - -/* ------------------------------------------- */ - -/* ------------------------------------------- */ -/* Global API result definition */ - -typedef enum _VNN_Result { - VNN_Result_Success = 0, - VNN_Result_Failed = -1, - VNN_Result_InvalidModel = -2, - VNN_Result_InvalidFrameHandler = -3, - VNN_Result_InvalidInput = -4, - VNN_Result_InvalidParamName = -5, - VNN_Result_InvalidParamValue = -6, - VNN_Result_BadMalloc = -7, - VNN_Result_NotImplemented = -8, - VNN_Result_FileOpenFailed = -9, - VNN_Result_UnsurportedFormat = -10, - VNN_Result_Failed_GLVersion = -11, - VNN_Result_Failed_GLEnvironment = -12, -} VNN_Result; - -/* ------------------------------------------- */ -/* Global Log level definition */ -typedef enum _VNN_LogLevel { - VNN_LOG_LEVEL_VERBOSE = 0x00000001, // 0b 0...00000001 - VNN_LOG_LEVEL_DEBUG = 0x00000002, // 0b 0...00000010 - VNN_LOG_LEVEL_INFO = 0x00000004, // 0b 0...00000100 - VNN_LOG_LEVEL_WARN = 0x00000008, // 0b 0...00001000 - VNN_LOG_LEVEL_ERROR = 0x00000010, // 0b 0...00010000 - VNN_LOG_LEVEL_ALL = 0x000000ff, // 0b 0...11111111 (Easy setting to enable all log-level informations) -} VNN_LogLevel; - -// New macro definition -#if defined(_WIN32) || defined(WIN32) -# ifdef VNN_LIB -# define VNN_API __declspec(dllexport) -# else -# define VNN_API -# endif -#elif defined(ANDROID) || defined(__APPLE__) -# define VNN_API __attribute__ ((visibility("default"))) -#else -# define VNN_API -#endif -VNN_API VNN_Result VNN_Get_Core_Version(VNNUInt32 &major_ver, VNNUInt32 &minor_ver); -#endif //VNN_DEFINE_H diff --git a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/Resources/Info.plist b/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index c2ac845a..00000000 --- a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/Resources/Info.plist +++ /dev/null @@ -1,52 +0,0 @@ - - - - - BuildMachineOSBuild - 20F71 - CFBundleDevelopmentRegion - en - CFBundleDisplayName - vnn - CFBundleExecutable - vnn_core_osx - CFBundleIdentifier - cn.huanju.vnn.core - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - vnn_core_osx - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.1.1 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CFBundleVersion - 1314 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 13A233 - DTPlatformName - macosx - DTPlatformVersion - 11.3 - DTSDKBuild - 20E214 - DTSDKName - macosx11.3 - DTXcode - 1300 - DTXcodeBuild - 13A233 - LSApplicationCategoryType - - LSMinimumSystemVersion - 10.9 - - diff --git a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/_CodeSignature/CodeResources b/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/_CodeSignature/CodeResources deleted file mode 100644 index d5f270f9..00000000 --- a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/_CodeSignature/CodeResources +++ /dev/null @@ -1,143 +0,0 @@ - - - - - files - - Resources/Info.plist - - vmvBUuC2ODQ2IREbFrGMMh4LbkM= - - - files2 - - Headers/vnn_define.h - - hash - - YveIZD8ztXVqxyqOz1JYoJZBrHI= - - hash2 - - 69XAU3scs4dQvy7+nJtf9fT1Gc5RlXvHG4pcvqwoF4w= - - - Resources/Info.plist - - hash - - vmvBUuC2ODQ2IREbFrGMMh4LbkM= - - hash2 - - ggRgkMT2h/3RQ3LW3gYGVlv3en3rwYIRcgHcZONg2yE= - - - - rules - - ^Resources/ - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^Resources/ - - weight - 20 - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/vnn_core_osx b/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/vnn_core_osx deleted file mode 100755 index 9b9338ed..00000000 Binary files a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/A/vnn_core_osx and /dev/null differ diff --git a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/Current b/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/Current deleted file mode 120000 index 8c7e5a66..00000000 --- a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/vnn_core_osx b/src/third_party/vnn/libs/macos/vnn_core_osx.framework/vnn_core_osx deleted file mode 120000 index 359afd6b..00000000 --- a/src/third_party/vnn/libs/macos/vnn_core_osx.framework/vnn_core_osx +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/vnn_core_osx \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Headers b/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Headers deleted file mode 120000 index a177d2a6..00000000 --- a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Resources b/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Resources deleted file mode 120000 index 953ee36f..00000000 --- a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Resources +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Resources \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/Headers/vnn_face.h b/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/Headers/vnn_face.h deleted file mode 100644 index 2e6e8e0e..00000000 --- a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/Headers/vnn_face.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef VNN_FACE_H -#define VNN_FACE_H - -#include "vnn_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -VNN_API VNN_Result VNN_Create_Face( VNNHandle * handle, const int argc, const void * argv[] ); - -VNN_API VNN_Result VNN_Destroy_Face(VNNHandle* handle ); - -VNN_API VNN_Result VNN_Apply_Face_CPU( VNNHandle handle, const void * input, void * output ); - -VNN_API VNN_Result VNN_Apply_Face_GPU( VNNHandle handle, const void * input, void * output ); - -VNN_API VNN_Result VNN_Set_Face_Attr( VNNHandle handle, const char * name, const void * value ); - -VNN_API VNN_Result VNN_Get_Face_Attr( VNNHandle handle, const char * name, void * value ); - -#ifdef __cplusplus -} -#endif - -#endif /* VNN_FACE_H */ - diff --git a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/Resources/Info.plist b/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index d0dcfa3e..00000000 --- a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/Resources/Info.plist +++ /dev/null @@ -1,52 +0,0 @@ - - - - - BuildMachineOSBuild - 20F71 - CFBundleDevelopmentRegion - en - CFBundleDisplayName - vnn - CFBundleExecutable - vnn_face_osx - CFBundleIdentifier - cn.huanju.vnn.face - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - vnn_face_osx - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.1.1 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CFBundleVersion - 1314 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 13A233 - DTPlatformName - macosx - DTPlatformVersion - 11.3 - DTSDKBuild - 20E214 - DTSDKName - macosx11.3 - DTXcode - 1300 - DTXcodeBuild - 13A233 - LSApplicationCategoryType - - LSMinimumSystemVersion - 10.9 - - diff --git a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/_CodeSignature/CodeResources b/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/_CodeSignature/CodeResources deleted file mode 100644 index 7b47a020..00000000 --- a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/_CodeSignature/CodeResources +++ /dev/null @@ -1,143 +0,0 @@ - - - - - files - - Resources/Info.plist - - kBkKJrO6Z+82gK0TFgM0fP48TfQ= - - - files2 - - Headers/vnn_face.h - - hash - - aaCLdS7n+ac8MWPtPJfDwWkZoCo= - - hash2 - - 4mV79kLxOPr5DsAVX7y4XntDHlCpDDcfg1rLLlW9Szc= - - - Resources/Info.plist - - hash - - kBkKJrO6Z+82gK0TFgM0fP48TfQ= - - hash2 - - RCIV+4AONkL4F8VQnkJbprnGDyt1oJlNFkVee4rkDsY= - - - - rules - - ^Resources/ - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^Resources/ - - weight - 20 - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/vnn_face_osx b/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/vnn_face_osx deleted file mode 100755 index 7c25bae0..00000000 Binary files a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/A/vnn_face_osx and /dev/null differ diff --git a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/Current b/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/Current deleted file mode 120000 index 8c7e5a66..00000000 --- a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/vnn_face_osx b/src/third_party/vnn/libs/macos/vnn_face_osx.framework/vnn_face_osx deleted file mode 120000 index 94a2b26f..00000000 --- a/src/third_party/vnn/libs/macos/vnn_face_osx.framework/vnn_face_osx +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/vnn_face_osx \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Headers b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Headers deleted file mode 120000 index a177d2a6..00000000 --- a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Headers +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Headers \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Resources b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Resources deleted file mode 120000 index 953ee36f..00000000 --- a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Resources +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Resources \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Headers/vnn_common.h b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Headers/vnn_common.h deleted file mode 100644 index a33f46c0..00000000 --- a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Headers/vnn_common.h +++ /dev/null @@ -1,293 +0,0 @@ -#ifndef _VNN_COMMON_H_ -#define _VNN_COMMON_H_ -#include "vnn_define.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -/* ------------------------------------------- */ -/* Some base interface definition. */ - -typedef enum _VNN_PIX_FMT { - VNN_PIX_FMT_UNKNOW, /* Unknow pixel format, as a cube */ - VNN_PIX_FMT_YUVI420, /* YUV 4:2:0 12bpp ( 3 planes, the first is Y, the second is U, the third is V */ - VNN_PIX_FMT_YUV420F, /* YUV 4:2:0 12bpp ( 2 planes, ios FullRange, the first is Y - luminance channel, the other channel was UV alternate permutation.) */ - VNN_PIX_FMT_YUV420V, /* YUV 4:2:0 12bpp ( 2 planes, ios VideoRange, the first is Y - luminance channel, the other channel was UV alternate permutation.) */ - VNN_PIX_FMT_YUV420P_888_SKIP1, /* YUV 4:2:0 12bpp ( 3 planes, android Camera2, the first is Y - luminance channel, the second is U channel with skip 1, the third is V channel with skip 1.) */ - VNN_PIX_FMT_BGRA8888, /* BGRA 8:8:8:8 32bpp ( 4 channel, 8x4=32bit BGRA pixel ) */ - VNN_PIX_FMT_RGBA8888, /* RGBA 8:8:8:8 32bpp ( 4 channel, 8x4=32bit RGBA pixel ) */ - VNN_PIX_FMT_GRAY8, /* Y 1 8bpp ( 1 channel, 8bit luminance pixel ) */ - VNN_PIX_FMT_NV12, /* YUV 4:2:0 12bpp ( 2 planes, the first is Y - luminance channel, the other channel was UV alternate permutation ) */ - VNN_PIX_FMT_NV21, /* YUV 4:2:0 12bpp ( 2 planes, andoird default, the first is Y - luminance channel, the other channel was VU alternate permutation ) */ - VNN_PIX_FMT_BGR888, /* BGR 8:8:8 24bpp ( 3 channel, 8x3=24bit BGR pixel ) */ - VNN_PIX_FMT_RGB888, /* RGB 8:8:8 24bpp ( 3 channel, 8x3=24bit RGB pixel ) */ - VNN_PIX_FMT_GRAY32, /* Y 1 8bpp ( 1 channel, 32bit float luminance pixel ) */ - VNN_PIX_FMT_CHW_U8, /* As a cube , data layerout was chw, data type was unsigned char */ - VNN_PIX_FMT_CHW_F32, /* As a cube , data layerout was chw, data type was float 32 */ - VNN_PIX_FMT_ERROR /* Error pixel format */ -} VNN_PIX_FMT; - -typedef enum _VNN_ORIENT_FMT { - /* - Like value as VNN_ORIENT_FMT_ROTATE_90L|VNN_ORIENT_FMT_FLIP_V, means fristly anticlockwise rotate 90 degree, and then flip vertically; - So, the priority rotation is higher then flip. - */ - VNN_ORIENT_FMT_DEFAULT = 0x00000000, /* Unknow orientated format, as a default option, no rotate and no flip */ - VNN_ORIENT_FMT_ROTATE_90L = 0x00000001, /* anticlockwise rotate 90 degree (clockwise rotate 270 degree) */ - VNN_ORIENT_FMT_ROTATE_90R = 0x00000002, /* clockwise rotate 90 degree */ - VNN_ORIENT_FMT_ROTATE_180 = 0x00000004, /* rotate 180 degree */ - VNN_ORIENT_FMT_FLIP_V = 0x00000008, /* flip vertically */ - VNN_ORIENT_FMT_FLIP_H = 0x00000010, /* flip horizontally */ - VNN_ORIENT_FMT_ROTATE_360 = 0x00000020, /* android case: post carma orientation = 270 degree */ - VNN_ORIENT_FMT_ROTATE_180L = 0x00000040, /* android case: post carma orientation = 270 degree */ - VNN_ORIENT_FMT_ERROR = 0xFFFFFFFF, /* ERROR */ -} VNN_ORIENT_FMT; - -typedef enum _VNN_MODE_FMT { - VNN_MODE_FMT_VIDEO = 0x00000000, - VNN_MODE_FMT_PICTURE = 0x00000001, - VNN_MODE_FMT_DEFAULT = 0x00000000, -} VNN_MODE_FMT; - -typedef struct _VNN_Texture { - VNNUInt32 textureID; /* OpenGL texture id.*/ - VNNUInt32 target; /* OpenGL texture target, e.g. GL_TEXTURE_2D.*/ - VNNUInt32 format; /* OpenGL texture format, e.g. GL_RGBA.*/ - VNNInt32 width; /* OpenGL texture width.*/ - VNNInt32 height; /* OpenGL texture height.*/ -} VNN_Texture; - -typedef struct _VNN_Rect2D { - VNNFloat32 x0; /* left */ - VNNFloat32 y0; /* top */ - VNNFloat32 x1; /* right */ - VNNFloat32 y1; /* bottom */ -} VNN_Rect2D; - -typedef struct _VNN_Point2D { - VNNFloat32 x; - VNNFloat32 y; -} VNN_Point2D; - -typedef struct _VNN_Image { - VNN_ORIENT_FMT ori_fmt; /* orientation format enum of img*/ - VNN_PIX_FMT pix_fmt; /* pixel format enum of img */ - VNN_MODE_FMT mode_fmt; /* mode format enum of detection, can use video/picture/default */ - VNNInt32 width; /* width of img */ - VNNInt32 height; /* height of img */ - VNNInt32 channels; /* channels of img */ - VNN_Rect2D rect; /* rect record the place in target image where this image should be put into, when used as output this member may help.*/ - VNNVoidPtr data; /* if is cpu-backend, data means the raw data of img, default type is "unsigned char". But data is NULL in gpu-backend. */ - VNNVoidPtr texture; /* if is cpu-backend, texture is NULL. But if is gpu-backend, texture may be a VNN_Texture(android|ios) or a CVPixelbuffer(ios). */ -} VNN_Image; - - - -/* ------------------------------------------- */ - -/* ------------------------------------------- */ -/* Some definition of Object Count. */ -typedef struct _VNN_ObjectCountDataArr { - VNNInt32 count; - VNN_Rect2D * objRectArr; -} VNN_ObjCountDataArr; -VNN_API void VNN_ObjCountDataArr_Free(VNN_ObjCountDataArr *); -/* ------------------------------------------- */ - - - -/* ------------------------------------------- */ -/* Some definition of Frame mask */ -//typedef struct _VNN_FrameInstanceMaskData { -// VNNInt32 width; -// VNNInt32 height; -// VNN_Rect2D maskRect; -// VNNVoidPtr data; -//}VNN_FrameInstanceMaskData; - - -/* ------------------------------------------- */ -/* Some Face definition. */ - -#define VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM 278 -#define VNN_FRAMEDATAARR_MAX_FACES_NUM 5 - -typedef struct _VNN_FaceFrameData { - VNNFloat32 faceScore; - VNN_Rect2D faceRect; - VNNUInt32 inputWidth; - VNNUInt32 inputHeight; - VNNUInt32 faceLandmarksNum; - VNN_Point2D faceLandmarks[VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM]; - VNNFloat32 faceLandmarkScores[VNN_FRAMEDATA_MAX_FACE_LANDMARKS_NUM]; - /* Face Attributes */ - VNNBool ifCloseLeftEye; - VNNBool ifCloseRightEye; - VNNBool ifBlinkLeftEye; - VNNBool ifBlinkRightEye; - VNNBool ifOpenMouth; - VNNBool ifShakeHead; - VNNBool ifNodHead; - VNNBool ifOpenCloseMouth; - VNNFloat32 smileScore; - VNNFloat32 faceYaw; -} VNN_FaceFrameData; - -typedef struct _VNN_FaceFrameDataArr { - VNNUInt32 facesNum; - VNN_FaceFrameData facesArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -} VNN_FaceFrameDataArr; - -//typedef struct _VNN_FaceMaskDataArr { -// VNNUInt32 facesNum; -// VNN_FrameInstanceMaskData faceMaskArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -//} VNN_FaceMaskDataArr; - -#define VNN_FACE_APPLY_VIDEO_MODE 0 -#define VNN_FACE_APPLY_PICTURE_MODE 1 - -/* ------------------------------------------- */ - - -/* ------------------------------------------- */ -/* Some Gesture definition. */ - -#define VNN_FRAMEDATAARR_MAX_GESTURE_NUM 15 - -typedef enum _VNN_GestureType { - VNN_GestureType_Unknow = 0x00, - VNN_GestureType_V = 0x01, // Pinyin: jian dao shou - VNN_GestureType_ThumbUp = 0x02, // Pinyin: dian zan - VNN_GestureType_OneHandHeart = 0x03, // Pinyin: dan shou bi xin - VNN_GestureType_SpiderMan = 0x04, // Pinyin: zhi zhu xia - VNN_GestureType_Lift = 0x05, // Pinyin: tuo ju - VNN_GestureType_666 = 0x06, // 6 6 6 - VNN_GestureType_TwoHandHeart = 0x07, // Pinyin: shuang shou bi xin - VNN_GestureType_PalmTogether = 0x08, // Pinyin: bao quan - VNN_GestureType_PalmOpen = 0x09, // Pinyin: zhang kai shou zhang - VNN_GestureType_ZuoYi = 0x0a, // Pinyin: zuo yi | bao quan - VNN_GestureType_OK = 0x0b, // OK - VNN_GestureType_ERROR = 0xff, -} VNN_GestureType; - -typedef struct _VNN_GestureFrameData { - VNN_GestureType type; /* Gesture type */ - VNN_Rect2D rect; /* Gesture rect, left-top-right-bottom */ - VNNFloat32 score; /* Gesture confidence socre */ -} VNN_GestureFrameData; - -typedef struct _VNN_GestureFrameDataArr { - VNNUInt32 gestureNum; - VNN_GestureFrameData gestureArr[VNN_FRAMEDATAARR_MAX_GESTURE_NUM]; -} VNN_GestureFrameDataArr; - -/* ------------------------------------------- */ - - -/* ------------------------------------------- */ -/* Some struct definitions for pose sdk. */ - -#define VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM 22 -#define VNN_FRAMEDATAARR_MAX_BODYS_NUM 5 -typedef enum _VNN_BodyResultDesc { - VNN_BodyResultDesc_Normal = 0, - VNN_BodyResultDesc_NoPerson = 1, // "没有人" - VNN_BodyResultDesc_MorethanOnePerson = 2, // "注意:仅支持1人" - VNN_BodyResultDesc_NoKneeSeen = 3, // "看不到膝盖,请退后" - VNN_BodyResultDesc_NoFootSeen = 4, // "看不到脚部,请退后" - VNN_BodyResultDesc_NoHipSeen = 5 // "看不到腰部,请退后" -}VNN_BodyResultDesc; -typedef struct _VNN_BodyFrameData { - VNNFloat32 bodyScore; - VNN_Rect2D bodyRect; - VNNUInt32 bodyLandmarksNum; - VNN_Point2D bodyLandmarks[VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM]; - VNNFloat32 bodyLandmarkScores[VNN_FRAMEDATA_MAX_BODYLANDMARKS_NUM]; - VNNUInt32 isWriggleWaist; - VNNUInt32 isCrouch; - VNNUInt32 isRun; - VNN_BodyResultDesc bodyResultDesc; -} VNN_BodyFrameData; - -typedef struct _VNN_BodyFrameDataArr { - VNNUInt32 bodiesNum; - VNN_BodyFrameData bodiesArr[VNN_FRAMEDATAARR_MAX_BODYS_NUM]; -} VNN_BodyFrameDataArr; - -/* ------------------------------------------- */ - -/* ---------------------------------------------------------- */ -/* Some struct definitions for hand reconstruction sdk. */ - -#define VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS 10 -#define VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS 33 -#define VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS 3 - - -typedef struct _VNN_HandReconstructionFrameData { - VNNFloat32 rightHandShapeCoefs[VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 rightHandPoseCoefs[VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 rightHandCamCoefs[VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS]; - VNNFloat32 leftHandShapeCoefs[VNN_HANDRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 leftHandPoseCoefs[VNN_HANDRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 leftHandCamCoefs[VNN_HANDLECONSTRUCTION_CAM_COEF_DIMS]; -} VNN_HandReconstructionFrameData; - -/* ---------------------------------------------------------- */ - - -/* ---------------------------------------------------------- */ -/* Some struct definitions for body reconstruction sdk. */ - -#define VNN_BODYRECONSTRUCTION_POSE_COEF_DIMS 207 -#define VNN_BODYRECONSTRUCTION_SHAPE_COEF_DIMS 10 -#define VNN_BODYRECONSTRUCTION_GLOBAL_ROTATE_COEF_DIMS 9 -#define VNN_BODYLECONSTRUCTION_CAM_OFFSET_COEF_DIMS 3 - - -typedef struct _VNN_BodyReconstructionFrameData { - VNNFloat32 bodyPoseCoefs[VNN_BODYRECONSTRUCTION_POSE_COEF_DIMS]; - VNNFloat32 bodyShapeCoefs[VNN_BODYRECONSTRUCTION_SHAPE_COEF_DIMS]; - VNNFloat32 bodyGlobalRotateCoefs[VNN_BODYRECONSTRUCTION_GLOBAL_ROTATE_COEF_DIMS]; - VNNFloat32 bodyCamOffsetCoefs[VNN_BODYLECONSTRUCTION_CAM_OFFSET_COEF_DIMS]; -} VNN_BodyReconstructionFrameData; - -/* ---------------------------------------------------------- */ - -/* ------------------------------------------- */ -/* Some definition of Classification. */ -#define VNN_CLASSIFICATION_ACC_TOP_N 5 -#define VNN_MAX_MULTI_CLASSFICATION_NUM 10 -#define VNN_MAX_LABEL_LENGTH 100 -typedef struct _VNN_Classification_Accuracy_Top_N { - VNNUInt32 categories[VNN_CLASSIFICATION_ACC_TOP_N]; - char labels[VNN_CLASSIFICATION_ACC_TOP_N][VNN_MAX_LABEL_LENGTH]; - VNNFloat32 probabilities[VNN_CLASSIFICATION_ACC_TOP_N]; - VNNInt32 usedTopN; -} VNN_ClsTopNAcc; - -typedef struct _VNN_ClassificationTopNDataArr { - VNNUInt32 numCls; - VNN_ClsTopNAcc clsArr[VNN_MAX_MULTI_CLASSFICATION_NUM]; - -} VNN_ClsTopNAccArr; - -typedef struct _VNN_MultiClassificationTopNDataArr { - VNNUInt32 numOut; - VNN_ClsTopNAccArr multiClsArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; //used for multi face - -} VNN_MultiClsTopNAccArr; -/* ------------------------------------------- */ - -typedef struct _VNN_ImageArr { - VNNInt32 imgsNum; - VNN_Image imgsArr[VNN_FRAMEDATAARR_MAX_FACES_NUM]; -}VNN_ImageArr; - -#ifdef __cplusplus -} -#endif - -#endif // _VNN_COMMON_H_ diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Headers/vnn_kit.h b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Headers/vnn_kit.h deleted file mode 100644 index 12607026..00000000 --- a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Headers/vnn_kit.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef VNN_KIT_H -#define VNN_KIT_H - -#include "vnn_common.h" - -#ifdef __cplusplus -extern "C" { -#endif - -VNN_API VNN_Result VNN_GetKitVersion(VNNUInt32 &major_ver, VNNUInt32 &minor_ver); - -VNN_API VNN_Result VNN_SetLogTag(const char *i_tag); - -typedef int (*VNNLOGCALLBACK) (const char* i_log); -VNN_API VNN_Result VNN_SetLogCallback(VNNLOGCALLBACK i_callback); - -VNN_API VNN_Result VNN_SetLogLevel(VNNUInt32 i_level); - -VNN_API VNN_Result VNN_GetLogLevel(VNNUInt32* o_level); - -VNN_API VNN_Result VNN_Init(VNNHandle* i_contextID); - -VNN_API VNN_Result VNN_Uninit(VNNHandle i_contextID); - -VNN_API VNN_Result VNN_CheckGLVersion(); - -VNN_API VNN_Result VNN_Get_VNNImage_Bytes(const void * i_img, unsigned int * o_bytes); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_Rotate(VNN_FaceFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_Mirror(VNN_FaceFrameDataArr* data); - -VNN_API VNN_Result VNN_FaceFrameDataArr_Result_FlipV(VNN_FaceFrameDataArr* data); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_Rotate(VNN_GestureFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_Mirror(VNN_GestureFrameDataArr* data); - -VNN_API VNN_Result VNN_GestureFrameDataArr_Result_FlipV(VNN_GestureFrameDataArr* data); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_Rotate(VNN_ObjCountDataArr* data, int rotate); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_Mirror(VNN_ObjCountDataArr* data); - -VNN_API VNN_Result VNN_ObjCountDataArr_Result_FlipV(VNN_ObjCountDataArr* data); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_Rotate(VNN_BodyFrameDataArr* data, int rotate); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_Mirror(VNN_BodyFrameDataArr* data); - -VNN_API VNN_Result VNN_BodyFrameDataArr_Result_FlipV(VNN_BodyFrameDataArr* data); - -VNN_API VNN_Result VNN_Rect2D_Result_Rotate(VNN_Rect2D* data, int rotate); - -VNN_API VNN_Result VNN_Rect2D_Result_Mirror(VNN_Rect2D* data); - -VNN_API VNN_Result VNN_Rect2D_Result_FlipV(VNN_Rect2D* data); - -#ifdef _OPENMP -VNN_API VNN_Result VNN_Get_Num_Procs(int* num_procs); -VNN_API VNN_Result VNN_Set_NUM_Threads(int num_threads); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif // VNN_KIT_H - diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Resources/Info.plist b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Resources/Info.plist deleted file mode 100644 index f8959160..00000000 --- a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/Resources/Info.plist +++ /dev/null @@ -1,52 +0,0 @@ - - - - - BuildMachineOSBuild - 20F71 - CFBundleDevelopmentRegion - en - CFBundleDisplayName - vnn - CFBundleExecutable - vnn_kit_osx - CFBundleIdentifier - cn.huanju.vnn.kit - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - vnn_kit_osx - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.1.1 - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CFBundleVersion - 1314 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 13A233 - DTPlatformName - macosx - DTPlatformVersion - 11.3 - DTSDKBuild - 20E214 - DTSDKName - macosx11.3 - DTXcode - 1300 - DTXcodeBuild - 13A233 - LSApplicationCategoryType - - LSMinimumSystemVersion - 10.9 - - diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/_CodeSignature/CodeResources b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/_CodeSignature/CodeResources deleted file mode 100644 index 4680314b..00000000 --- a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/_CodeSignature/CodeResources +++ /dev/null @@ -1,154 +0,0 @@ - - - - - files - - Resources/Info.plist - - Qsqw1sr48CbYxF9RcUbaeHR5UEM= - - - files2 - - Headers/vnn_common.h - - hash - - HXHH792zpJ+21eB7CgiZmSB3Z4A= - - hash2 - - o4lkRzcr1pO1X3p+SgqFhfWBD7cLi49Vjh+hP+w8UG8= - - - Headers/vnn_kit.h - - hash - - 5U74LQoPt0wFDSTIl4we+FljJk8= - - hash2 - - LIc+shJnn0JKuaXiMaNw+IogzqCxTE8XJAafk/T7PCw= - - - Resources/Info.plist - - hash - - Qsqw1sr48CbYxF9RcUbaeHR5UEM= - - hash2 - - +4ot+dwiByqFC4lQD79eveDgeIrTAdZzVX2s2fSptXE= - - - - rules - - ^Resources/ - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^Resources/ - - weight - 20 - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/vnn_kit_osx b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/vnn_kit_osx deleted file mode 100755 index 207e6190..00000000 Binary files a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/A/vnn_kit_osx and /dev/null differ diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/Current b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/Current deleted file mode 120000 index 8c7e5a66..00000000 --- a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -A \ No newline at end of file diff --git a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/vnn_kit_osx b/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/vnn_kit_osx deleted file mode 120000 index a68f4586..00000000 --- a/src/third_party/vnn/libs/macos/vnn_kit_osx.framework/vnn_kit_osx +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/vnn_kit_osx \ No newline at end of file diff --git a/src/third_party/vnn/libs/windows/.DS_Store b/src/third_party/vnn/libs/windows/.DS_Store deleted file mode 100644 index b9f09929..00000000 Binary files a/src/third_party/vnn/libs/windows/.DS_Store and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x64/.DS_Store b/src/third_party/vnn/libs/windows/x64/.DS_Store deleted file mode 100644 index 5008ddfc..00000000 Binary files a/src/third_party/vnn/libs/windows/x64/.DS_Store and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x64/vnn_core.dll b/src/third_party/vnn/libs/windows/x64/vnn_core.dll deleted file mode 100644 index b7b43bae..00000000 Binary files a/src/third_party/vnn/libs/windows/x64/vnn_core.dll and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x64/vnn_core.lib b/src/third_party/vnn/libs/windows/x64/vnn_core.lib deleted file mode 100644 index 94d7d200..00000000 Binary files a/src/third_party/vnn/libs/windows/x64/vnn_core.lib and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x64/vnn_face.dll b/src/third_party/vnn/libs/windows/x64/vnn_face.dll deleted file mode 100644 index 18dffc9d..00000000 Binary files a/src/third_party/vnn/libs/windows/x64/vnn_face.dll and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x64/vnn_face.lib b/src/third_party/vnn/libs/windows/x64/vnn_face.lib deleted file mode 100644 index 4f7318e8..00000000 Binary files a/src/third_party/vnn/libs/windows/x64/vnn_face.lib and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x64/vnn_kit.dll b/src/third_party/vnn/libs/windows/x64/vnn_kit.dll deleted file mode 100644 index 03789518..00000000 Binary files a/src/third_party/vnn/libs/windows/x64/vnn_kit.dll and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x64/vnn_kit.lib b/src/third_party/vnn/libs/windows/x64/vnn_kit.lib deleted file mode 100644 index 29977d6c..00000000 Binary files a/src/third_party/vnn/libs/windows/x64/vnn_kit.lib and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x86/.DS_Store b/src/third_party/vnn/libs/windows/x86/.DS_Store deleted file mode 100644 index 5008ddfc..00000000 Binary files a/src/third_party/vnn/libs/windows/x86/.DS_Store and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x86/vnn_core.dll b/src/third_party/vnn/libs/windows/x86/vnn_core.dll deleted file mode 100644 index d5661d44..00000000 Binary files a/src/third_party/vnn/libs/windows/x86/vnn_core.dll and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x86/vnn_face.dll b/src/third_party/vnn/libs/windows/x86/vnn_face.dll deleted file mode 100644 index c549729b..00000000 Binary files a/src/third_party/vnn/libs/windows/x86/vnn_face.dll and /dev/null differ diff --git a/src/third_party/vnn/libs/windows/x86/vnn_kit.dll b/src/third_party/vnn/libs/windows/x86/vnn_kit.dll deleted file mode 100644 index 6eac695e..00000000 Binary files a/src/third_party/vnn/libs/windows/x86/vnn_kit.dll and /dev/null differ diff --git a/src/third_party/vnn/models/vnn_face278_data/face_mobile[1.0.0].vnnmodel b/src/third_party/vnn/models/vnn_face278_data/face_mobile[1.0.0].vnnmodel deleted file mode 100644 index 158fbe75..00000000 Binary files a/src/third_party/vnn/models/vnn_face278_data/face_mobile[1.0.0].vnnmodel and /dev/null differ diff --git a/src/third_party/vnn/models/vnn_face278_data/face_pc[1.0.0].vnnmodel b/src/third_party/vnn/models/vnn_face278_data/face_pc[1.0.0].vnnmodel deleted file mode 100644 index 649d0fee..00000000 Binary files a/src/third_party/vnn/models/vnn_face278_data/face_pc[1.0.0].vnnmodel and /dev/null differ