Use TFLite model to google_mlkit_object_detection Flutter

I try use a tflite model training from teachablemachine.withgoogle.com with google_mlkit_object_detection (Flutter), it working but without labels and incorrect.
Firstly, I add metadata and labels to my tflite with code :

from tflite_support import metadata as _metadata
from tflite_support import metadata_schema_py_generated as _metadata_fb
import flatbuffers
import os

def create_metadata(model_path, normalized_model_path):
# Load the model file
with open(model_path, ‘rb’) as f:
model_buffer = f.read()

# Create a model metadata populator
populator = _metadata.MetadataPopulator.with_model_buffer(model_buffer)

# Create NormalizationOptions
normalization_options = _metadata_fb.NormalizationOptionsT()
normalization_options.mean = [127.5]  # Example value, adjust as necessary
normalization_options.std = [127.5]   # Example value, adjust as necessary

# Create input tensor metadata
input_meta = _metadata_fb.TensorMetadataT()
input_meta.name = "input_image"
input_meta.description = "Input image to be processed."
input_meta.content = _metadata_fb.ContentT()
input_meta.content.contentProperties = _metadata_fb.ImagePropertiesT()
input_meta.content.contentProperties.colorSpace = _metadata_fb.ColorSpaceType.RGB
input_meta.processUnits = [_metadata_fb.ProcessUnitT()]
input_meta.processUnits[0].optionsType = _metadata_fb.ProcessUnitOptions.NormalizationOptions
input_meta.processUnits[0].options = normalization_options

# Create output tensor metadata
output_meta = _metadata_fb.TensorMetadataT()
output_meta.name = "output"
output_meta.description = "Predicted class probabilities."

# Path to label file
label_file_path = "labels.txt"

# Add the label file info to the populator
populator.load_associated_files([label_file_path])

# Create subgraph info
subgraph = _metadata_fb.SubGraphMetadataT()
subgraph.inputTensorMetadata = [input_meta]
subgraph.outputTensorMetadata = [output_meta]

# Create label file info
label_file_meta = _metadata_fb.AssociatedFileT()
label_file_meta.name = os.path.basename(label_file_path)
label_file_meta.description = "Labels for objects that the model can recognize."
label_file_meta.type = _metadata_fb.AssociatedFileType.TENSOR_AXIS_LABELS
subgraph.associatedFiles = [label_file_meta]

# Set metadata
model_metadata = _metadata_fb.ModelMetadataT()
model_metadata.name = "Image Classification Model"
model_metadata.description = "Detects objects in images"
model_metadata.version = "v1"
model_metadata.author = "Your Name"
model_metadata.license = "Apache License 2.0"
model_metadata.subgraphMetadata = [subgraph]

# Serialize metadata and save it to the model file
b = flatbuffers.Builder(0)
b.Finish(
    model_metadata.Pack(b),
    _metadata.MetadataPopulator.METADATA_FILE_IDENTIFIER)
metadata_buf = b.Output()

populator.load_metadata_buffer(metadata_buf)
populator.populate()

# Save the new model with metadata
with open(normalized_model_path, 'wb') as f:
    f.write(populator.get_model_buffer())

Example usage

create_metadata(‘detect_mask_train.tflite’, ‘detect_mask_with_label.tflite’)

finally, I used detect_mask_with_label.tflite to google_mlkit_object_detection.

I want to know where I went wrong, and how I can use my TFLite (detect_mask_with_label.tflite) model with google_mlkit_object_detection.
help me, pls Thanks!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật