mirror of
https://github.com/koush/scrypted.git
synced 2026-03-16 07:02:07 +00:00
detect: finish segmentation support
This commit is contained in:
@@ -157,7 +157,7 @@ class CoreMLPlugin(
|
||||
|
||||
await scrypted_sdk.deviceManager.onDeviceDiscovered(
|
||||
{
|
||||
"nativeId": "segmentation",
|
||||
"nativeId": "segment",
|
||||
"type": scrypted_sdk.ScryptedDeviceType.Builtin.value,
|
||||
"interfaces": [
|
||||
scrypted_sdk.ScryptedInterface.ClusterForkInterface.value,
|
||||
@@ -179,7 +179,7 @@ class CoreMLPlugin(
|
||||
elif nativeId == "clipembedding":
|
||||
self.clipDevice = self.clipDevice or CoreMLClipEmbedding(self, nativeId)
|
||||
return self.clipDevice
|
||||
elif nativeId == "segmentation":
|
||||
elif nativeId == "segment":
|
||||
self.segmentDevice = self.segmentDevice or CoreMLSegmentation(self, nativeId)
|
||||
return self.segmentDevice
|
||||
custom_model = self.custom_models.get(nativeId, None)
|
||||
|
||||
@@ -167,7 +167,7 @@ class NCNNPlugin(
|
||||
if NCNNSegmentation:
|
||||
await scrypted_sdk.deviceManager.onDeviceDiscovered(
|
||||
{
|
||||
"nativeId": "segmentation",
|
||||
"nativeId": "segment",
|
||||
"type": scrypted_sdk.ScryptedDeviceType.Builtin.value,
|
||||
"interfaces": [
|
||||
scrypted_sdk.ScryptedInterface.ClusterForkInterface.value,
|
||||
@@ -186,7 +186,7 @@ class NCNNPlugin(
|
||||
if nativeId == "textrecognition":
|
||||
self.textDevice = self.textDevice or NCNNTextRecognition(self, nativeId)
|
||||
return self.textDevice
|
||||
if nativeId == "segmentation":
|
||||
if nativeId == "segment":
|
||||
self.segmentDevice = self.segmentDevice or NCNNSegmentation(self, nativeId)
|
||||
return self.segmentDevice
|
||||
custom_model = self.custom_models.get(nativeId, None)
|
||||
|
||||
@@ -207,7 +207,7 @@ class ONNXPlugin(
|
||||
|
||||
await scrypted_sdk.deviceManager.onDeviceDiscovered(
|
||||
{
|
||||
"nativeId": "segmentation",
|
||||
"nativeId": "segment",
|
||||
"type": scrypted_sdk.ScryptedDeviceType.Builtin.value,
|
||||
"interfaces": [
|
||||
scrypted_sdk.ScryptedInterface.ClusterForkInterface.value,
|
||||
@@ -229,7 +229,7 @@ class ONNXPlugin(
|
||||
elif nativeId == "clipembedding":
|
||||
self.clipDevice = self.clipDevice or ONNXClipEmbedding(self, nativeId)
|
||||
return self.clipDevice
|
||||
elif nativeId == "segmentation":
|
||||
elif nativeId == "segment":
|
||||
self.segmentDevice = self.segmentDevice or ONNXSegmentation(self, nativeId)
|
||||
return self.segmentDevice
|
||||
custom_model = self.custom_models.get(nativeId, None)
|
||||
|
||||
@@ -343,7 +343,7 @@ class OpenVINOPlugin(
|
||||
|
||||
await scrypted_sdk.deviceManager.onDeviceDiscovered(
|
||||
{
|
||||
"nativeId": "segmentation",
|
||||
"nativeId": "segment",
|
||||
"type": scrypted_sdk.ScryptedDeviceType.Builtin.value,
|
||||
"interfaces": [
|
||||
scrypted_sdk.ScryptedInterface.ClusterForkInterface.value,
|
||||
@@ -365,7 +365,7 @@ class OpenVINOPlugin(
|
||||
elif nativeId == "clipembedding":
|
||||
self.clipDevice = self.clipDevice or OpenVINOClipEmbedding(self, nativeId)
|
||||
return self.clipDevice
|
||||
elif nativeId == "segmentation":
|
||||
elif nativeId == "segment":
|
||||
self.segmentDevice = self.segmentDevice or OpenVINOSegmentation(self, nativeId)
|
||||
return self.segmentDevice
|
||||
custom_model = self.custom_models.get(nativeId, None)
|
||||
|
||||
@@ -424,7 +424,7 @@ class PredictPlugin(DetectPlugin, scrypted_sdk.ClusterForkInterface, scrypted_sd
|
||||
ret = await result.getFaceRecognition()
|
||||
elif self.nativeId == "clipembedding":
|
||||
ret = await result.getClipEmbedding()
|
||||
elif self.nativeId == "segmentation":
|
||||
elif self.nativeId == "segment":
|
||||
ret = await result.getSegmentation()
|
||||
else:
|
||||
ret = await result.getCustomDetection(self.nativeId)
|
||||
@@ -563,7 +563,7 @@ class Fork:
|
||||
return await self.plugin.getDevice("clipembedding")
|
||||
|
||||
async def getSegmentation(self):
|
||||
return await self.plugin.getDevice("segmentation")
|
||||
return await self.plugin.getDevice("segment")
|
||||
|
||||
async def getCustomDetection(self, nativeId: str):
|
||||
return await self.plugin.getDevice(nativeId)
|
||||
|
||||
Reference in New Issue
Block a user