Is it possible to not use the camera activity and load the images from gallery for object detection using Tensorflow object detection API?
Obviously yes!
When you use the camera (not talking about real-time image detection, such as using Yolo with Tensorflow), you take a snapshot image and then you process that bitmap with Tensorflow. Instead of that, what you can do is, select an image from the gallery, convert it to bitmap and then process it using Tensorflow.
If you further need example or sample, I would be happy to help you out. But for that make sure you post or show what you've done or tried so far.
Related
Hi i want to try myself on object detection on Android in images not in live camera previews and i've seen that there is tensorflow lite. Sadly the tutorials i could find are all for live camera previews and not for images. So does anyone know about a tutorial or something for tensorflow lite or some other way to detect objects in images, that could teach me how to do basic object detection?Thanks in advance!!
I think generally it's two steps:
Get image (no matter from preview or photos or anything), convert it to android.graphics.Bitmap
Do Object detection from Bitmap
The part (1) is more like an Android question. For (2), you could checkout this example
Note: To use the recognizeImage method, you need to resize the Bitmap to INPUT_SIZE * INPUT_SIZE by your own, which is not obvious.
I want to create an Android application that will identify an selected image (gallery or whatever) from camera preview using image recognition in TensorFlow. Is it possible to convert the selected image as an object & identify that image object from camera preview.
Thanks
Please refer to below example available in Tensorflow site on how to do object detections in Android
https://github.com/tensorflow/examples/tree/master/lite/examples/object_detection/android
If this is not what you are looking for, kindy give an elaborative description about the issue you are trying to resolve.
I want make an Android app with custom camera API, which can take pictures with some png files as frames(Like some web came apps in PCs). And also first I want to take a picture of ball(or something) which act as frame for the second photo that I am going to take. Anybody have an idea?
Most devices already have a camera application, which you can start for the result if that suits your requirement.
But if you have more extensive requirement android also allows you to directly control the camera. Directly controlling the camera is much more involved and you should access your requirement before deciding on either approach.
You can refere to the following develper guides to get details of both
http://developer.android.com/training/camera/photobasics.html
http://developer.android.com/training/camera/cameradirect.html
Once you get the Bitmap, you can use the canvas element to combine the two bitmaps.
i want to capture the image from camera and upload on server
for capturing image which is best direct using intent simple sort code or using view or surfaceview which is best
when you use the basic Intent, you don't really need to bother with sufaceView or View. the user is prompt with the image and is asked if to save it or not. using the onActivityResult will take care of the upload.
have you looked at the android camera image capture? they have sample code for all the possibilities of capturing images from the android camera.
If you want some customization in your activity or some other functionality with image capturing then surfaceview is best. One example i have already given you can try this to capture frames. I have explained everything if you are having any problem then you can ask I will try to help you. Instead of onPreviewFrame use on picture taken.
Android Camera Surface View
hope it will help you.
My users are going to construct and image out of other images in the game, what I then need to take is capture the image they have created and save it.
Im really not sure how to capture the final image, I am using OpenGL ES so the Canvas option is viable
Thanks
I think glReadPixels is probably what you're looking for. Khronos has better documentation of this function.