diff --git "a/app/src/main/assets/sample/7zip/rar\350\247\243\345\216\213\347\274\251/project.json" "b/app/src/main/assets/sample/7zip/rar\350\247\243\345\216\213\347\274\251/project.json" new file mode 100644 index 000000000..57f69df95 --- /dev/null +++ "b/app/src/main/assets/sample/7zip/rar\350\247\243\345\216\213\347\274\251/project.json" @@ -0,0 +1,47 @@ +{ + "abis": [ + "arm64-v8a", + "armeabi-v7a", + "x86", + "x86_64" + ], + "assets": [ + ], + "buildDir": "build", + "build": { + "build_id": null, + "build_number": 0, + "build_time": 0 + }, + "useFeatures": [], + "icon": null, + "ignoredDirs": [], + "launchConfig": { + "displaySplash": false, + "hideLauncher": false, + "hideLogs": false, + "stableMode": false, + "volumeUpcontrol": false, + "permissions": [], + "serviceDesc": "使脚本自动操作(点击、长按、滑动等)所需,若关闭则只能执行不涉及自动操作的脚本。", + "splashIcon": null, + "splashText": "Powered by 7zip" + }, + "libs": [ + "libp7zip.so", + "libjackpal-androidterm5.so", + "libjackpal-termexec2.so" + ], + "main": "rar解压缩.js", + "name": "rar解压缩", + "outputPath": null, + "packageName": "com.script.p7zip", + "scripts": {}, + "signingConfig": { + "alias": null, + "keystore": null + }, + "sourcePath": null, + "versionCode": 1, + "versionName": "1.0.0" +} \ No newline at end of file diff --git "a/app/src/main/assets/sample/7zip/rar\350\247\243\345\216\213\347\274\251.js" "b/app/src/main/assets/sample/7zip/rar\350\247\243\345\216\213\347\274\251/rar\350\247\243\345\216\213\347\274\251.js" similarity index 100% rename from "app/src/main/assets/sample/7zip/rar\350\247\243\345\216\213\347\274\251.js" rename to "app/src/main/assets/sample/7zip/rar\350\247\243\345\216\213\347\274\251/rar\350\247\243\345\216\213\347\274\251.js" diff --git "a/app/src/main/assets/sample/AI/OCR\346\210\252\345\233\276\350\257\206\345\210\253.js" "b/app/src/main/assets/sample/PaddleOCR/OCR\346\210\252\345\233\276\350\257\206\345\210\253.js" similarity index 98% rename from "app/src/main/assets/sample/AI/OCR\346\210\252\345\233\276\350\257\206\345\210\253.js" rename to "app/src/main/assets/sample/PaddleOCR/OCR\346\210\252\345\233\276\350\257\206\345\210\253.js" index c31fbba1f..b8f73547b 100644 --- "a/app/src/main/assets/sample/AI/OCR\346\210\252\345\233\276\350\257\206\345\210\253.js" +++ "b/app/src/main/assets/sample/PaddleOCR/OCR\346\210\252\345\233\276\350\257\206\345\210\253.js" @@ -106,8 +106,6 @@ window.canvas.on('draw', function (canvas) { if (result && result.length > 0) { for (let i = 0; i < result.length; i++) { let ocrResult = result[i] - log(ocrResult); - log(" | "); drawRectAndText(ocrResult.words + ' #信心:' + ocrResult.confidence.toFixed(2), ocrResult.bounds, '#00ff00', canvas, paint); } } diff --git a/app/src/main/assets/sample/AI/0.jpg b/app/src/main/assets/sample/PaddleOCR/PaddleOCR(CustomModel)/0.jpg similarity index 100% rename from app/src/main/assets/sample/AI/0.jpg rename to app/src/main/assets/sample/PaddleOCR/PaddleOCR(CustomModel)/0.jpg diff --git "a/app/src/main/assets/sample/AI/PaddleOCR(\350\207\252\345\256\232\344\271\211\346\250\241\345\236\213\350\267\257\345\276\204).js" "b/app/src/main/assets/sample/PaddleOCR/PaddleOCR(CustomModel)/PaddleOCR(\350\207\252\345\256\232\344\271\211\346\250\241\345\236\213\350\267\257\345\276\204).js" similarity index 70% rename from "app/src/main/assets/sample/AI/PaddleOCR(\350\207\252\345\256\232\344\271\211\346\250\241\345\236\213\350\267\257\345\276\204).js" rename to "app/src/main/assets/sample/PaddleOCR/PaddleOCR(CustomModel)/PaddleOCR(\350\207\252\345\256\232\344\271\211\346\250\241\345\236\213\350\267\257\345\276\204).js" index 6138c51a7..39f5b5103 100644 --- "a/app/src/main/assets/sample/AI/PaddleOCR(\350\207\252\345\256\232\344\271\211\346\250\241\345\236\213\350\267\257\345\276\204).js" +++ "b/app/src/main/assets/sample/PaddleOCR/PaddleOCR(CustomModel)/PaddleOCR(\350\207\252\345\256\232\344\271\211\346\250\241\345\236\213\350\267\257\345\276\204).js" @@ -1,8 +1,7 @@ let img = images.read("./0.jpg") let cpuThreadNum = 4 -// 新增:自定义模型路径(必须是完整路径) -// 使用时请将自定义路径 myModelPath 改为拥有读写权限的目录,并在目录里放上三个必需的模型文件: ch_ppocr_mobile_v2.0_cls_opt.nb ch_ppocr_mobile_v2.0_det_opt.nb ch_ppocr_mobile_v2.0_rec_opt.nb,否则可能引起程序崩溃。 -let myModelPath = "/sdcard/Android/data/org.autojs.autojs/models/ocr_v2_for_cpu"; +// 新增:自定义模型路径(必须是绝对路径), files.path() 将相对路径转为绝对路径 +let myModelPath = files.path("./models"); // 如果打包了自定义模型路径,则路径为"models/自定义的ocr模型文件夹名字" //let myModelPath = "models/my_ocr_models_dir"; let start = new Date() diff --git a/app/src/main/assets/sample/PaddleOCR/PaddleOCR(CustomModel)/project.json b/app/src/main/assets/sample/PaddleOCR/PaddleOCR(CustomModel)/project.json new file mode 100644 index 000000000..bca095065 --- /dev/null +++ b/app/src/main/assets/sample/PaddleOCR/PaddleOCR(CustomModel)/project.json @@ -0,0 +1,56 @@ +{ + "abis": [ + "arm64-v8a", + "armeabi-v7a", + "x86", + "x86_64" + ], + "assets": [ + { + "form": "models", + "to": "/models" + } + ], + "buildDir": "build", + "build": { + "build_id": null, + "build_number": 0, + "build_time": 0 + }, + "useFeatures": [], + "icon": null, + "ignoredDirs": [], + "launchConfig": { + "displaySplash": false, + "hideLauncher": false, + "hideLogs": false, + "stableMode": false, + "volumeUpcontrol": false, + "permissions": [], + "serviceDesc": "使脚本自动操作(点击、长按、滑动等)所需,若关闭则只能执行不涉及自动操作的脚本。", + "splashIcon": null, + "splashText": "Powered by paddle ocr" + }, + "libs": [ + "libc++_shared.so", + "libpaddle_light_api_shared.so", + "libhiai.so", + "libhiai_ir.so", + "libhiai_ir_build.so", + "libNative.so", + "libjackpal-androidterm5.so", + "libjackpal-termexec2.so" + ], + "main": "PaddleOCR(自定义模型路径).js", + "name": "PaddleOCR(自定义模型路径)", + "outputPath": null, + "packageName": "com.script.paddleocr.custommodel", + "scripts": {}, + "signingConfig": { + "alias": null, + "keystore": null + }, + "sourcePath": null, + "versionCode": 1, + "versionName": "1.0.0" +} \ No newline at end of file diff --git a/app/src/main/assets/sample/PaddleOCR/PaddleOCR/0.jpg b/app/src/main/assets/sample/PaddleOCR/PaddleOCR/0.jpg new file mode 100644 index 000000000..8517e125c Binary files /dev/null and b/app/src/main/assets/sample/PaddleOCR/PaddleOCR/0.jpg differ diff --git a/app/src/main/assets/sample/AI/PaddleOCR.js b/app/src/main/assets/sample/PaddleOCR/PaddleOCR/PaddleOCR.js similarity index 100% rename from app/src/main/assets/sample/AI/PaddleOCR.js rename to app/src/main/assets/sample/PaddleOCR/PaddleOCR/PaddleOCR.js diff --git a/app/src/main/assets/sample/PaddleOCR/PaddleOCR/project.json b/app/src/main/assets/sample/PaddleOCR/PaddleOCR/project.json new file mode 100644 index 000000000..a12c1cb7f --- /dev/null +++ b/app/src/main/assets/sample/PaddleOCR/PaddleOCR/project.json @@ -0,0 +1,56 @@ +{ + "abis": [ + "arm64-v8a", + "armeabi-v7a", + "x86", + "x86_64" + ], + "assets": [ + { + "form": "file:///android_asset/models", + "to": "/models" + } + ], + "buildDir": "build", + "build": { + "build_id": null, + "build_number": 0, + "build_time": 0 + }, + "useFeatures": [], + "icon": null, + "ignoredDirs": [], + "launchConfig": { + "displaySplash": false, + "hideLauncher": false, + "hideLogs": false, + "stableMode": false, + "volumeUpcontrol": false, + "permissions": [], + "serviceDesc": "使脚本自动操作(点击、长按、滑动等)所需,若关闭则只能执行不涉及自动操作的脚本。", + "splashIcon": null, + "splashText": "Powered by paddle ocr" + }, + "libs": [ + "libc++_shared.so", + "libpaddle_light_api_shared.so", + "libhiai.so", + "libhiai_ir.so", + "libhiai_ir_build.so", + "libNative.so", + "libjackpal-androidterm5.so", + "libjackpal-termexec2.so" + ], + "main": "PaddleOCR.js", + "name": "PaddleOCR", + "outputPath": null, + "packageName": "com.script.paddleocr", + "scripts": {}, + "signingConfig": { + "alias": null, + "keystore": null + }, + "sourcePath": null, + "versionCode": 1, + "versionName": "1.0.0" +} \ No newline at end of file