手写数字识别--Android Studio 加载tensorflow模型

本文介绍了如何将训练好的TensorFlow深度卷积神经网络模型迁移并应用于Android App中进行手写数字识别。首先,通过链接提供了模型训练和迁移的教程。接着,详细讲解了Android Studio中的界面设计,包括TextView、ImageView和两个Button的设置。点击按钮后,应用会读取图片,使用预加载的模型进行预测并显示结果。最后,文章指出尽管识别存在误差,但模型已成功运行,并表达了对模型改进的期望。
摘要由CSDN通过智能技术生成

思路:

    在电脑端调用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"
     
  • 4
    点赞
  • 45
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值