Giter Site home page Giter Site logo

sajidmeo / android-machine-learning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anujdutt9/android-machine-learning

0.0 0.0 0.0 157.33 MB

Android Machine Learning using TF-Mobile and TF-Lite.

Java 28.48% Kotlin 0.24% Python 70.02% Shell 0.42% Jupyter Notebook 0.84%

android-machine-learning's Introduction

Android-Machine-Learning

This repository contains the Machine Learning Model training code as well as the trained model deployment to Android app code. The model deployment is done using TF-Mobile and TF-Lite.

To load and test the TFLite model locally, use the following code:

import numpy as np
import tensorflow as tf

# Load TFLite model and allocate tensors.
interpreter = tf.lite.Interpreter(model_path="converted_model.tflite")
interpreter.allocate_tensors()

# Get input and output tensors.
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()

# Test model on random input data.
input_shape = input_details[0]['shape']
input_data = np.array(np.random.random_sample(input_shape), dtype=np.float32)
interpreter.set_tensor(input_details[0]['index'], input_data)

interpreter.invoke()

# The function `get_tensor()` returns a copy of the tensor data.
# Use `tensor()` in order to get a pointer to the tensor.
output_data = interpreter.get_tensor(output_details[0]['index'])
print(output_data)

Source: https://www.tensorflow.org/lite/guide/inference#load_and_run_a_model_in_python

Requirements

1. Tensorflow 1.13

2. Jupyter Notebook / PyCharm CE

3. Android Studio

4. Python 3+

Project List

Name Aim Status
Kotlin Basics Basics of Kotlin language in Android Studio. Completed
BasicUI Just playing around app to get familiar with UI design in Android. Completed
TensorFlow Basics Basics of TensorFlow in Python. Completed
TensorFlow Estimator API Basics of TensorFlow Estimator API and creating a custom Estimator API. Completed
Linear-Regression Linear Regression model in TensorFlow with Android app code. Completed
Handwritten_Digit_Recognition Linear Regression Model in TensorFlow for MNIST Image classification on Android. Completed
Artistic-Style-Transfer Artistic Style Transfer on Image on Android. Completed
Weather-Prediction Android app with TensorFlow code for making weather predictions. Completed

android-machine-learning's People

Contributors

anujdutt9 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.