This commit is contained in:
Ming Ming 2022-05-21 03:25:41 +08:00
parent eeb95258c0
commit b75c4dd2f6
2 changed files with 5 additions and 5 deletions

View file

@ -77,7 +77,7 @@ class ImageProcessorChannelHandler(context: Context) :
maxWidth: Int, maxHeight: Int, radius: Int, result: MethodChannel.Result
) = method(
fileUrl, headers, filename, maxWidth, maxHeight,
ImageProcessorService.METHOD_DEEL_LAP_PORTRAIT, result, onIntent = {
ImageProcessorService.METHOD_DEEP_LAP_PORTRAIT, result, onIntent = {
it.putExtra(ImageProcessorService.EXTRA_RADIUS, radius)
}
)

View file

@ -27,7 +27,7 @@ class ImageProcessorService : Service() {
companion object {
const val EXTRA_METHOD = "method"
const val METHOD_ZERO_DCE = "zero-dce"
const val METHOD_DEEL_LAP_PORTRAIT = "DeepLab3Portrait"
const val METHOD_DEEP_LAP_PORTRAIT = "DeepLab3Portrait"
const val EXTRA_FILE_URL = "fileUrl"
const val EXTRA_HEADERS = "headers"
const val EXTRA_FILENAME = "filename"
@ -96,7 +96,7 @@ class ImageProcessorService : Service() {
val method = intent.getStringExtra(EXTRA_METHOD)
when (method) {
METHOD_ZERO_DCE -> onZeroDce(startId, intent.extras!!)
METHOD_DEEL_LAP_PORTRAIT -> onDeepLapPortrait(
METHOD_DEEP_LAP_PORTRAIT -> onDeepLapPortrait(
startId, intent.extras!!
)
else -> {
@ -120,7 +120,7 @@ class ImageProcessorService : Service() {
private fun onDeepLapPortrait(startId: Int, extras: Bundle) {
return onMethod(
startId, extras, METHOD_DEEL_LAP_PORTRAIT, args = mapOf(
startId, extras, METHOD_DEEP_LAP_PORTRAIT, args = mapOf(
"radius" to extras.getIntOrNull(EXTRA_RADIUS)
)
)
@ -444,7 +444,7 @@ private open class ImageProcessorCommandTask(context: Context) :
fileUri
)
ImageProcessorService.METHOD_DEEL_LAP_PORTRAIT -> DeepLab3Portrait(
ImageProcessorService.METHOD_DEEP_LAP_PORTRAIT -> DeepLab3Portrait(
context, cmd.maxWidth, cmd.maxHeight,
cmd.args["radius"] as? Int ?: 16
).infer(fileUri)