Skip to content

Commit

Permalink
Update Body Detect
Browse files Browse the repository at this point in the history
  • Loading branch information
Crusoekid committed Feb 25, 2021
1 parent adde0ee commit c51b576
Show file tree
Hide file tree
Showing 14 changed files with 43 additions and 21 deletions.
4 changes: 2 additions & 2 deletions Android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ The ```build.gradle``` in Main Module add,select which function you need.But the
dependencies {
...
// Must have and must be the newest!!!!
implementation 'com.tengine.tenginekit:core:0.0.3'
implementation 'com.tengine.tenginekit:core:0.0.4'
// Function on Face
implementation 'com.tengine.tenginekit:face:0.0.3'
// Function on Hand
implementation 'com.tengine.tenginekit:hand:0.0.2'
// Function on Body
implementation 'com.tengine.tenginekit:body:0.0.2'
implementation 'com.tengine.tenginekit:body:0.0.3'
...
}
```
Expand Down
8 changes: 4 additions & 4 deletions Android/docs/Android_README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ Project中的build.gradle添加
dependencies {
...
// 必须有,并且必须是最新的
implementation 'com.tengine.tenginekit:core:0.0.2'
implementation 'com.tengine.tenginekit:core:0.0.4'
// Function on Face
implementation 'com.tengine.tenginekit:face:0.0.2'
implementation 'com.tengine.tenginekit:face:0.0.3'
// Function on Hand
implementation 'com.tengine.tenginekit:hand:0.0.1'
implementation 'com.tengine.tenginekit:hand:0.0.2'
// Function on Body
implementation 'com.tengine.tenginekit:body:0.0.1'
implementation 'com.tengine.tenginekit:body:0.0.3'
...
}
```
Expand Down
6 changes: 5 additions & 1 deletion Android/docs/Android_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Configuration function (functions are based on image detection):
BlazeFace,
FaceMesh,
Iris,
BodyDetect
BlazePose,
BlazePoseLandmark,
HandDetect,
Expand All @@ -79,12 +80,15 @@ Configuration function (functions are based on image detection):
| BlazeFace | Face detect |
| FaceMesh | Face 3d landmarks(468) |
| Iris | Iris landmarks |
| BodyDetect | Body detect |
| BlazePose | Body detect |
| BlazePoseLandmark | Body landmarks |
| HandDetect | Hand detect |
| HandLandmark3d | Hand landmarks |

Tips:BlazeFace, FaceMesh, Iris, BlazePose, BlazePoseLandmark, HandDetect, HandLandmark3d, models are from Google,The project address is:https://github.com/google/mediapipe
Tips:
- BlazeFace, FaceMesh, Iris, BlazePose, BlazePoseLandmark, HandDetect, HandLandmark3d, models are from Google,The project address is:https://github.com/google/mediapipe
- If you want to use body landmark , please use ```BlazePose``` as body detect.

