Giter Site home page Giter Site logo

lobe / android-bootstrap Goto Github PK

View Code? Open in Web Editor NEW
60.0 60.0 27.0 33.57 MB

Bootstrap your Lobe machine learning model with our Android project.

Home Page: https://lobe.ai

License: Other

Kotlin 66.92% Java 33.08%
android-studio bootstrap kotlin lobe machine-learning

android-bootstrap's Introduction

Lobe

Lobe is an easy-to-use tool that helps you train machine learning models on your own computer, for free, without any prior experience required. It runs locally on both Mac and PC, and you can ship your model to any platform you choose.

Download it for free to get started on your machine learning model today.

Machine Learning Made Easy

Lobe takes a new humane approach to machine learning by putting your images in the foreground and receding to the background, serving as the main bridge between your ideas and your machine learning model.

Lobe also simplifies the process of machine learning into three easy steps. Collect and label your images. Train and understand your results. Then play with your model and improve it.

image

android-bootstrap's People

Contributors

adammenges avatar filipmares avatar jakecohenmicrosoft avatar lemillermicrosoft avatar mbeissinger avatar ogabrielluiz avatar ramongilabert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-bootstrap's Issues

Andorid with lobe.ai tutorial

Dear Developers,

I would like to use your sample Android Starter kit with lobe.ai, but I'm not an expert, so based on the readme.txt file I cannot install the Starter.

What I did so far:
0) I have trained model files from lobe.ai and export to saved_model.tflite & signature.json

  1. Installed Android Studio
  2. Cloned the code from here: https://github.com/lobe/android-bootstrap.git (when the Studio starts, I choose VCS option).

From here I cannot step forward. After cloning no PLAY button and seems Gradle doesn't start automatically to download the necessary files.

Can you please give me a more detailed process steps?

Thank you very much for your time and efforts.

App crashes with "x + width must be <= bitmap.width()" Error on Google Pixel 2

2021-02-12 02:31:50.669 22168-22233/com.example.test E/AndroidRuntime: FATAL EXCEPTION: inference
Process: com.example.test, PID: 22168
java.lang.IllegalArgumentException: x + width must be <= bitmap.width()
        at android.graphics.Bitmap.createBitmap(Bitmap.java:876)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:836)
        at com.example.test.DetectorActivity$processImage$1.run(DetectorActivity.kt:200)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.os.HandlerThread.run(HandlerThread.java:67)

I've cloned the source, installed everything and was able to install the app on my phone. But when I run it I get this error in my logcat. First I though I need to replace the ml model with my own, but after replacing it the error stayed.

The problem seems to be here: https://github.com/lobe/android-bootstrap/blob/main/lobe_android/app/src/main/java/com/example/test/DetectorActivity.kt#L195

rawBitmap = Bitmap.createBitmap(rotatedBitmap, 0, 0, w.toInt(), rotatedBitmap.height)

I'm testing it on a Google Pixel 2 with Android 11, API 30 and also a LGE Nexus 5X Android 8.1.0, API 27 with the same result on both devices.

Rest of logcat

2021-02-12 02:31:49.598 22168-22168/? I/om.example.tes: Late-enabling -Xcheck:jni
2021-02-12 02:31:49.621 22168-22168/? I/om.example.tes: Unquickening 12 vdex files!
2021-02-12 02:31:49.758 22168-22168/com.example.test D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-02-12 02:31:49.759 22168-22168/com.example.test D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-02-12 02:31:49.860 22168-22168/com.example.test I/CameraManagerGlobal: Connecting to camera service
2021-02-12 02:31:49.912 22168-22168/com.example.test D/tensorflow: CameraActivity: onStart com.example.test.DetectorActivity@47e81ce
2021-02-12 02:31:49.916 22168-22168/com.example.test D/tensorflow: CameraActivity: onResume com.example.test.DetectorActivity@47e81ce
2021-02-12 02:31:49.951 22168-22230/com.example.test I/AdrenoGLES-0: QUALCOMM build                   : 02fe52e, Ie73904e3bd
    Build Date                       : 06/27/20
    OpenGL ES Shader Compiler Version: EV031.31.04.00
    Local Branch                     : gfx-adreno.lnx.2.0
    Remote Branch                    : quic/gfx-adreno.lnx.2.0
    Remote Branch                    : NONE
    Reconstruct Branch               : NOTHING
