sample-tensorflow-imageclassifier | Classify camera images locally using TensorFlow | Computer Vision library
kandi X-RAY | sample-tensorflow-imageclassifier Summary
kandi X-RAY | sample-tensorflow-imageclassifier Summary
When a button is pushed or when the touchscreen is touched, the current image is captured from the camera. The image is then converted and piped into a TensorFlow Lite classifier model that identifies what is in the image. Up to three results with the highest confidence returned by the classifier are shown on the screen, if there is an attached display. Also, the result is spoken out loud using Text-To-Speech to the default audio output. This project is based on the TensorFlow Android Camera Demo TF_Classify app and was adapted to use TensorFlow Lite, a lightweight version of TensorFlow targeted at mobile devices. The TensorFlow classifier model is MobileNet_v1 pre-trained on the ImageNet ILSVRC2012 dataset.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Called when an image is available
- Converts a bitmap into a byte buffer
- Looks to see if there are enough room to be played
- Crop and resize the image
- Initialize camera
- Initializes the GPIO pins
- Dumps all supported camera formats
- Get the first available camera ID
- Closes the background thread
- Close the camera resources
- Initialize the camera
- Read labels from a file
- Trigger a capture request
- Loads a model file
- Takes a camera photo
- Handle key up
sample-tensorflow-imageclassifier Key Features
sample-tensorflow-imageclassifier Examples and Code Snippets
Community Discussions
Trending Discussions on sample-tensorflow-imageclassifier
QUESTION
I've built a image classifier using Tensorflow which I am running on Android using the Android Tensorflow library. My issue is that when classifying an image on Android the predicted class is completely off. But when classifying the image using Python with the same model the predicted class is correct.
The below method is how I am converting my bitmap into an array of RGB pixel values.(which I've taken from sample-tensorflow-imageclassifier and here).
...ANSWER
Answered 2018-Feb-05 at 01:15Turned out that the RGB channels were reversed by Bitmap.getPixels so changing to BGR worked.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sample-tensorflow-imageclassifier
Wait until the LED turns on
Point the camera to something like a dog, cat or a furniture
Push the button to take a picture
The LED should go off while running. In a Raspberry Pi 3, it takes about 500 millisecond to capture the picture and run it through TensorFlow, and some extra time to speak the results through Text-To-Speech
Inference results will show in logcat and, if there is a display connected, both the image and the results will be shown
If a speaker or headphones are connected, the results will be spoken via text to speech
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page