You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For instance, it could have an end-to-end image classification example that
48
53
utilizes this library with just 4 lines of code, each of which representing one
49
54
step of the overall process. For more detail, you could refer to
50
55
[Colab for image classification](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/tutorials/model_maker_image_classification.ipynb).
51
56
52
-
*1. Import the required modules.
57
+
*Step 1. Import the required modules.
53
58
54
59
```python
55
60
from tflite_model_maker import image_classifier
56
61
from tflite_model_maker.image_classifier import DataLoader
57
62
```
58
63
59
-
*2. Load input data specific to an on-device ML app.
64
+
*Step 2. Load input data specific to an on-device ML app.
60
65
61
66
```python
62
67
data = DataLoader.from_folder('flower_photos/')
63
68
```
64
69
65
-
*3. Customize the TensorFlow model.
70
+
*Step 3. Customize the TensorFlow model.
66
71
67
72
```python
68
73
model = image_classifier.create(data)
69
74
```
70
75
71
-
*4. Evaluate the model.
76
+
*Step 4. Evaluate the model.
72
77
73
78
```python
74
79
loss, accuracy = model.evaluate()
75
80
```
76
81
77
-
*5. Export to Tensorflow Lite model and label file in `export_dir`.
82
+
*Step 5. Export to Tensorflow Lite model and label file in `export_dir`.
78
83
79
84
```python
80
85
model.export(export_dir='/tmp/')
@@ -86,6 +91,8 @@ Currently, we support image classification, text classification and question
86
91
answer tasks. Meanwhile, we provide demo code for each of them in demo folder.
87
92
88
93
*[Overview for TensorFlow Lite Model Maker](https://www.tensorflow.org/lite/guide/model_maker)
94
+
*[Python API Reference](https://www.tensorflow.org/lite/api_docs/python/tflite_model_maker)
89
95
*[Colab for image classification](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/tutorials/model_maker_image_classification.ipynb)
90
96
*[Colab for text classification](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/tutorials/model_maker_text_classification.ipynb)
91
97
*[Colab for BERT question answer](https://colab.research.google.com/github/tensorflow/tensorflow/blob/master/tensorflow/lite/g3doc/tutorials/model_maker_question_answer.ipynb)
98
+
*[Colab for object detection](https://www.tensorflow.org/lite/tutorials/model_maker_object_detection)
0 commit comments