思路:
在电脑端调用mnist数据集,构建深度卷积神经网络模型,使用TensorFlow进行训练,达到99%+的测试集数据准确率,继而把模型迁移到App端。具体迁移教程参考之前的文章:
https://mp.csdn.net/postedit/85016120这是模型迁移的教程
https://mp.csdn.net/postedit/85009068这是训练神经网络的代码
下面详细讲解本项目的具体实施方式:
搭建环境就不多说了,之前的文章讲解的很清楚。
训练模型的过程也不多说了,之前的文章有详细的代码可以参考。
一、界面设计
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp">
<TextView
android:layout_weight="1"
android:id="@+id/txt_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="12pt"/>
<ImageView
android:layout_weight="6"
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:id="@+id/btn_mnist"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="wrap_content"