Skip to content

Commit f116053

Browse files
authored
Merge pull request lobe#8 from lobe/'aa-bugfix'
Bug fix and TF Lite runtime
2 parents 6db5e7d + bb20f7d commit f116053

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
from setuptools import setup, find_packages
22
setup(
33
name="lobe",
4-
version="0.1.0",
4+
version="0.2.0",
55
packages=find_packages("src"),
66
package_dir={"": "src"},
77
install_requires=[
88
"numpy",
99
"pillow",
1010
"requests",
1111
"tensorflow>=1.15.2,<2;platform_machine!='armv7l'",
12-
"tensorflow<1.14.0 ; platform_machine=='armv7l'"
12+
"tflite_runtime ; platform_machine=='armv7l'"
1313
],
14-
dependency_links=["https://www.piwheels.org/simple/tensorflow"]
14+
dependency_links=[
15+
"https://www.piwheels.org/simple/tensorflow",
16+
"https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl"
17+
]
1518
)

src/lobe/backends/_backend_tflite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ImageClassificationModel:
1616
__MAX_UINT8 = 255
1717

1818
def __init__(self, signature):
19-
self.__model_path = "{}/{}.tflite".format(
19+
self.__model_path = "{}/{}".format(
2020
signature.model_path, signature.filename
2121
)
2222
self.__tflite_predict_fn = None
@@ -54,7 +54,7 @@ def predict(self, image: Image.Image) -> PredictionResult:
5454
)
5555

5656
confidences_output = self.__tflite_predict_fn.get_tensor(
57-
output_details[2]["index"]
57+
output_details[1]["index"]
5858
)
5959

6060
confidences = np.squeeze(confidences_output)

0 commit comments

Comments
 (0)