MCPcopy Create free account
hub / github.com/OAID/TengineKit

github.com/OAID/TengineKit @v1.1.4

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.1.4 ↗ · + Follow
588 symbols 1,176 edges 80 files 77 documented · 13% updated 4y agov1.0.1 · 2021-10-18★ 2,32032 open issues

Browse by type

Functions 492 Types & classes 96
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

中文版本

TengineKit

TengineKit - Free RealTime Face Landmarks 212 Points For Mobile.

Apache 2.0

TengineKit, developed by OPEN AI LAB.
TengineKit is an easy-to-integrate face detection and face landmarks SDK. At present, it can run on various mobile phones at very low latency.We will continue to update this project for better results and better performance!

Effect

| Face Detection &

Face 2dLandmark | Face 3dLandmark &

Iris | Upper Body Detection &

Uppper Body Landmark | Hand Detection &

Hand Landmark | | :---: | :---: | :---: | :---: | |

|

|

|

|

Gif

dance of host

Video( YouTube | BiliBili )

[

](https://youtu.be/bnyD3laX_bU)

Have a try

  • Apk can be directly downloaded and installed on the phone to see the effect.

or

  • scan code to download apk

Apk

Goals

  • Provide best performance in mobile client
  • Provide the simplest API in mobile client
  • Provide the smallest package in mobile client

Features

  • face detection
  • face landmarks
  • face 3dlandmarks
  • face attributes like age, gender, smile, glasses
  • eye iris & landmarks
  • 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 landamrks(Real-time, not yet on Mobile)

Performance(face & landmark)

CPU Time consuming Frame rate
Kirin 980 14ms 71fps
Qualcomm 855 15ms 67fps
Kirin 970 17ms 59fps
Qualcomm 835 18ms 56fps
Kirin 710F 19ms 53fps
Qualcomm 439 26ms 38fps
MediaTek Helio P60 27ms 37fps
Qualcomm 450B 28ms 36fps

Gradle Configure

The build.gradle in Project add

    repositories {
        ...
        jcenter()
        mavenCentral()
        ...
    }

    allprojects {
        repositories {
            ...
            jcenter()
            mavenCentral()
            ...    
        }
    }

The build.gradle in Main Module add

    dependencies {
        ...
        implementation 'com.tengine.android:tenginekit:1.1.4'
        ...
    }

System

Android - Min Sdk Version 19

API

When using sdk, you can refer to Api to complete the functions you need.

Landmark Points Order

Landmark Points Order

Usage

Usage

Permission

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET"/>

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>

<uses-permission android:name="android.permission.CAMERA"/>

Sample

Android code under the "sample/" folder.

Access Guide

In setRotation of TengineKit Api, there are two parameters ori and is_screen_rotate, which are the rotation angle and whether to follow the screen rotation. Whether the android:screenOrientation parameter in the Manifest follows the screen can be set. Not setting this parameter is to follow the screen rotation.

Process

1.Device preview

This part is to get data from Camera, as the SDK input.

2.Angle

We use the vertical screen as an angle of 0 degrees. Since the data collected by the Android camera always deviates by 90, it is necessary to set + (-90) when setting the ori parameter. The actual rotation angle of Android is to add a function through the sensor Calculate to get. For details, see the example in the Demo project.

3.Rendering

When rendering, it is rendered at an angle of 0°, which is the normal output that people see under normal circumstances. The Android part has Canvas and Opengl rendering. Using Opengl rendering can make your apk better.

Contact

About the use of TengineKit and face-related technical exchanges, you can join the following QQ groups(Group Answer:TengineKit): - TengineKit communication QQ group: 630836519 - Scan to join group

ImageHandle

ImageHandle to do Zoom, rotate, crop, and change picture format

Extension points exported contracts — how you extend this code

ConnectionCallback (Interface)
Callback for Activities to use to initialize their data once the selected preview size is known. [8 implementers]
sample/FaceDemo/app/src/main/java/com/faceDemo/currencyview/CameraConnectionFragment.java
ConnectionCallback (Interface)
Callback for Activities to use to initialize their data once the selected preview size is known. [8 implementers]
sample/GoogleFaceDemo/app/src/main/java/com/faceDemo/currencyview/CameraConnectionFragment.java
ConnectionCallback (Interface)
Callback for Activities to use to initialize their data once the selected preview size is known. [8 implementers]
sample/GoogleBodyDemo/app/src/main/java/com/bodyDemo/currencyview/CameraConnectionFragment.java
ConnectionCallback (Interface)
Callback for Activities to use to initialize their data once the selected preview size is known. [8 implementers]
sample/GoogleHandDemo/app/src/main/java/com/faceDemo/currencyview/CameraConnectionFragment.java
DrawCallback (Interface)
Interface defining the callback for client classes. [4 implementers]
sample/FaceDemo/app/src/main/java/com/faceDemo/currencyview/OverlayView.java
DrawCallback (Interface)
Interface defining the callback for client classes. [4 implementers]
sample/GoogleFaceDemo/app/src/main/java/com/faceDemo/currencyview/OverlayView.java
DrawCallback (Interface)
Interface defining the callback for client classes. [4 implementers]
sample/GoogleBodyDemo/app/src/main/java/com/bodyDemo/currencyview/OverlayView.java
DrawCallback (Interface)
Interface defining the callback for client classes. [4 implementers]
sample/GoogleHandDemo/app/src/main/java/com/faceDemo/currencyview/OverlayView.java

Core symbols most depended-on inside this repo

Shape

Method 492
Class 88
Interface 8

Languages

Java100%

Modules by API surface

sample/GoogleHandDemo/app/src/main/java/com/faceDemo/currencyview/CameraConnectionFragment.java38 symbols
sample/GoogleFaceDemo/app/src/main/java/com/faceDemo/currencyview/CameraConnectionFragment.java38 symbols
sample/GoogleBodyDemo/app/src/main/java/com/bodyDemo/currencyview/CameraConnectionFragment.java38 symbols
sample/FaceDemo/app/src/main/java/com/faceDemo/currencyview/CameraConnectionFragment.java38 symbols
sample/GoogleHandDemo/app/src/main/java/com/faceDemo/activity/CameraActivity.java18 symbols
sample/GoogleFaceDemo/app/src/main/java/com/faceDemo/activity/CameraActivity.java18 symbols
sample/GoogleBodyDemo/app/src/main/java/com/bodyDemo/activity/CameraActivity.java18 symbols
sample/FaceDemo/app/src/main/java/com/faceDemo/activity/CameraActivity.java18 symbols
sample/GoogleHandDemo/app/src/main/java/com/faceDemo/currencyview/LegacyCameraConnectionFragment.java15 symbols
sample/GoogleFaceDemo/app/src/main/java/com/faceDemo/currencyview/LegacyCameraConnectionFragment.java15 symbols
sample/GoogleBodyDemo/app/src/main/java/com/bodyDemo/currencyview/LegacyCameraConnectionFragment.java15 symbols
sample/FaceDemo/app/src/main/java/com/faceDemo/currencyview/LegacyCameraConnectionFragment.java15 symbols

For agents

$ claude mcp add TengineKit \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page