Skip to content

Commit 81a4008

Browse files
Update OD model and interpreter for Coral TPU
1 parent ccaaf10 commit 81a4008

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tflite-server.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,13 @@
2121
SCENE_URL = "/v1/vision/scene"
2222
# Models and labels
2323
FACE_MODEL = "models/face_detection/mobilenet_ssd_v2_face/mobilenet_ssd_v2_face_quant_postprocess.tflite"
24-
OBJ_MODEL = "models/object_detection/mobilenet_ssd_v2_coco/mobilenet_ssd_v2_coco_quant_postprocess.tflite"
24+
OBJ_MODEL = "models/object_detection/ssd_mobilenet_v2_coco_quant_postprocess_edgetpu.tflite"
2525
OBJ_LABELS = "models/object_detection/mobilenet_ssd_v2_coco/coco_labels.txt"
2626
SCENE_MODEL = "models/classification/dogs-vs-cats/model.tflite"
2727
SCENE_LABELS = "models/classification/dogs-vs-cats/labels.txt"
2828

2929
# Setup object detection
30-
obj_interpreter = tflite.Interpreter(model_path=OBJ_MODEL)
31-
obj_interpreter.allocate_tensors()
30+
obj_interpreter = tflite.Interpreter(model_path=OBJ_MODEL, experimental_delegates=[load_delegate('libedgetpu.so.1.0')])obj_interpreter.allocate_tensors()
3231
obj_input_details = obj_interpreter.get_input_details()
3332
obj_output_details = obj_interpreter.get_output_details()
3433
obj_input_height = obj_input_details[0]["shape"][1]

0 commit comments

Comments
 (0)