<jupyter_start><jupyter_text><jupyter_code>!pip install tflite_model_maker
!unzip /content/PlantDoc.v1-resize-416x416.tfrecord\ \(1\).zip
tspec = model_spec.get('efficientdet_lite4')
!git clone https://github.com/tensorflow/models.git
%cd /content/models/research/object_detection/
!protoc object_detection/protos/*.proto --python_out=.
# Install TensorFlow Object Detection API.
!cp object_detection/packages/tf2/setup.py .
!python -m pip install --use-feature=2020-resolver .
from utils import label_map_util
category_index = label_map_util.get_label_map_dict('/content/train/leaves_label_map.pbtxt', use_display_name=True)
inv_map = {v: k for k, v in category_index.items()}
train = object_detector.DataLoader('/content/train/leaves.tfrecord', 3000, inv_map)
!unzip /content/PlantDoc.v1-resize-416x416.tfrecord.zip
model = object_detector.create(train, model_spec=tspec, epochs=10, batch_size=8, train_whole_model=True)
model.export(export_dir='/content', export_format=[ExportFormat.TFLITE])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12975609756097561, 'fraction_numerical': 0.027317073170731707, 'mean_word_length': 7.078740157480315, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '441209', 'license': 'MIT', 'n_tokens_mistral': 387, 'n_tokens_neox': 362, 'n_words': 57, 'path': 'modelLiteMaker.ipynb', 'repo_name': 'Grysby/MLEmbarque', 'size': '1025'}