Android Studio ML Model Binding มีเครื่องมือพร้อมใช้งาน
ใน Android Studio เพื่อนําเข้าโมเดล LiteRT ผ่านกราฟิก
ของ Google Android Studio จะกำหนดการตั้งค่าโดยอัตโนมัติสำหรับ
สร้างโปรเจ็กต์และสร้างคลาส Wrapper โดยอิงตามข้อมูลเมตาของโมเดล
LiteRT Code Generator เป็นไฟล์ปฏิบัติการที่
สร้างอินเทอร์เฟซของโมเดลโดยอัตโนมัติตามข้อมูลเมตา ขณะนี้
สนับสนุน Android ที่มี Java โค้ด Wrapper ทำให้ไม่จำเป็นต้องโต้ตอบ
ด้วย ByteBuffer โดยตรง แต่นักพัฒนาซอฟต์แวร์สามารถโต้ตอบกับ
โมเดล LiteRT ที่มีวัตถุที่พิมพ์ เช่น Bitmap และ Rect
ผู้ใช้ Android Studio ยังเข้าถึงฟีเจอร์โค้ดสร้างผ่าน
การเชื่อมโยง ML สำหรับ Android Studio
สร้างไปป์ไลน์การอนุมานที่กำหนดเองด้วย LiteRT Support Library
[[["เข้าใจง่าย","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 UTC"],[],[],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."]]