Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb5208a3

Browse files
authored
Merge pull request#2 from regulaforensics/huawei-vision
Huawei vision
2 parents49c29a8 +33d7747 commitb5208a3

File tree

6 files changed

+29
-14
lines changed

6 files changed

+29
-14
lines changed

‎FaceSample/app/build.gradle‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ android {
88

99
defaultConfig {
1010
applicationId"com.regula.facesample"
11-
minSdkVersion18
11+
minSdkVersion21
1212
targetSdkVersion30
1313
versionCode1
1414
versionName"1.0"
@@ -37,7 +37,10 @@ dependencies {
3737
androidTestImplementation'androidx.test.espresso:espresso-core:3.3.0'
3838
implementation"androidx.recyclerview:recyclerview:1.2.1"
3939

40-
implementation ('com.regula.face:api:3.1.+@aar'){
40+
implementation ('com.regula.face:api:5.4.1527@aar'){
41+
transitive=true
42+
}
43+
implementation ('com.regula.face:huawei-vision:1.0.4@aar'){
4144
transitive=true
4245
}
4346
}

‎FaceSample/app/src/main/java/com/regula/facesample/MatchFacesActivity.java‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
importcom.regula.facesdk.enums.ImageType;
2121
importcom.regula.facesdk.enums.LivenessStatus;
2222
importcom.regula.facesdk.model.Image;
23+
importcom.regula.facesdk.model.MatchFacesImage;
2324
importcom.regula.facesdk.request.MatchFacesRequest;
2425

2526
importjava.util.ArrayList;
@@ -165,9 +166,9 @@ else if (requestCode == PICK_IMAGE_2)
165166
}
166167

167168
privatevoidmatchFaces(Bitmapfirst,Bitmapsecond) {
168-
List<Image>imageList =newArrayList<>();
169-
imageList.add(newImage((Integer)imageView1.getTag(),first));
170-
imageList.add(newImage((Integer)imageView2.getTag(),second));
169+
List<MatchFacesImage>imageList =newArrayList<>();
170+
imageList.add(newMatchFacesImage((Integer)imageView1.getTag(),first));
171+
imageList.add(newMatchFacesImage((Integer)imageView2.getTag(),second));
171172
MatchFacesRequestmatchRequest =newMatchFacesRequest(imageList);
172173

173174
FaceSDK.Instance().matchFaces(matchRequest,matchFacesResponse -> {

‎FaceSample/build.gradle‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ allprojects {
1616
repositories {
1717
google()
1818
mavenCentral()
19+
maven {
20+
url'https://developer.huawei.com/repo/'
21+
}
1922
maven {
2023
url"https://maven.regulaforensics.com/RegulaDocumentReader"
2124
}
25+
maven {
26+
url"https://maven.regulaforensics.com/RegulaDocumentReader/Beta"
27+
}
2228
}
2329
}
2430

‎FaceSampleKotlin/app/build.gradle‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ android {
1717

1818
defaultConfig {
1919
applicationId"com.regula.facesamplekotlin"
20-
minSdkVersion18
20+
minSdkVersion21
2121
targetSdkVersion30
2222
versionCode1
2323
versionName"1.0"
@@ -50,7 +50,10 @@ dependencies {
5050
androidTestImplementation'androidx.test.ext:junit:1.1.3'
5151
androidTestImplementation'androidx.test.espresso:espresso-core:3.4.0'
5252

53-
implementation ('com.regula.face:api:3.1.+@aar'){
53+
implementation ('com.regula.face:api:5.4.1527@aar'){
54+
transitive=true
55+
}
56+
implementation ('com.regula.face:huawei-vision:1.0.4@aar'){
5457
transitive=true
5558
}
5659
}

‎FaceSampleKotlin/app/src/main/java/com/regula/facesamplekotlin/MainActivity.kt‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ import android.net.Uri
88
importandroid.os.Bundle
99
importandroid.provider.MediaStore
1010
importandroid.view.MenuItem
11-
importandroid.view.View
1211
importandroid.widget.*
1312
importcom.regula.facesdk.FaceSDK
1413
importcom.regula.facesdk.configuration.FaceCaptureConfiguration
1514
importcom.regula.facesdk.configuration.LivenessConfiguration
1615
importcom.regula.facesdk.enums.ImageType
1716
importcom.regula.facesdk.enums.LivenessStatus
18-
importcom.regula.facesdk.model.Image
17+
importcom.regula.facesdk.model.MatchFacesImage
1918
importcom.regula.facesdk.model.results.FaceCaptureResponse
2019
importcom.regula.facesdk.model.results.LivenessResponse
21-
importcom.regula.facesdk.model.results.MatchFacesResponse
20+
importcom.regula.facesdk.model.results.matchfaces.MatchFacesResponse
2221
importcom.regula.facesdk.request.MatchFacesRequest
2322

2423

@@ -144,12 +143,12 @@ class MainActivity : Activity() {
144143
}
145144

146145
privatefunmatchFaces(first:Bitmap,second:Bitmap) {
147-
val firstImage=Image(imageView1.tagasInt, first)
148-
val secondImage=Image(imageView2.tagasInt, second)
146+
val firstImage=MatchFacesImage(imageView1.tagasInt, first)
147+
val secondImage=MatchFacesImage(imageView2.tagasInt, second)
149148

150149
FaceSDK.Instance().matchFaces(MatchFacesRequest(arrayListOf(firstImage, secondImage))) { matchFacesResponse:MatchFacesResponse->
151-
if (matchFacesResponse.matchedFaces.size>0) {
152-
val similarity= matchFacesResponse.matchedFaces[0].similarity
150+
if (matchFacesResponse.results.size>0) {
151+
val similarity= matchFacesResponse.results[0].similarity
153152
textViewSimilarity.text="Similarity:"+String.format("%.2f", similarity*100)+"%"
154153
}else {
155154
textViewSimilarity.text="Similarity: null"

‎FaceSampleKotlin/build.gradle‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ allprojects {
1818
repositories {
1919
google()
2020
mavenCentral()
21+
maven {
22+
url'https://developer.huawei.com/repo/'
23+
}
2124
maven {
2225
url"http://maven.regulaforensics.com/RegulaDocumentReader"
2326
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp