Skip to content

Commit

Permalink
Updated to 0.10.5
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulTR committed Sep 14, 2023
1 parent d48f20b commit 908279e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/face_stylizer/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand All @@ -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'
}
12 changes: 6 additions & 6 deletions examples/face_stylizer/android/app/download_models.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 908279e

Please sign in to comment.