tensorflow: update to new api, add opencv dep

This commit is contained in:
Koushik Dutta
2023-03-20 13:29:28 -07:00
parent 420f070035
commit d956ee06d0
4 changed files with 7 additions and 4 deletions

View File

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

View File

@@ -41,5 +41,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.1.4"
"version": "0.1.5"
}

View File

@@ -3,7 +3,10 @@ Pillow>=5.4.1
tensorflow-macos; sys_platform == 'darwin'
tensorflow; sys_platform != 'darwin'
PyGObject>=3.30.4; sys_platform != 'win32'
# not available on armhf
av>=10.0.0; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'
# not available on armhf
opencv-python; sys_platform != 'linux' or platform_machine == 'x86_64' or platform_machine == 'aarch64'
# sort_oh
scipy

View File

@@ -47,7 +47,7 @@ class TensorFlowPlugin(PredictPlugin, scrypted_sdk.BufferConverter, scrypted_sdk
def get_input_size(self) -> Tuple[float, float]:
return (self.inputwidth, self.inputheight)
def detect_once(self, input: Image.Image, settings: Any, src_size, cvss):
async def detect_once(self, input: Image.Image, settings: Any, src_size, cvss):
image_array = tf.keras.utils.img_to_array(input)
input_tensor = tf.convert_to_tensor(image_array, dtype = tf.uint8)