-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor! more flexible and backwards-compatible with lobe signature files. tf_backend uses the tf 1.15 session and saved model loader rather than the contrib inference library. * update to tensorflow 2.4 * add onnx backend! * add note about libjpeg62-turbo for raspbian * onnxruntime not on arm * remove tflite install resource (taken care of in setup.py), and add link to trash classifier example
- Loading branch information
1 parent
aa6991f
commit 143ddfe
Showing
23 changed files
with
690 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Release 0.3.0 | ||
___ | ||
## Breaking Changes | ||
* Previous use of Signature should be ImageClassificationSignature. `from lobe.signature import Signature` -> | ||
`from lobe.signature import ImageClassificationSignature` | ||
|
||
## Bug Fixes and Other Improvements | ||
* Update to TensorFlow 2.4 from 1.15.4 | ||
* Add ONNX runtime backend | ||
* Use requests instead of urllib | ||
* Make backends thread-safe | ||
* Added constants file for signature keys to enable backwards-compatibility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,55 @@ | ||
from setuptools import setup, find_packages | ||
import sys | ||
import platform | ||
|
||
|
||
python_version = platform.python_version().rsplit('.', maxsplit=1)[0] | ||
|
||
requirements = [ | ||
"pillow", | ||
"requests", | ||
"numpy==1.19.3", | ||
"tensorflow==2.4;platform_machine!='armv7l'", | ||
"onnxruntime==1.6.0;platform_machine!='armv7l'" | ||
] | ||
|
||
# get the right TF Lite runtime packages based on OS and python version: https://www.tensorflow.org/lite/guide/python#install_just_the_tensorflow_lite_interpreter | ||
tflite_python = None | ||
tflite_machine = None | ||
|
||
# get the right python string for the version | ||
if python_version == '3.5': | ||
tflite_python = 'cp35-cp35m' | ||
elif python_version == '3.6': | ||
tflite_python = 'cp36-cp36m' | ||
elif python_version == '3.7': | ||
tflite_python = 'cp37-cp37m' | ||
elif python_version == '3.8': | ||
tflite_python = 'cp38-cp38' | ||
|
||
# get the right machine string | ||
if sys.platform == 'win32': | ||
tflite_machine = 'win_amd64' | ||
elif sys.platform == 'darwin': | ||
tflite_machine = 'macosx_10_15_x86_64' | ||
elif sys.platform == 'linux': | ||
if platform.machine() == 'x86_64': | ||
tflite_machine = 'linux_x86_64' | ||
elif platform.machine() == 'armv7l': | ||
tflite_machine = 'linux_armv7l' | ||
|
||
# add it to the requirements, or print the location to find the version to install | ||
if tflite_python and tflite_machine: | ||
requirements.append(f"tflite_runtime @ https://github.com/google-coral/pycoral/releases/download/release-frogfish/tflite_runtime-2.5.0-{tflite_python}-{tflite_machine}.whl") | ||
else: | ||
print( | ||
f"Couldn't find tflite_runtime for your platform {sys.platform}, machine {platform.machine()}, and python version {python_version}, please see the install guide for the right version: https://www.tensorflow.org/lite/guide/python#install_just_the_tensorflow_lite_interpreter" | ||
) | ||
|
||
setup( | ||
name="lobe", | ||
version="0.2.1", | ||
version="0.3.0", | ||
packages=find_packages("src"), | ||
package_dir={"": "src"}, | ||
install_requires=[ | ||
"numpy", | ||
"pillow", | ||
"requests", | ||
"tensorflow>=1.15.2,<2;platform_machine!='armv7l'", | ||
"tflite_runtime ; platform_machine=='armv7l'" | ||
], | ||
dependency_links=[ | ||
"https://www.piwheels.org/simple/tensorflow", | ||
"https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-linux_armv7l.whl" | ||
] | ||
install_requires=requirements, | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .signature import Signature | ||
from .model.image_model import ImageModel |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.