Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
天天代码码天天
PaddleOCR
提交
7a32e25c
P
PaddleOCR
项目概览
天天代码码天天
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7a32e25c
编写于
4月 09, 2021
作者:
W
WenmuZhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update edittext to list
上级
6a160e97
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
21 addition
and
18 deletion
+21
-18
deploy/android_demo/app/src/main/assets/images/0.jpg
deploy/android_demo/app/src/main/assets/images/0.jpg
+0
-0
deploy/android_demo/app/src/main/java/com/baidu/paddle/lite/demo/ocr/MiniActivity.java
...ain/java/com/baidu/paddle/lite/demo/ocr/MiniActivity.java
+1
-1
deploy/android_demo/app/src/main/java/com/baidu/paddle/lite/demo/ocr/SettingsActivity.java
...java/com/baidu/paddle/lite/demo/ocr/SettingsActivity.java
+4
-4
deploy/android_demo/app/src/main/res/menu/menu_action_options.xml
...ndroid_demo/app/src/main/res/menu/menu_action_options.xml
+0
-11
deploy/android_demo/app/src/main/res/values/arrays.xml
deploy/android_demo/app/src/main/res/values/arrays.xml
+12
-0
deploy/android_demo/app/src/main/res/values/strings.xml
deploy/android_demo/app/src/main/res/values/strings.xml
+1
-1
deploy/android_demo/app/src/main/res/xml/settings.xml
deploy/android_demo/app/src/main/res/xml/settings.xml
+3
-1
未找到文件。
deploy/android_demo/app/src/main/assets/images/
5
.jpg
→
deploy/android_demo/app/src/main/assets/images/
0
.jpg
浏览文件 @
7a32e25c
文件已移动
deploy/android_demo/app/src/main/java/com/baidu/paddle/lite/demo/ocr/MiniActivity.java
浏览文件 @
7a32e25c
...
...
@@ -131,7 +131,7 @@ public class MiniActivity extends AppCompatActivity {
*/
private
boolean
onRunModel
()
{
try
{
String
assetImagePath
=
"images/
5
.jpg"
;
String
assetImagePath
=
"images/
0
.jpg"
;
InputStream
imageStream
=
getAssets
().
open
(
assetImagePath
);
Bitmap
image
=
BitmapFactory
.
decodeStream
(
imageStream
);
// Input is Bitmap
...
...
deploy/android_demo/app/src/main/java/com/baidu/paddle/lite/demo/ocr/SettingsActivity.java
浏览文件 @
7a32e25c
...
...
@@ -17,7 +17,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
CheckBoxPreference
cbEnableCustomSettings
=
null
;
EditTextPreference
etModelPath
=
null
;
EditTextPreference
etLabelPath
=
null
;
EditTex
tPreference
etImagePath
=
null
;
Lis
tPreference
etImagePath
=
null
;
ListPreference
lpCPUThreadNum
=
null
;
ListPreference
lpCPUPowerMode
=
null
;
ListPreference
lpInputColorFormat
=
null
;
...
...
@@ -84,7 +84,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
etModelPath
=
(
EditTextPreference
)
findPreference
(
getString
(
R
.
string
.
MODEL_PATH_KEY
));
etModelPath
.
setTitle
(
"Model Path (SDCard: "
+
Utils
.
getSDCardDirectory
()
+
")"
);
etLabelPath
=
(
EditTextPreference
)
findPreference
(
getString
(
R
.
string
.
LABEL_PATH_KEY
));
etImagePath
=
(
EditTex
tPreference
)
findPreference
(
getString
(
R
.
string
.
IMAGE_PATH_KEY
));
etImagePath
=
(
Lis
tPreference
)
findPreference
(
getString
(
R
.
string
.
IMAGE_PATH_KEY
));
lpCPUThreadNum
=
(
ListPreference
)
findPreference
(
getString
(
R
.
string
.
CPU_THREAD_NUM_KEY
));
lpCPUPowerMode
=
...
...
@@ -119,7 +119,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
editor
.
putString
(
getString
(
R
.
string
.
INPUT_STD_KEY
),
preInstalledInputStds
.
get
(
modelIdx
));
editor
.
putString
(
getString
(
R
.
string
.
SCORE_THRESHOLD_KEY
),
preInstalledScoreThresholds
.
get
(
modelIdx
));
editor
.
commit
();
editor
.
apply
();
}
lpChoosePreInstalledModel
.
setSummary
(
modelPath
);
}
...
...
@@ -159,7 +159,7 @@ public class SettingsActivity extends AppCompatPreferenceActivity implements Sha
etLabelPath
.
setSummary
(
labelPath
);
etLabelPath
.
setText
(
labelPath
);
etImagePath
.
setSummary
(
imagePath
);
etImagePath
.
set
Text
(
imagePath
);
etImagePath
.
set
Value
(
imagePath
);
lpCPUThreadNum
.
setValue
(
cpuThreadNum
);
lpCPUThreadNum
.
setSummary
(
cpuThreadNum
);
lpCPUPowerMode
.
setValue
(
cpuPowerMode
);
...
...
deploy/android_demo/app/src/main/res/menu/menu_action_options.xml
浏览文件 @
7a32e25c
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<group
android:id=
"@+id/pick_image"
>
<item
android:id=
"@+id/open_gallery"
android:title=
"Open Gallery"
app:showAsAction=
"withText"
/>
<item
android:id=
"@+id/take_photo"
android:title=
"Take Photo"
app:showAsAction=
"withText"
/>
</group>
<group>
<item
...
...
deploy/android_demo/app/src/main/res/values/arrays.xml
浏览文件 @
7a32e25c
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array
name=
"image_name_entries"
>
<item>
0.jpg
</item>
<item>
90.jpg
</item>
<item>
180.jpg
</item>
<item>
270.jpg
</item>
</string-array>
<string-array
name=
"image_name_values"
>
<item>
images/0.jpg
</item>
<item>
images/90.jpg
</item>
<item>
images/180.jpg
</item>
<item>
images/270.jpg
</item>
</string-array>
<string-array
name=
"cpu_thread_num_entries"
>
<item>
1 threads
</item>
<item>
2 threads
</item>
...
...
deploy/android_demo/app/src/main/res/values/strings.xml
浏览文件 @
7a32e25c
...
...
@@ -14,7 +14,7 @@
<string
name=
"SCORE_THRESHOLD_KEY"
>
SCORE_THRESHOLD_KEY
</string>
<string
name=
"MODEL_PATH_DEFAULT"
>
models/ocr_v2_for_cpu
</string>
<string
name=
"LABEL_PATH_DEFAULT"
>
labels/ppocr_keys_v1.txt
</string>
<string
name=
"IMAGE_PATH_DEFAULT"
>
images/
5
.jpg
</string>
<string
name=
"IMAGE_PATH_DEFAULT"
>
images/
0
.jpg
</string>
<string
name=
"CPU_THREAD_NUM_DEFAULT"
>
4
</string>
<string
name=
"CPU_POWER_MODE_DEFAULT"
>
LITE_POWER_HIGH
</string>
<string
name=
"INPUT_COLOR_FORMAT_DEFAULT"
>
BGR
</string>
...
...
deploy/android_demo/app/src/main/res/xml/settings.xml
浏览文件 @
7a32e25c
...
...
@@ -21,9 +21,11 @@
android:key=
"@string/LABEL_PATH_KEY"
android:defaultValue=
"@string/LABEL_PATH_DEFAULT"
android:title=
"Label Path"
/>
<
EditTex
tPreference
<
Lis
tPreference
android:key=
"@string/IMAGE_PATH_KEY"
android:defaultValue=
"@string/IMAGE_PATH_DEFAULT"
android:entries=
"@array/image_name_entries"
android:entryValues=
"@array/image_name_values"
android:title=
"Image Path"
/>
</PreferenceCategory>
<PreferenceCategory
android:title=
"CPU Settings"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录