6.7.0 - Alpha12 - 剥离 Paddle OCR (PP-OCRv3) 功能; 定义 Paddle OCR 功能的 AIDL 接口约定

This commit is contained in:
SuperMonster003
2025-11-28 14:26:54 +08:00
parent a2b47cf6c8
commit 42ee329092
68 changed files with 357 additions and 16644 deletions

View File

@@ -0,0 +1,28 @@
plugins {
id("org.autojs.build.versions")
id("org.autojs.build.jvm-convention")
id("com.android.library")
id("org.jetbrains.kotlin.android")
kotlin("plugin.parcelize")
}
android {
namespace = "org.autojs.plugin.paddle.ocr"
compileSdk = versions.sdkVersionCompile
defaultConfig {
minSdk = versions.sdkVersionMin
consumerProguardFiles("consumer-rules.pro")
}
lint {
targetSdk = versions.sdkVersionTarget
abortOnError = false
}
buildFeatures {
aidl = true
buildConfig = false
}
}

View File

View File

@@ -0,0 +1,16 @@
package org.autojs.plugin.paddle.ocr;
import org.autojs.plugin.paddle.ocr.PluginInfo;
import org.autojs.plugin.paddle.ocr.OcrOptions;
import org.autojs.plugin.paddle.ocr.OcrResult;
import android.os.ParcelFileDescriptor;
interface IOcrPlugin {
PluginInfo getInfo();
List<String> recognizeText(in ParcelFileDescriptor imageFd, in OcrOptions options);
List<OcrResult> detect(in ParcelFileDescriptor imageFd, in OcrOptions options);
}

View File

@@ -0,0 +1,10 @@
package org.autojs.plugin.paddle.ocr;
parcelable OcrOptions {
int cpuThreadNum;
boolean useSlim;
boolean useOpenCL;
int detLongSize;
float scoreThreshold;
android.os.Bundle extras;
}

View File

@@ -0,0 +1,8 @@
package org.autojs.plugin.paddle.ocr;
parcelable OcrResult {
String text;
float confidence;
android.graphics.Rect bounds;
android.os.Bundle extras;
}

View File

@@ -0,0 +1,24 @@
package org.autojs.plugin.paddle.ocr;
parcelable PluginInfo {
String name;
@nullable String description;
String author;
@nullable String[] collaborators;
String versionName;
long versionCode;
@nullable String versionDate;
/** @example "paddle-ocr-v5" */
@nullable String id;
/** @sample "paddle-ocr" */
@nullable String engine;
/** @sample "v5" */
@nullable String variant;
@nullable android.os.Bundle capabilities;
}