Starting from:
$30

$24

MP 9 Challenge 2 Solution

Introduction



In this challenge problem, you will learn how to use MLkit and train a TensorFlow Model




Problem statement



Part I: Image to text




In this part, you will lean how to use the text recognition library. Complete the Codelab on MLKit before you begin this part. This app will have a single activity. Given a visiting card, you will need to take a picture of it, recognize the text on it, and display the text in a card on either a ListView or RecyclerView (preferred).




XML: The layout will have an ImageView (in the manner of a view nder; see Challenge 1), Button, and a ListView/RecyclerView below the button.




JAVA: When the button is pressed, the camera image is captured, and the image in the ImageView is set to the captured image. Text recognition is used on ML Kit to retrive the text, which is shown in the ListView/RecyclerView.




Part II: Training a TensorFlow Model




The objective of this part is to get a basic understanding of TensorFlow training. Complete the TensorFlow Codelab (Parts 1 and 2) before you begin. This app will have a single activity. You can extend Part I of this Challenge to include the functionality desired (eg., add another button). You will be shown an image of one of the ower types in the TensorFlow Codelab or a cat image. You need to take a picture of the image, and the goal is to correctly label the image.




XML: The layout of the MainActivity is essentially identical to Part 1. The layout will have an Im-ageView, Button2, and a ListView/RecyclerView below the button.




JAVA: When Button2 is pressed, the camera image is captured, and the image in the ImageView is set to the captured image. Image recognition is used with TensorFlowLite to recognize the image, which is shown in the ListView/RecyclerView.




TensorFlow Download a su ciently large dataset of cat images, for example use some images from the Cat dataset: https://archive.org/details/CAT_DATASET or the pets data set http://www.robots.ox. ac.uk/~vgg/data/pets/. Retrain TensorFlow with the cat images along with the original ower images. At the end of this process, create a TensorFlowLite le, and place in the Android assets directory. Remember to include the label \Cat" for the cat images.




Optional Extensions Play around with more or fewer images in the training set. See how good you can make the accuracy. Add other image datasets such the cars dataset https://ai.stanford.edu/~jkrause/ cars/car_dataset.html




Evaluation Guidelines



Check operation using the interface.






1









Bonus points for extended image recognition



Your application must run on either a physical or a virtual device.




















































































































































































2

More products