mirror of
https://github.com/googlesamples/mlkit.git
synced 2026-01-09 07:10:56 +08:00
Update versions.
Change-Id: I62e756c51c2cef23124f24443074e6b59198d3e9
This commit is contained in:
parent
dadb73518f
commit
1123940adf
@ -28,9 +28,9 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.exifinterface:exifinterface:1.2.0'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.71"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72"
|
||||
|
||||
// Add this dependency and multiDexEnabled = true in your defaultConfig to solve the error:
|
||||
// Cannot fit requested classes in a single dex file
|
||||
@ -39,24 +39,24 @@ dependencies {
|
||||
// ML Kit related dependencies
|
||||
|
||||
// Barcode model
|
||||
implementation 'com.google.mlkit:barcode-scanning:16.0.2'
|
||||
implementation 'com.google.mlkit:barcode-scanning:16.0.3'
|
||||
|
||||
// Object detection and tracking features
|
||||
implementation 'com.google.mlkit:object-detection:16.2.0'
|
||||
implementation 'com.google.mlkit:object-detection-custom:16.2.0'
|
||||
implementation 'com.google.mlkit:object-detection:16.2.1'
|
||||
implementation 'com.google.mlkit:object-detection-custom:16.2.1'
|
||||
|
||||
// Face features
|
||||
implementation 'com.google.android.gms:play-services-mlkit-face-detection:16.1.0'
|
||||
implementation 'com.google.android.gms:play-services-mlkit-face-detection:16.1.1'
|
||||
|
||||
// Text features
|
||||
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.0'
|
||||
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.1'
|
||||
|
||||
// Image labeling
|
||||
implementation 'com.google.mlkit:image-labeling:16.1.0'
|
||||
implementation 'com.google.mlkit:image-labeling:17.0.0'
|
||||
|
||||
// Language Identification
|
||||
implementation 'com.google.mlkit:language-id:16.1.0'
|
||||
implementation 'com.google.mlkit:language-id:16.1.1'
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
|
||||
}
|
||||
|
||||
@ -124,18 +124,18 @@ public class MLKitVisionImage {
|
||||
.get(CameraCharacteristics.SENSOR_ORIENTATION);
|
||||
|
||||
if (isFrontFacing) {
|
||||
rotationCompensation = (sensorOrientation + rotationDegrees) % 360;
|
||||
rotationCompensation = (sensorOrientation + rotationCompensation) % 360;
|
||||
} else { // back-facing
|
||||
rotationCompensation = (sensorOrientation - rotationDegrees + 360) % 360;
|
||||
rotationCompensation = (sensorOrientation - rotationCompensation + 360) % 360;
|
||||
}
|
||||
return rotationCompensation;
|
||||
}
|
||||
// [END get_rotation]
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private void getCompensation(Activity activity, Context context) throws CameraAccessException {
|
||||
private void getCompensation(Activity activity, boolean isFrontFacing) throws CameraAccessException {
|
||||
// Get the ID of the camera using CameraManager. Then:
|
||||
int rotation = getRotationCompensation(MY_CAMERA_ID, activity, context);
|
||||
int rotation = getRotationCompensation(MY_CAMERA_ID, activity, isFrontFacing);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ class MLKitVisionImage {
|
||||
*/
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Throws(CameraAccessException::class)
|
||||
private fun getRotationCompensation(cameraId: String, activity: Activity, context: Context, isFrontFacing: Boolean): Int {
|
||||
private fun getRotationCompensation(cameraId: String, activity: Activity, isFrontFacing: Boolean): Int {
|
||||
// Get the device's current rotation relative to its "native" orientation.
|
||||
// Then, from the ORIENTATIONS table, look up the angle the image must be
|
||||
// rotated to compensate for the device's rotation.
|
||||
@ -104,15 +104,15 @@ class MLKitVisionImage {
|
||||
var rotationCompensation = ORIENTATIONS.get(deviceRotation)
|
||||
|
||||
// Get the device's sensor orientation.
|
||||
val cameraManager = context.getSystemService(CAMERA_SERVICE) as CameraManager
|
||||
val cameraManager = activity.getSystemService(CAMERA_SERVICE) as CameraManager
|
||||
val sensorOrientation = cameraManager
|
||||
.getCameraCharacteristics(cameraId)
|
||||
.get(CameraCharacteristics.SENSOR_ORIENTATION)!!
|
||||
|
||||
if (isFrontFacing) {
|
||||
rotationCompensation = (sensorOrientation + rotationDegrees) % 360
|
||||
rotationCompensation = (sensorOrientation + rotationCompensation) % 360
|
||||
} else { // back-facing
|
||||
rotationCompensation = (sensorOrientation - rotationDegrees + 360) % 360
|
||||
rotationCompensation = (sensorOrientation - rotationCompensation + 360) % 360
|
||||
}
|
||||
return rotationCompensation
|
||||
}
|
||||
@ -120,9 +120,9 @@ class MLKitVisionImage {
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
@Throws(CameraAccessException::class)
|
||||
private fun getCompensation(activity: Activity, context: Context) {
|
||||
private fun getCompensation(activity: Activity, context: Context, isFrontFacing: Boolean) {
|
||||
// Get the ID of the camera using CameraManager. Then:
|
||||
val rotation = getRotationCompensation(MY_CAMERA_ID, activity, context)
|
||||
val rotation = getRotationCompensation(MY_CAMERA_ID, activity, isFrontFacing)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
@ -7,8 +7,8 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
|
||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#Tue May 26 20:04:43 PDT 2020
|
||||
#Mon Aug 24 22:29:37 PDT 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
|
||||
@ -41,8 +41,8 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
// Image labeling with AutoML model support
|
||||
implementation 'com.google.mlkit:image-labeling-automl:16.2.0'
|
||||
implementation 'com.google.mlkit:linkfirebase:16.0.0'
|
||||
implementation 'com.google.mlkit:image-labeling-automl:16.2.1'
|
||||
implementation 'com.google.mlkit:linkfirebase:16.0.1'
|
||||
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
// -------------------------------------------------------
|
||||
@ -66,9 +66,9 @@ dependencies {
|
||||
implementation "androidx.lifecycle:lifecycle-livedata:2.2.0"
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel:2.2.0"
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.annotation:annotation:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
|
||||
|
||||
// CameraX
|
||||
implementation "androidx.camera:camera-camera2:1.0.0-SNAPSHOT"
|
||||
|
||||
@ -6,10 +6,9 @@ buildscript {
|
||||
mavenLocal()
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.6.1'
|
||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||
classpath 'com.google.gms:google-services:4.3.3'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
@ -22,7 +21,6 @@ allprojects {
|
||||
mavenLocal()
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#Wed May 27 11:25:30 PDT 2020
|
||||
#Mon Aug 24 22:53:40 PDT 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
|
||||
@ -33,16 +33,16 @@ android {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.google.auto.value:auto-value-annotations:1.6.3"
|
||||
implementation "com.google.auto.value:auto-value-annotations:1.6.5"
|
||||
annotationProcessor "com.google.auto.value:auto-value:1.6.3"
|
||||
implementation 'androidx.core:core-ktx:1.3.0'
|
||||
implementation 'androidx.multidex:multidex:2.0.0'
|
||||
implementation 'androidx.core:core-ktx:1.3.1'
|
||||
implementation 'androidx.multidex:multidex:2.0.1'
|
||||
implementation 'com.google.guava:guava:28.0-android'
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
|
||||
implementation 'com.google.mlkit:digital-ink-recognition:+'
|
||||
implementation 'com.google.mlkit:digital-ink-recognition:16.1.0'
|
||||
|
||||
androidTestImplementation 'androidx.test:rules:1.2.0'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
|
||||
@ -6,7 +6,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:4.0.0"
|
||||
classpath "com.android.tools.build:gradle:4.0.1"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
||||
@ -23,16 +23,16 @@ android {
|
||||
dependencies {
|
||||
implementation project(':internal:lintchecks')
|
||||
implementation project(':internal:chooserx')
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61'
|
||||
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72'
|
||||
|
||||
implementation 'androidx.exifinterface:exifinterface:1.2.0'
|
||||
implementation 'androidx.media:media:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
|
||||
testImplementation 'junit:junit:4.13'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
|
||||
implementation 'com.google.mlkit:language-id:16.1.0'
|
||||
implementation 'com.google.mlkit:language-id:16.1.1'
|
||||
}
|
||||
|
||||
|
||||
@ -8,8 +8,8 @@ buildscript {
|
||||
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61'
|
||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#Wed Oct 30 17:15:14 EDT 2019
|
||||
#Mon Aug 24 23:06:26 PDT 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
|
||||
@ -53,12 +53,12 @@ dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72"
|
||||
|
||||
// Barcode model
|
||||
implementation 'com.google.mlkit:barcode-scanning:16.0.2'
|
||||
implementation 'com.google.mlkit:barcode-scanning:16.0.3'
|
||||
|
||||
// Object feature and model
|
||||
implementation 'com.google.mlkit:object-detection:16.2.0'
|
||||
implementation 'com.google.mlkit:object-detection:16.2.1'
|
||||
// Custom model
|
||||
implementation 'com.google.mlkit:object-detection-custom:16.2.0'
|
||||
implementation 'com.google.mlkit:object-detection-custom:16.2.1'
|
||||
|
||||
api 'com.google.guava:guava:27.1-jre'
|
||||
}
|
||||
|
||||
@ -28,15 +28,15 @@ android {
|
||||
dependencies {
|
||||
implementation project(':internal:chooserx')
|
||||
implementation project(":internal:lintchecks")
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72"
|
||||
|
||||
implementation 'androidx.media:media:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
|
||||
implementation 'com.google.mlkit:smart-reply:16.1.0'
|
||||
implementation 'com.google.mlkit:smart-reply:16.1.1'
|
||||
|
||||
implementation 'com.google.guava:guava:27.0.1-android'
|
||||
implementation 'de.hdodenhof:circleimageview:3.1.0'
|
||||
|
||||
@ -9,7 +9,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
||||
@ -52,7 +52,7 @@ dependencies {
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'androidx.core:core-ktx:1.3.1'
|
||||
implementation 'androidx.fragment:fragment-ktx:1.2.5'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
|
||||
testImplementation 'junit:junit:4.13'
|
||||
@ -67,8 +67,8 @@ dependencies {
|
||||
implementation "androidx.camera:camera-view:1.0.0-alpha12"
|
||||
|
||||
// Add ML Kit dependencies
|
||||
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.0'
|
||||
implementation 'com.google.mlkit:language-id:16.1.0'
|
||||
implementation 'com.google.mlkit:translate:16.1.0'
|
||||
implementation 'com.google.android.gms:play-services-mlkit-text-recognition:16.1.1'
|
||||
implementation 'com.google.mlkit:language-id:16.1.1'
|
||||
implementation 'com.google.mlkit:translate:16.1.1'
|
||||
}
|
||||
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
|
||||
|
||||
@ -24,7 +24,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.0.0'
|
||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.1'
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
|
||||
@ -43,17 +43,17 @@ dependencies {
|
||||
implementation project(':internal:chooserx')
|
||||
implementation project(":internal:lintchecks")
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.61"
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
|
||||
|
||||
implementation 'androidx.media:media:1.1.0'
|
||||
implementation 'com.google.android.material:material:1.2.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.0'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.1.0'
|
||||
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
|
||||
implementation 'org.apache.commons:commons-collections4:4.4'
|
||||
implementation 'com.google.guava:guava:27.1-android'
|
||||
|
||||
implementation 'com.google.mlkit:translate:16.1.0'
|
||||
implementation 'com.google.mlkit:translate:16.1.1'
|
||||
|
||||
testImplementation 'junit:junit:4.13'
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ buildscript {
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#Thu Oct 31 13:31:48 EDT 2019
|
||||
#Mon Aug 24 23:14:21 PDT 2020
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user