[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-24 (世界標準時間)。"],[],[],null,["# LiteRT inference with metadata\n\nInferencing [models with metadata](../../models/metadata) can be as easy as just\na few lines of code. LiteRT metadata contains a rich description of\nwhat the model does and how to use the model. It can empower code generators to\nautomatically generate the inference code for you, such as using the [Android\nStudio ML Binding feature](../metadata/codegen#mlbinding) or [LiteRT\nAndroid code generator](../metadata/codegen#codegen). It can also be used to\nconfigure your custom inference pipeline.\n\nTools and libraries\n-------------------\n\nLiteRT provides varieties of tools and libraries to serve different\ntiers of deployment requirements as follows:\n\n### Generate model interface with Android code generators\n\nThere are two ways to automatically generate the necessary Android wrapper code\nfor LiteRT model with metadata:\n\n1. [Android Studio ML Model Binding](./codegen#mlbinding) is tooling available\n within Android Studio to import LiteRT model through a graphical\n interface. Android Studio will automatically configure settings for the\n project and generate wrapper classes based on the model metadata.\n\n2. [LiteRT Code Generator](./codegen#codegen) is an executable that\n generates model interface automatically based on the metadata. It currently\n supports Android with Java. The wrapper code removes the need to interact\n directly with `ByteBuffer`. Instead, developers can interact with the\n LiteRT model with typed objects such as `Bitmap` and `Rect`.\n Android Studio users can also get access to the codegen feature through\n [Android Studio ML Binding](./codegen#mlbinding).\n\n### Build custom inference pipelines with the LiteRT Support Library\n\n[LiteRT Support Library](./lite_support) is a cross-platform library\nthat helps to customize model interface and build inference pipelines. It\ncontains varieties of util methods and data structures to perform pre/post\nprocessing and data conversion. It is also designed to match the behavior of\nTensorFlow modules, such as TF.Image and TF.Text, ensuring consistency from\ntraining to inferencing.\n\nExplore pretrained models with metadata\n---------------------------------------\n\nBrowse [Kaggle Models](https://www.kaggle.com/models?framework=tfLite) to\ndownload pretrained models with metadata for both vision and text tasks. Also\nsee different options of [visualizing the\nmetadata](../../models/metadata#visualize_the_metadata).\n\nLiteRT Support GitHub repo\n--------------------------\n\nVisit the [LiteRT Support GitHub\nrepo](https://github.com/tensorflow/tflite-support) for more examples and source\ncode."]]