## get face detect infos
Since all functions on face are based on face detection, first create an object of ```Face.FaceDetect```. Detect detection will be faster, BlazeFace will be more accurate and the angle can be larger , but it didn`t support much faces(BlazeFace is based on the Google model). Will eventually return a [FaceDetectInfo list](#FaceDetectInfo);
Expand Down
6 changes: 5 additions & 1 deletion Android/docs/Android_api_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
BlazeFace,
FaceMesh,
Iris,
BodyDetect,
BlazePose,
BlazePoseLandmark,
HandDetect,
Expand All @@ -79,12 +80,15 @@
| BlazeFace | 人脸检测 |
| FaceMesh | 人脸3d关键点(468) |
| Iris | 虹膜关键点 |
| BodyDetect | 身体检测 |
| BlazePose | 身体检测 |
| BlazePoseLandmark | 身体关键点 |
| HandDetect | 手部检测 |
| HandLandmark3d | 手部关键点 |

Tips:BlazeFace, FaceMesh, Iris, BlazePose, BlazePoseLandmark, HandDetect, HandLandmark3d,的模型都是来自Google,项目地址为:https://github.com/google/mediapipe
Tips:
- BlazeFace, FaceMesh, Iris, BlazePose, BlazePoseLandmark, HandDetect, HandLandmark3d,的模型都是来自Google,项目地址为:https://github.com/google/mediapipe
- 如果你想使用身体关键点,请使用```BlazePose```作为身体检测方式。

## 获取人脸检测信息
由于脸部所有功能都基于人脸检测,所以先创建一个```Face.FaceDetect```的对象。Detect检测会更快,BlazeFace更准确,支持角度更大但是不支持多脸(BlazeFace是基于Google模型的)。最终会返回一个[List<FaceDetectInfo>](#FaceDetectInfo);
Expand Down
2 changes: 1 addition & 1 deletion Android/sample/FaceDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies {
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.google.android.material:material:1.0.0'

implementation 'com.tengine.tenginekit:core:0.0.3'
implementation 'com.tengine.tenginekit:core:0.0.4'
implementation 'com.tengine.tenginekit:face:0.0.3'

implementation 'com.android.support:appcompat-v7:28.0.0'
Expand Down
4 changes: 2 additions & 2 deletions Android/sample/GoogleBodyDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ dependencies {
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.google.android.material:material:1.0.0'

implementation 'com.tengine.tenginekit:core:0.0.3'
implementation 'com.tengine.tenginekit:body:0.0.2'
implementation 'com.tengine.tenginekit:core:0.0.4'
implementation 'com.tengine.tenginekit:body:0.0.3'

implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
Expand Down
1 change: 1 addition & 0 deletions Android/sample/GoogleFaceDemo/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Android/sample/GoogleFaceDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies {
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.google.android.material:material:1.0.0'

implementation 'com.tengine.tenginekit:core:0.0.3'
implementation 'com.tengine.tenginekit:core:0.0.4'
implementation 'com.tengine.tenginekit:face:0.0.3'

implementation 'com.android.support:appcompat-v7:28.0.0'
Expand Down
2 changes: 1 addition & 1 deletion Android/sample/GoogleHandDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies {
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.google.android.material:material:1.0.0'

implementation 'com.tengine.tenginekit:core:0.0.3'
implementation 'com.tengine.tenginekit:core:0.0.4'
implementation 'com.tengine.tenginekit:hand:0.0.2'

implementation 'com.android.support:appcompat-v7:28.0.0'
Expand Down
2 changes: 1 addition & 1 deletion Android/sample/ImageDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ dependencies {
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.google.android.material:material:1.0.0'

implementation 'com.tengine.tenginekit:core:0.0.3'
implementation 'com.tengine.tenginekit:core:0.0.4'
implementation 'com.tengine.tenginekit:face:0.0.3'

implementation 'com.android.support:appcompat-v7:28.0.0'
Expand Down
10 changes: 9 additions & 1 deletion Linux/include/tenginekit_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ enum ModelType{
Landmark3d,
GoDetect,
Iris,
BlazePose,
BodyDetect,
BlazePoseDetect,
BlazePoseLandmark,
HandDetect,
HandLandmark3d,
Expand All @@ -48,11 +49,15 @@ typedef struct FaceSDKConfig
FaceSDKMode mode;
int thread_num;

char* packageName;
char* uuid;
} FaceSDKConfig;


void facesdk_init(FaceSDKConfig config);
void facesdk_readModelFromFile(ModelType type, const char* model_path, ImageFormat modelInputFormat);
void facesdk_readModelFromFile(ModelType type, const char* model_path, ImageFormat modelInputFormat, bool is_encrypted);
void facesdk_readModelFromBuffer(ModelType type, char* buffer,int buffer_size, ImageFormat modelInputFormat, bool is_encrypted);
void facesdk_release();

sdkFaces facesdk_detect(char *imgData);
Expand All @@ -67,6 +72,9 @@ sdkBody facesdk_bodylandmark();
sdkHand3d facesdk_handdetect(char *imageData);
sdkHand3d facesdk_handlandmark3d();

void facesdk_set_mode(FaceSDKMode mode);
void facesdk_set_orientation(int degree, bool screen_rotation, int screen_w, int screen_h);

void facesdk_create_handler(ImageFormat image_input_format, ImageFormat image_output_format);
char* facesdk_handle_image(char* imageData, int image_w, int image_h, int input_x1, int input_y1, int input_x2, int input_y2, int output_w, int output_h, int rotation, bool mirror);

Expand Down
7 changes: 5 additions & 2 deletions Linux/include/tenginekit_struct.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

#ifndef TENGINEKIT_STRUCT
#define TENGINEKIT_STRUCT
//--------------------base struct ------------------------
typedef struct Box {
float x1;
Expand Down Expand Up @@ -52,8 +53,9 @@ typedef struct FaceInfo3d {
typedef struct BodyInfo
{
Box body_box;
float score;
float landmark[25 * 4];
};
} BodyInfo;

typedef struct HandInfo3d
{
Expand Down Expand Up @@ -89,3 +91,4 @@ typedef struct sdkHand3d


//--------------------------------------------------------
#endif
Binary file modified Linux/libs/libTengineKitSDK.so
Binary file not shown.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,21 @@ or
- face 3dlandmarks
- face attributes for example: age, gender, smile, glasses
- eye iris & landmarks
- body detect
- hand detect(Real-time, not yet on Mobile)
- hand landmarks(Real-time, not yet on Mobile)
- body detect(Real-time, not yet on Mobile)
- body detect google(Real-time, not yet on Mobile)
- body landamrks(Real-time, not yet on Mobile)

# Update (2021/02/24)
- Update Core v0.0.3
# Update (2021/02/25)
- Update Core v0.0.4
- Update Face v0.0.3
- Update Hand v0.0.2
- Update Body v0.0.2
- Update Body v0.0.3
- Fixed some Bugs
- Rename models
- Linux libTengineKitSDK.so
- Body Detect model

# Performance(Face Detect & Face Landmark)

Expand Down

0 comments on commit c51b576

Please sign in to comment.