Git Product home page Git Product logo

paddle-lite-demo's Introduction

Paddle-Lite-Demo

功能

  • iOS示例: 静态图像目标分类和视频流目标分类;
  • Android示例: 基于MobileNetV1的图像分类示例程序;

要求

  • iOS

    • Mac机器,需要有xcode环境(已验证:Xcode Version 10.1 (10B61)
    • 对于ios 12.x版本,如果提示“xxx. which may not be supported by this version of Xcode”,请下载对应的工具包, 下载完成后解压放到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport目录,重启xcode
  • Android

    • Android Studio 3.4
    • Android手机或开发版,NPU功能暂时只在麒麟810芯片的华为手机(如Nova5系列)进行了测试,使用前请将EMUI更新到最新版本;

    目前,由于NPU暂时需要full publish so lib模式下编译的libpaddle_lite_jni.so(相比tiny publish so lib模式下编译的libpaddle_lite_jni.so,文件尺寸会大很多),且需要在当前PaddleLite源码基础上做一些额外的修改,因此,建议用户暂时使用本DEMO中自带的libpaddle_lite_jni.so测试NPU功能。与此同时,我们也很快会对tiny publish so模式下编译的libpaddle_lite_jni.so增加NPU的支持,并且和华为合作进一步压缩HIAI so库的大小,向用户提供更加轻量级的so库。 如果你只想测试CPU的预测能力,且又非常在意so库的大小,建议参考Paddle Lite源码中自带的DEMO完成tiny publish so lib模式下libpaddle_lite_jni.so的编译、自带DEMO的Android工程的导入、编译和测试等工作。

安装

$ git clone https://github.com/PaddlePaddle/Paddle-Lite-Demo

  • iOS

    • 打开xcode,点击“Open another project…”打开Paddle-Lite-Demo/ios-classification_demo/目录下的xcode工程;
    • 在选中左上角“project navigator”,选择“classification_demo”,修改“General”信息;
    • 插入ios真机(已验证:iphone8, iphonexr),选择Device为插入的真机;
    • 点击左上角“build and run”按钮;
  • Android

    • 打开Android Studio,在"Welcome to Android Studio"窗口点击"Open an existing Android Studio project",在弹出的路径选择窗口中进入"PaddleLite-android-demo"目录,然后点击右下角的"Open"按钮即可导入工程
    • 通过USB连接Android手机或开发版;
    • 载入工程后,点击菜单栏的Run->Run 'App'按钮,在弹出的"Select Deployment Target"窗口选择已经连接的Android设备,然后点击"OK"按钮;
    • 手机上会出现Demo的主界面,选择第一个"Image Classification"图标,进入基于MobileNetV1的图像分类Demo,注:"Object Detection"的Demo正在开发中,请忽略;
    • 在图像分类Demo中,默认会载入一张猫的图像,并会在图像下方给出CPU的预测结果,如果你使用的是麒麟810芯片的华为手机(如Nova5系列),可以通过按下右上角的"NPU"按钮切换成NPU进行预测;
    • 在图像分类Demo中,你还可以通过上方的"Gallery"和"Take Photo"按钮从相册或相机中加载测试图像;

效果展示

  • iOS

    • 静态图识别

    • 动态图识别

  • Android

    • CPU预测结果(测试环境:华为nova5)

    • NPU预测结果(测试环境:华为nova5)

paddle-lite-demo's People

Contributors

hong19860320 avatar raindrops2sea avatar xyoungli avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.