tensorflow-lite: dump edge tpu into settings

This commit is contained in:
Koushik Dutta
2022-08-17 09:32:57 -07:00
parent 2d1d15a6fa
commit fb02ea0b5e
3 changed files with 7 additions and 5 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/tensorflow-lite",
"version": "0.0.39",
"version": "0.0.40",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/tensorflow-lite",
"version": "0.0.39",
"version": "0.0.40",
"hasInstallScript": true,
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"

View File

@@ -42,5 +42,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.0.39"
"version": "0.0.40"
}

View File

@@ -13,8 +13,9 @@ try:
from pycoral.utils.edgetpu import list_edge_tpus
from pycoral.utils.edgetpu import make_interpreter
loaded_py_coral = True
print('coral edge tpu library loaded successfully')
except Exception as e:
print('coral utils load failed', e)
print('coral edge tpu library load failed', e)
pass
import tflite_runtime.interpreter as tflite
import re
@@ -62,7 +63,8 @@ class TensorFlowLitePlugin(DetectPlugin):
model = scrypted_sdk.zip.open(
'fs/mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite').read()
self.interpreter = make_interpreter(model)
except:
except Exception as e:
print('unable to use Coral Edge TPU', e)
self.edge_tpu_found = 'Edge TPU not found'
model = scrypted_sdk.zip.open(
'fs/mobilenet_ssd_v2_coco_quant_postprocess.tflite').read()