jagomart
digital resources
picture1_Msense Lecture7


 222x       Filetype PPTX       File size 2.20 MB       Source: eisys.web.unc.edu


File: Msense Lecture7
remember intent camera we used implicit intent to take pictures and get the image back we want to use ai to detect what s in it tensorflow lite tensorflow lite ...

icon picture PPTX Filetype Power Point PPTX | Posted on 10 Sep 2022 | 3 years ago
Partial capture of text on file.
     Remember Intent/Camera?
     • We used implicit intent to take pictures and get 
      the image back. 
                                      We want to use 
                                      AI to detect 
                                      what’s in it!
     TensorFlow Lite
   TensorFlow Lite
   • Use a pre-trained model or train one.
      Using TF Lite in Android
      • Get a pre-trained model – Download and copy 
        (model and labels files) into the “app/assets” folder.
                     https://www.tensorflow.org/lite/models 
      • Gradle – edit build.gradle (module:app)
        dependencies {
            implementation('org.tensorflow:tensorflow-lite:0.0.0-nightly') { changing = true }
            implementation('org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly') { changing = true }
            implementation('org.tensorflow:tensorflow-lite-support:0.0.0-nightly') { changing = true }
        }
        android {
            aaptOptions {
                noCompress "tflite"
                noCompress "lite"
            }
        }
     Android Code
     • Step 1 – Prepare the model “Interpreter”
    AssetFileDescriptor afd = 
    getAssets().openFd("mobilenet_v1_1.0_224_quant.tflite");
    FileInputStream fis = new FileInputStream(afd.getFileDescriptor());
    FileChannel fc = fis.getChannel();
    MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_ONLY, 
    afd.getStartOffset(), afd.getLength());
    Interpreter interpreter = new Interpreter(mbb);
The words contained in this file might help you see if this file matches what you are looking for:

...Remember intent camera we used implicit to take pictures and get the image back want use ai detect what s in it tensorflow lite a pre trained model or train one using tf android download copy labels files into app assets folder https www org models gradle edit build module dependencies implementation nightly changing true gpu support aaptoptions nocompress tflite code step prepare interpreter assetfiledescriptor afd getassets openfd mobilenet v quant fileinputstream fis new getfiledescriptor filechannel fc getchannel mappedbytebuffer mbb map mapmode read only getstartoffset getlength...

no reviews yet
Please Login to review.