วันจันทร์ที่ 13 มีนาคม พ.ศ. 2560

Machine Learning Tensorflow Android App Demo


Machine Learning TensorFlow Android App Demo

What is TensorFlow?
TensorFlow is open source machine learning library from Google. Computation code is written in C++, but programmers can write their TensorFlow software in either C++ or Python and implemented for CPUs ,GPUs or both.


In November 2015, Google announced and open sourced TensorFlow, its latest and greatest machine learning library. This is a big deal for three reasons:
  1. Machine Learning expertise: Google is a dominant force in machine learning. Its prominence in search owes a lot to the strides it achieved in machine learning.
  2. Scalable : the announcement noted that TensorFlow was initially designed for internal use and that it’s already in production for some live product features.
  3. Ability to run on Mobile.
This last reason is the operating reason for this post since we’ll be focusing on Android. If you examine the tensorflow repo on GitHub, you’ll find a little tensorflow/examples/android directory. I’ll try to shed some light on the Android TensorFlow example and some of the things going on under the hood.



Install TensorFlow on your System ( PC or Notebook , Windows or mac )

It has many method to install

  • virtualenv
  • pip
  • Docker
  • installing from sources

We use pip method first.



Installing with native pip


Python
In order to install TensorFlow, your system must contain one of the following Python versions:

  • Python 2.7
  • Python 3.3+

Pip installs and manages software packages written in Python. If you intend to install with native pip, then one of the following flavors of pip must be installed on your system:
  • pip, for Python 2.7
  • pip3, for Python 3.n.
pip or pip3 was probably installed on your system when you installed Python. To determine whether pip or pip3 is actually installed on your system, issue one of the following commands:
$ pip -V  # for Python 2.7
$ pip3 -V # for Python 3.n 

We strongly recommend pip or pip3 version 8.1 or higher in order to install TensorFlow. If pip or pip3 8.1 or later is not installed, issue the following commands to install or upgrade:
$ sudo easy_install --upgrade pip
$ sudo easy_install --upgrade six 

Install Bazel
https://bazel.build/versions/master/docs/install.html

Building the Demo from Source

git clone --recurse-submodules https://github.com/tensorflow/tensorflow.git


Build the Android APK 
$ cd ~/tensorflow
$ bazel build //tensorflow/examples/android:tensorflow_demo

Install the APK to Android devices
$ adb install -r -g bazel-bin/tensorflow/examples/android/tensorflow_demo.apk

Reference



วันอาทิตย์ที่ 8 มกราคม พ.ศ. 2560

Android Gauge View Example Code


Android Gauge View Example Code

We have  test 3 example source code.
1.GaugeView
2.CustomGauge
3.SC-widgets


 

GaugeView


An Android library for drawing gauges on Canvas.
https://github.com/CodeAndMagic/GaugeView


 

CustomGauge



update some code in build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }
}


SC-widgets


This is a library of widgets.
The 2.x version change completely the way to draw using the ScDrawer as base for create the ScGauge and all classes inherited from it. This using a path to follow and applying some features to draw extra on the path. This way to think leaves a lot of freedom to the users to create particular components limited only by his imagination.
https://github.com/Paroca72/sc-widgets


My Website
email : info@softpowergroup.net   Tel .081-6452400