6.7.0 - Alpha12 - 剥离 Paddle OCR (PP-OCRv3) 功能; 定义 Paddle OCR 功能的 AIDL 接口约定
This commit is contained in:
28
plugin-api/paddle-ocr/build.gradle.kts
Normal file
28
plugin-api/paddle-ocr/build.gradle.kts
Normal 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
|
||||
}
|
||||
}
|
||||
0
plugin-api/paddle-ocr/consumer-rules.pro
Normal file
0
plugin-api/paddle-ocr/consumer-rules.pro
Normal 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);
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package org.autojs.plugin.paddle.ocr;
|
||||
|
||||
parcelable OcrResult {
|
||||
String text;
|
||||
float confidence;
|
||||
android.graphics.Rect bounds;
|
||||
android.os.Bundle extras;
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user