diff --git a/examples/face_stylizer/android/app/build.gradle b/examples/face_stylizer/android/app/build.gradle index 903560ab..b3255567 100644 --- a/examples/face_stylizer/android/app/build.gradle +++ b/examples/face_stylizer/android/app/build.gradle @@ -43,7 +43,7 @@ project.ext.TEST_ASSETS_DIR = projectDir.toString() + '/src/androidTest/assets' // Download default models; if you wish to use your own models then // place them in the "assets" directory and comment out this line. -//apply from: 'download_models.gradle' +apply from: 'download_models.gradle' dependencies { @@ -55,5 +55,5 @@ dependencies { androidTestImplementation 'androidx.test.ext:junit:1.1.4' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' - implementation 'com.google.mediapipe:tasks-vision:0.1.0-alpha-7' + implementation 'com.google.mediapipe:tasks-vision:0.10.5' } diff --git a/examples/face_stylizer/android/app/download_models.gradle b/examples/face_stylizer/android/app/download_models.gradle index 6bde653b..3869bd78 100644 --- a/examples/face_stylizer/android/app/download_models.gradle +++ b/examples/face_stylizer/android/app/download_models.gradle @@ -15,20 +15,20 @@ */ task downloadColorInkTask(type: Download) { - src '' - dest project.ext.TEST_ASSETS_DIR + '/face_stylizer_color_ink.task' + src 'https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_color_ink.task' + dest project.ext.ASSET_DIR + '/face_stylizer_color_ink.task' overwrite false } task downloadColorSketchTask(type: Download) { - src '' - dest project.ext.TEST_ASSETS_DIR + '/face_stylizer_color_sketch.task' + src 'https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_color_sketch.task' + dest project.ext.ASSET_DIR + '/face_stylizer_color_sketch.task' overwrite false } task downloadOilPainting(type: Download) { - src '' - dest project.ext.TEST_ASSETS_DIR + '/face_stylizer_oil_painting.task' + src 'https://storage.googleapis.com/mediapipe-models/face_stylizer/blaze_face_stylizer/float32/latest/face_stylizer_oil_painting.task' + dest project.ext.ASSET_DIR + '/face_stylizer_oil_painting.task' overwrite false } diff --git a/examples/face_stylizer/android/app/src/main/java/com/google/mediapipe/examples/facestylizer/FaceStylizationHelper.kt b/examples/face_stylizer/android/app/src/main/java/com/google/mediapipe/examples/facestylizer/FaceStylizationHelper.kt index 726c8878..2ef533d2 100644 --- a/examples/face_stylizer/android/app/src/main/java/com/google/mediapipe/examples/facestylizer/FaceStylizationHelper.kt +++ b/examples/face_stylizer/android/app/src/main/java/com/google/mediapipe/examples/facestylizer/FaceStylizationHelper.kt @@ -53,7 +53,6 @@ class FaceStylizationHelper( val baseOptions = baseOptionsBuilder.build() val optionsBuilder = FaceStylizerOptions.builder() .setBaseOptions(baseOptions) - .setRunningMode(RunningMode.IMAGE) val options = optionsBuilder.build() faceStylizer = FaceStylizer.createFromOptions(context, options) diff --git a/examples/face_stylizer/android/app/src/main/java/com/google/mediapipe/examples/facestylizer/MainActivity.kt b/examples/face_stylizer/android/app/src/main/java/com/google/mediapipe/examples/facestylizer/MainActivity.kt index 553d1a0f..73ff0ce0 100644 --- a/examples/face_stylizer/android/app/src/main/java/com/google/mediapipe/examples/facestylizer/MainActivity.kt +++ b/examples/face_stylizer/android/app/src/main/java/com/google/mediapipe/examples/facestylizer/MainActivity.kt @@ -119,10 +119,10 @@ class MainActivity : AppCompatActivity(), } val image = result.stylizedFace val byteBuffer = - ByteBufferExtractor.extract(image.stylizedImage()) + ByteBufferExtractor.extract(image.stylizedImage().get()) - val width = image.stylizedImage().width - val height = image.stylizedImage().height + val width = image.stylizedImage().get().width + val height = image.stylizedImage().get().height val bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888) bitmap.copyPixelsFromBuffer(byteBuffer)