2021-02-12 02:31:49.951 22168-22230/com.example.test I/AdrenoGLES-0: Build Config                     : S L 10.0.5 AArch64
2021-02-12 02:31:49.951 22168-22230/com.example.test I/AdrenoGLES-0: Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so
2021-02-12 02:31:49.954 22168-22230/com.example.test I/AdrenoGLES-0: PFP: 0x005ff112, ME: 0x005ff066
2021-02-12 02:31:49.957 22168-22230/com.example.test W/AdrenoUtils: <ReadGpuID_from_sysfs:197>: Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model
2021-02-12 02:31:49.957 22168-22230/com.example.test W/AdrenoUtils: <ReadGpuID:221>: Failed to read chip ID from gpu_model. Fallback to use the GSL path
2021-02-12 02:31:50.037 22168-22168/com.example.test I/tensorflow: CameraConnectionFragment: Desired size: 1280x960, min size: 960x960
2021-02-12 02:31:50.037 22168-22168/com.example.test I/tensorflow: CameraConnectionFragment: Valid preview sizes: []
2021-02-12 02:31:50.037 22168-22168/com.example.test I/tensorflow: CameraConnectionFragment: Rejected preview sizes: [1280x720]
2021-02-12 02:31:50.037 22168-22168/com.example.test E/tensorflow: CameraConnectionFragment: Couldn't find any suitable preview size
2021-02-12 02:31:50.057 22168-22217/com.example.test I/Gralloc4: mapper 4.x is not supported
2021-02-12 02:31:50.057 22168-22217/com.example.test W/Gralloc3: mapper 3.x is not supported
2021-02-12 02:31:50.064 22168-22217/com.example.test W/Gralloc4: allocator 3.x is not supported
2021-02-12 02:31:50.064 22168-22217/com.example.test W/Gralloc3: allocator 3.x is not supported
2021-02-12 02:31:50.274 22168-22168/com.example.test D/tensorflow: DetectorActivity: Creating classifier (model=FLOAT_MOBILENET, device=CPU, numThreads=4)
2021-02-12 02:31:50.285 22168-22168/com.example.test I/tflite: Initialized TensorFlow Lite runtime.
2021-02-12 02:31:50.294 22168-22168/com.example.test D/tensorflow: Classifier: Created a Tensorflow Lite Image Classifier.
2021-02-12 02:31:50.295 22168-22168/com.example.test I/tensorflow: DetectorActivity: Camera orientation relative to screen canvas: 90
2021-02-12 02:31:50.296 22168-22168/com.example.test I/tensorflow: DetectorActivity: Initializing at size 1280x720
2021-02-12 02:31:50.667 22168-22233/com.example.test D/INFO: 1919
2021-02-12 02:31:50.668 22168-22233/com.example.test D/INFO: 3189
2021-02-12 02:31:50.668 22168-22233/com.example.test D/INFO: 1794
2021-02-12 02:31:50.669 22168-22233/com.example.test E/AndroidRuntime: FATAL EXCEPTION: inference
    Process: com.example.test, PID: 22168
    java.lang.IllegalArgumentException: x + width must be <= bitmap.width()
        at android.graphics.Bitmap.createBitmap(Bitmap.java:876)
        at android.graphics.Bitmap.createBitmap(Bitmap.java:836)
        at com.example.test.DetectorActivity$processImage$1.run(DetectorActivity.kt:200)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.os.HandlerThread.run(HandlerThread.java:67)
2021-02-12 02:31:50.685 22168-22233/com.example.test I/Process: Sending signal. PID: 22168 SIG: 9

Can't Insert Own Model

The app works great with the default model but when I insert my own and try to run it I get a black screen and the green bar says default. If I exit and come back in it crashes. The steps I followed are:

  1. Renamed my model "model_unquant"
  2. replaced the old one in "*\android-bootstrap\lobe_android\app\src\main\assets"
  3. change the text in labels.txt to the labels my model uses.

Any plans with Flutter?

Do you plan to publish a Flutter (Dart) plugin?
It would be great if you plan to support the great cross-platform framework Flutter.

P.S. On my mind, you could port android-bootstrap and iOS-bootstrap to the one flutter-bootstrap plugin.

Update: If you want to try exported model from Lobe with Flutter you could do it with TensorFlow Lite support for Android and iOS both. Check this article on Medium and project.

The header picture is unecessarily large

The header.png picture weighs 3.5 MB. A JPG picture would give no visible quality loss and would weigh much less (making the readme nicer to read for slow Internet connections) : doing a quick conversion I found that the equivalent JPG image would be around 500 KB.

Variable for image identification

Hello,

I'd like to use this app to send some bits out of the USB port on my phone when a certain object from my Lobe model is identified. I've been looking through the script to find a variable that shows when an object is identified but I cant find it. I was wondering if anyone could shed some light on this for me. It should be pretty straightforward to send some bits out the USB once I've found the variable to use a trigger.

Thanks!

error: cannot find symbol

/android-bootstrap/lobe_android/app/src/main/java/com/example/test/tflite/
TFLiteObjectDetectionAPIModel.java:266: error: cannot find symbol
if (tfLite != null) tfLite.setUseNNAPI(isChecked);
^
symbol: method setUseNNAPI(boolean)
location: variable tfLite of type Interpreter

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.