|
1 | | -# Agora RTC with SenseTime Android |
| 1 | +# Configuration Guide |
| 2 | +*English | [中文](README.zh.md)* |
2 | 3 |
|
3 | | -A tutorial demo for Agora Video SDK can be found here: [Agora-Android-Tutorial-1to1](https://github.com/AgoraIO/Basic-Video-Call/tree/master/One-to-One-Video/Agora-Android-Tutorial-1to1) |
| 4 | +This example provides two SenseTime beauty access methods, single input (NV21 only) and dual input (NV21 and texture). Dual input has less NV21 to texture operation than single input, and the conversion performance is relatively high, but on low-end machines, the sticker may not follow the face, etc. It is recommended to choose the appropriate access method according to the customer. |
| 5 | +> The plug-in cloud market provides a more convenient integration method. You can log in to the sound network [console](https://console.agora.io/) to view the [integration tutorial](https://console.agora.io/ marketplace/license/introduce?serviceName=sensetime-ar) |
4 | 6 |
|
5 | | -This demo demonstrates the combined use of Agora RTC sdk and SenseTime beautification library. You can do: |
| 7 | +## 1 SenseTime Beauty SDK |
6 | 8 |
|
7 | | -- Join a channel and have video a chatting with friends; |
8 | | -- SenseTime beauty, makeups and stickers for your video. |
9 | | - |
10 | | -## 1 Configuration |
11 | | - |
12 | | -### 1.1 Agora RTC |
13 | | -#### 1.1.1 App Id |
14 | | - |
15 | | -Create a developer account at [Agora.io](https://dashboard.agora.io/signin/), create a new project and obtain an App ID as the identification of the running app. Update "app/src/main/res/values/strings-config.xml" with your App ID. |
16 | | - |
17 | | -``` |
18 | | -<string name="AGORA_APP_ID"><#YOUR APP ID#></string> |
19 | | -``` |
20 | | - |
21 | | -#### 1.1.2 Agora SDK |
22 | | - |
23 | | -There are two ways to add Agora Video SDK to the project: |
24 | | - |
25 | | -* JCenter (recommended) |
26 | | -* Download SDK from [Agora.io SDK](https://docs.agora.io/en/Agora%20Platform/downloads) |
27 | | - |
28 | | -**The first method** will download Agora Video SDK automatically from JCenter when the project is building. Add the following line to "app/build.gradle" (which is default in the project): |
29 | | -``` |
30 | | -implementation 'io.agora.rtc:full-sdk:4.0.0-rc.1' |
31 | | -``` |
32 | | - |
33 | | -**The second method** needs developers to download SDK and copy the unzipped library files to proper project folders (acquires knowledge of the project structure): |
34 | | - |
35 | | -* Copy ***.jar** under **libs** to **app/libs** |
36 | | -* Copy **arm64-v8a**/**x86**/**armeabi-v7a** under **libs** to **app/src/main/jniLibs**. |
37 | | -* Add the following code in the property of the dependence of the "app/build.gradle": |
38 | | - |
39 | | -``` |
40 | | -implementation fileTree(dir: 'libs', include: ['*.jar']) |
41 | | -``` |
42 | | - |
43 | | -### 1.2 SenseTime |
44 | | - |
45 | | -#### 1.2.1 SenseTime SDK |
46 | | - |
47 | | -Most the of code of SenseTime SDK is already provided in the **"sensetime"** module of the demo project. But things to note that developers need to download and copy .so libraries to **"sensetime/src/main/jniLibs"** folder: |
| 9 | +- Contact SenseTime customer service to get the latest sdk download address, download and unzip |
| 10 | +- Copy **libst_mobile.so** to **"beauty/sense-time/src/main/jniLibs"** folder |
48 | 11 | ``` |
49 | 12 | jniLibs |
50 | 13 | |_ arm64-v8a |
51 | 14 | |_ armeabi-v7a |
52 | 15 | ``` |
53 | | - |
54 | | -Other native code and JNI interfaces are all in the .arr files. Copy .aar libraries to **"sensetime/libs"** folder: |
| 16 | +- Copy **STMobileJNI-release.aar** and **SenseArSourceManager-release.aar** to **"beauty/sense-time/libs"** folder |
55 | 17 | ``` |
56 | 18 | libs |
57 | 19 | |_ SenseArSourceManager-release.aar |
58 | 20 | |_ STMobileJNI-release.aar |
59 | 21 | ``` |
60 | 22 |
|
61 | | -#### 1.2.2 SenseTime Resources |
| 23 | +## 2 Beauty resources |
| 24 | + |
| 25 | +Copy the resource files in the SDK to the **"beauty/sense-time/src/main/assets"** directory. The resource files used in this project are listed below: |
| 26 | + |
| 27 | +- Model resources (required): Loaded in [STRenderer](src/main/java/com/sensetime/effects/STRenderer.java) |
| 28 | + models/M_Segment_DBLV2_Pant_1.1.6.model |
| 29 | + models/M_SenseME_3DMesh_Face_2.0.2.model |
| 30 | + models/M_SenseME_Attribute_1.0.1.model |
| 31 | + models/M_SenseME_Avatar_Help_2.2.0.model |
| 32 | + models/M_SenseME_CatFace_3.0.0.model |
| 33 | + models/M_SenseME_DogFace_2.0.0.model |
| 34 | + models/M_SenseME_Face_Extra_Advanced_6.0.13.model |
| 35 | + models/M_SenseME_Face_Video_7.0.0.model |
| 36 | + models/M_SenseME_Foot_1.0.2.model |
| 37 | + models/M_SenseME_Hand_5.4.0.model |
| 38 | + models/M_SenseME_Segment_4.14.1.model |
| 39 | + models/M_SenseME_Segment_DBL_Face_1.0.7.model |
| 40 | + models/M_SenseME_Segment_Hair_1.3.4.model |
| 41 | + models/M_SenseME_Segment_Head_1.0.3.model |
| 42 | + models/M_SenseME_Segment_MouthOcclusion_FastV1_1.1.3.model |
| 43 | + models/M_SenseME_Segment_Skin_1.1.1.model |
| 44 | + models/M_SenseME_Segment_Sky_1.0.3.model |
| 45 | + |
| 46 | +- MakeUp resources (test resources): Loaded when beauty is enabled in [BeautySenseTimeImpl](src/main/java/io/agora/beauty/sensetime/BeautySenseTimeImpl.java) |
| 47 | + makeup_lip/12自然.zip |
| 48 | + |
| 49 | +- Stickers (test resource): Loaded when stickers are enabled in [BeautySenseTimeImpl](src/main/java/io/agora/beauty/sensetime/BeautySenseTimeImpl.java) |
| 50 | + sticker_face_shape/lianxingface.zip |
| 51 | + |
| 52 | +- Filter (test resource): Loaded when the filter is enabled in [BeautySenseTimeImpl](src/main/java/io/agora/beauty/sensetime/BeautySenseTimeImpl.java) |
| 53 | + filter_portrait/filter_style_babypink.model |
62 | 54 |
|
63 | | -Copy all resource files to **"sensetime/src/main/assets"** from the download link. |
64 | | -Note: Current version is aligned with SenseAR SDK 8.x version. And sample has assign some default filter and stickers. If these resources are not available on your SDK, you may need to replace them with yours. |
| 55 | +Note: Filter resources are time-limited, and you need to get valid filter resources from SenseTime customer service. |
65 | 56 |
|
66 | | -#### 1.2.3 SenseTime Licence |
| 57 | +## 3 License |
67 | 58 |
|
68 | | -Developers must contact SenseTime to obtain the licence file. Change the file name as **"SenseMe.lic"** and copy the file to **"sensetime/src/main/assets/license"** folder. |
| 59 | +SenseTime provides two kinds of License configurations, one is the offline method using the local license file, and the other is the online method obtained through the SenseTime interface according to the applicationId. The following describes these two configuration methods in the project. |
69 | 60 |
|
70 | | -### 1.3 SenseTime In Extensions Marketplace |
| 61 | +### 3.1 Offline mode |
| 62 | +- Contact SenseTime customer service to get the license file, the license file is also divided **Online/Offline** need to pay attention |
| 63 | +- If it is an offline license, rename the certificate to **"SenseMe.lic"** , if it is an online license, rename it to **"SenseME_Online.lic"** , then copy **"beauty/sense-time/src/main/assets/license"** folder |
| 64 | +- Set the **USING_SERVER_LICENSE** variable in [STLicenseUtils](src/main/java/com/sensetime/effects/utils/STLicenseUtils.java) to false |
| 65 | +- According to whether the obtained license is offline, if it is offline, set the **USING_ASSETS_ONLINE_LICENSE** variable in [STLicenseUtils](src/main/java/com/sensetime/effects/utils/STLicenseUtils.java) to false, otherwise set it to true |
71 | 66 |
|
72 | | -The SenseTime extension is available in agora extensions marketplace. If you want to integrate the sdk via SenseTime extension, you can refer to the [document](https://github.com/AgoraIO-Community/AgoraMarketPlace/blob/master/SenseTime/README.md). |
73 | 67 |
|
74 | | -## Developer Environment Requirements |
75 | | -- Android Studio 3.1 or above |
76 | | -- Real devices (Nexus 5X or other devices) |
77 | | -- Some simulators may have functions missing or have performance issue |
| 68 | +### 3.2 Online mode |
| 69 | +- Contact SenseTime customer service to configure the certificate corresponding to the appId of the application |
| 70 | +- Set the **USING_SERVER_LICENSE** variable in [STLicenseUtils](src/main/java/com/sensetime/effects/utils/STLicenseUtils.java) to true |
78 | 71 |
|
79 | | -## Connect Us |
| 72 | +## 4 Configure compilation |
80 | 73 |
|
81 | | -- You can find full Agora API document at [Document Center](https://docs.agora.io/en/) |
82 | | -- You can file bugs about this demo at [issue](https://github.com/AgoraIO/Agora-With-SenseTime/issues) |
| 74 | +- Set the **beauty_sensetime** variable in **gradle.properties** in the project directory to true |
| 75 | +- compile and run |
83 | 76 |
|
84 | | -## License |
85 | 77 |
|
86 | | -The MIT License (MIT). |
0 commit comments