Skip to content

Commit

Permalink
Add testing trained model on sample image and lite2 model
Browse files Browse the repository at this point in the history
  • Loading branch information
jayjunlee committed Sep 19, 2021
1 parent fdb213d commit b05cdcf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cnn_ball_detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,7 @@
"execution_count": null,
"source": [
"spec = model_spec.get('efficientdet_lite0')\n",
"#spec = model_spec.get('efficientdet_lite2')\n",
"train_data, validation_data, test_data = object_detector.DataLoader.from_csv('./dataset/label/labels_tflite.csv')\n",
"model = object_detector.create(train_data, model_spec=spec, batch_size=16, train_whole_model=True, validation_data=validation_data)"
],
Expand Down Expand Up @@ -883,6 +884,18 @@
],
"outputs": [],
"metadata": {}
},
{
"cell_type": "code",
"execution_count": null,
"source": [
"interpreter = tf.lite.Interpreter(model_path=model_path)\n",
"interpreter.allocate_tensors()\n",
"detection_result_image = run_odt_and_draw_results(\".dataset/processed/image_blue_bright_25.jpg\", interpreter, threshold=0.3)\n",
"Image.fromarray(detection_result_image)"
],
"outputs": [],
"metadata": {}
}
],
"metadata": {
Expand Down
Binary file added trained_model/efficientdet_lite2.tflite
Binary file not shown.

0 comments on commit b05cdcf

Please sign in to comment.