nedo-vision-worker 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nedo_vision_worker/__init__.py +10 -0
- nedo_vision_worker/cli.py +195 -0
- nedo_vision_worker/config/ConfigurationManager.py +196 -0
- nedo_vision_worker/config/__init__.py +1 -0
- nedo_vision_worker/database/DatabaseManager.py +219 -0
- nedo_vision_worker/database/__init__.py +1 -0
- nedo_vision_worker/doctor.py +453 -0
- nedo_vision_worker/initializer/AppInitializer.py +78 -0
- nedo_vision_worker/initializer/__init__.py +1 -0
- nedo_vision_worker/models/__init__.py +15 -0
- nedo_vision_worker/models/ai_model.py +29 -0
- nedo_vision_worker/models/auth.py +14 -0
- nedo_vision_worker/models/config.py +9 -0
- nedo_vision_worker/models/dataset_source.py +30 -0
- nedo_vision_worker/models/logs.py +9 -0
- nedo_vision_worker/models/ppe_detection.py +39 -0
- nedo_vision_worker/models/ppe_detection_label.py +20 -0
- nedo_vision_worker/models/restricted_area_violation.py +20 -0
- nedo_vision_worker/models/user.py +10 -0
- nedo_vision_worker/models/worker_source.py +19 -0
- nedo_vision_worker/models/worker_source_pipeline.py +21 -0
- nedo_vision_worker/models/worker_source_pipeline_config.py +24 -0
- nedo_vision_worker/models/worker_source_pipeline_debug.py +15 -0
- nedo_vision_worker/models/worker_source_pipeline_detection.py +14 -0
- nedo_vision_worker/protos/AIModelService_pb2.py +46 -0
- nedo_vision_worker/protos/AIModelService_pb2_grpc.py +140 -0
- nedo_vision_worker/protos/DatasetSourceService_pb2.py +46 -0
- nedo_vision_worker/protos/DatasetSourceService_pb2_grpc.py +140 -0
- nedo_vision_worker/protos/HumanDetectionService_pb2.py +44 -0
- nedo_vision_worker/protos/HumanDetectionService_pb2_grpc.py +140 -0
- nedo_vision_worker/protos/PPEDetectionService_pb2.py +46 -0
- nedo_vision_worker/protos/PPEDetectionService_pb2_grpc.py +140 -0
- nedo_vision_worker/protos/VisionWorkerService_pb2.py +72 -0
- nedo_vision_worker/protos/VisionWorkerService_pb2_grpc.py +471 -0
- nedo_vision_worker/protos/WorkerSourcePipelineService_pb2.py +64 -0
- nedo_vision_worker/protos/WorkerSourcePipelineService_pb2_grpc.py +312 -0
- nedo_vision_worker/protos/WorkerSourceService_pb2.py +50 -0
- nedo_vision_worker/protos/WorkerSourceService_pb2_grpc.py +183 -0
- nedo_vision_worker/protos/__init__.py +1 -0
- nedo_vision_worker/repositories/AIModelRepository.py +44 -0
- nedo_vision_worker/repositories/DatasetSourceRepository.py +150 -0
- nedo_vision_worker/repositories/PPEDetectionRepository.py +112 -0
- nedo_vision_worker/repositories/RestrictedAreaRepository.py +88 -0
- nedo_vision_worker/repositories/WorkerSourcePipelineDebugRepository.py +90 -0
- nedo_vision_worker/repositories/WorkerSourcePipelineDetectionRepository.py +48 -0
- nedo_vision_worker/repositories/WorkerSourcePipelineRepository.py +174 -0
- nedo_vision_worker/repositories/WorkerSourceRepository.py +46 -0
- nedo_vision_worker/repositories/__init__.py +1 -0
- nedo_vision_worker/services/AIModelClient.py +362 -0
- nedo_vision_worker/services/ConnectionInfoClient.py +57 -0
- nedo_vision_worker/services/DatasetSourceClient.py +88 -0
- nedo_vision_worker/services/FileToRTMPServer.py +78 -0
- nedo_vision_worker/services/GrpcClientBase.py +155 -0
- nedo_vision_worker/services/GrpcClientManager.py +141 -0
- nedo_vision_worker/services/ImageUploadClient.py +82 -0
- nedo_vision_worker/services/PPEDetectionClient.py +108 -0
- nedo_vision_worker/services/RTSPtoRTMPStreamer.py +98 -0
- nedo_vision_worker/services/RestrictedAreaClient.py +100 -0
- nedo_vision_worker/services/SystemUsageClient.py +77 -0
- nedo_vision_worker/services/VideoStreamClient.py +161 -0
- nedo_vision_worker/services/WorkerSourceClient.py +215 -0
- nedo_vision_worker/services/WorkerSourcePipelineClient.py +393 -0
- nedo_vision_worker/services/WorkerSourceUpdater.py +134 -0
- nedo_vision_worker/services/WorkerStatusClient.py +65 -0
- nedo_vision_worker/services/__init__.py +1 -0
- nedo_vision_worker/util/HardwareID.py +104 -0
- nedo_vision_worker/util/ImageUploader.py +92 -0
- nedo_vision_worker/util/Networking.py +94 -0
- nedo_vision_worker/util/PlatformDetector.py +50 -0
- nedo_vision_worker/util/SystemMonitor.py +299 -0
- nedo_vision_worker/util/VideoProbeUtil.py +120 -0
- nedo_vision_worker/util/__init__.py +1 -0
- nedo_vision_worker/worker/CoreActionWorker.py +125 -0
- nedo_vision_worker/worker/DataSenderWorker.py +168 -0
- nedo_vision_worker/worker/DataSyncWorker.py +143 -0
- nedo_vision_worker/worker/DatasetFrameSender.py +208 -0
- nedo_vision_worker/worker/DatasetFrameWorker.py +412 -0
- nedo_vision_worker/worker/PPEDetectionManager.py +86 -0
- nedo_vision_worker/worker/PipelineActionWorker.py +129 -0
- nedo_vision_worker/worker/PipelineImageWorker.py +116 -0
- nedo_vision_worker/worker/RabbitMQListener.py +170 -0
- nedo_vision_worker/worker/RestrictedAreaManager.py +85 -0
- nedo_vision_worker/worker/SystemUsageManager.py +111 -0
- nedo_vision_worker/worker/VideoStreamWorker.py +139 -0
- nedo_vision_worker/worker/WorkerManager.py +155 -0
- nedo_vision_worker/worker/__init__.py +1 -0
- nedo_vision_worker/worker_service.py +264 -0
- nedo_vision_worker-1.0.0.dist-info/METADATA +563 -0
- nedo_vision_worker-1.0.0.dist-info/RECORD +92 -0
- nedo_vision_worker-1.0.0.dist-info/WHEEL +5 -0
- nedo_vision_worker-1.0.0.dist-info/entry_points.txt +2 -0
- nedo_vision_worker-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
from nedo_vision_worker.protos import WorkerSourcePipelineService_pb2 as nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.73.1'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
_version_not_supported = False
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from grpc._utilities import first_version_is_lower
|
|
14
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
+
except ImportError:
|
|
16
|
+
_version_not_supported = True
|
|
17
|
+
|
|
18
|
+
if _version_not_supported:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
+
+ f' but the generated code in nedo_vision_worker/protos/WorkerSourcePipelineService_pb2_grpc.py depends on'
|
|
22
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class WorkerSourcePipelineServiceStub(object):
|
|
29
|
+
"""Missing associated documentation comment in .proto file."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, channel):
|
|
32
|
+
"""Constructor.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
channel: A grpc.Channel.
|
|
36
|
+
"""
|
|
37
|
+
self.GetListByWorkerId = channel.unary_unary(
|
|
38
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/GetListByWorkerId',
|
|
39
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.GetListByWorkerIdRequest.SerializeToString,
|
|
40
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.WorkerSourcePipelineListResponse.FromString,
|
|
41
|
+
_registered_method=True)
|
|
42
|
+
self.GetListByWorkerSourceId = channel.unary_unary(
|
|
43
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/GetListByWorkerSourceId',
|
|
44
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.GetListByWorkerSourceIdRequest.SerializeToString,
|
|
45
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.WorkerSourcePipelineListResponse.FromString,
|
|
46
|
+
_registered_method=True)
|
|
47
|
+
self.SendPipelineImage = channel.unary_unary(
|
|
48
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/SendPipelineImage',
|
|
49
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineImageRequest.SerializeToString,
|
|
50
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineImageResponse.FromString,
|
|
51
|
+
_registered_method=True)
|
|
52
|
+
self.UpdateStatus = channel.unary_unary(
|
|
53
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/UpdateStatus',
|
|
54
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.UpdatePipelineStatusRequest.SerializeToString,
|
|
55
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.UpdatePipelineStatusResponse.FromString,
|
|
56
|
+
_registered_method=True)
|
|
57
|
+
self.SendPipelineDebug = channel.unary_unary(
|
|
58
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/SendPipelineDebug',
|
|
59
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDebugRequest.SerializeToString,
|
|
60
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDebugResponse.FromString,
|
|
61
|
+
_registered_method=True)
|
|
62
|
+
self.SendPipelineDetectionData = channel.unary_unary(
|
|
63
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/SendPipelineDetectionData',
|
|
64
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDetectionDataRequest.SerializeToString,
|
|
65
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDetectionDataResponse.FromString,
|
|
66
|
+
_registered_method=True)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class WorkerSourcePipelineServiceServicer(object):
|
|
70
|
+
"""Missing associated documentation comment in .proto file."""
|
|
71
|
+
|
|
72
|
+
def GetListByWorkerId(self, request, context):
|
|
73
|
+
"""Missing associated documentation comment in .proto file."""
|
|
74
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
75
|
+
context.set_details('Method not implemented!')
|
|
76
|
+
raise NotImplementedError('Method not implemented!')
|
|
77
|
+
|
|
78
|
+
def GetListByWorkerSourceId(self, request, context):
|
|
79
|
+
"""Missing associated documentation comment in .proto file."""
|
|
80
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
81
|
+
context.set_details('Method not implemented!')
|
|
82
|
+
raise NotImplementedError('Method not implemented!')
|
|
83
|
+
|
|
84
|
+
def SendPipelineImage(self, request, context):
|
|
85
|
+
"""Missing associated documentation comment in .proto file."""
|
|
86
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
87
|
+
context.set_details('Method not implemented!')
|
|
88
|
+
raise NotImplementedError('Method not implemented!')
|
|
89
|
+
|
|
90
|
+
def UpdateStatus(self, request, context):
|
|
91
|
+
"""Missing associated documentation comment in .proto file."""
|
|
92
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
93
|
+
context.set_details('Method not implemented!')
|
|
94
|
+
raise NotImplementedError('Method not implemented!')
|
|
95
|
+
|
|
96
|
+
def SendPipelineDebug(self, request, context):
|
|
97
|
+
"""Missing associated documentation comment in .proto file."""
|
|
98
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
99
|
+
context.set_details('Method not implemented!')
|
|
100
|
+
raise NotImplementedError('Method not implemented!')
|
|
101
|
+
|
|
102
|
+
def SendPipelineDetectionData(self, request, context):
|
|
103
|
+
"""Missing associated documentation comment in .proto file."""
|
|
104
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
105
|
+
context.set_details('Method not implemented!')
|
|
106
|
+
raise NotImplementedError('Method not implemented!')
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
def add_WorkerSourcePipelineServiceServicer_to_server(servicer, server):
|
|
110
|
+
rpc_method_handlers = {
|
|
111
|
+
'GetListByWorkerId': grpc.unary_unary_rpc_method_handler(
|
|
112
|
+
servicer.GetListByWorkerId,
|
|
113
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.GetListByWorkerIdRequest.FromString,
|
|
114
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.WorkerSourcePipelineListResponse.SerializeToString,
|
|
115
|
+
),
|
|
116
|
+
'GetListByWorkerSourceId': grpc.unary_unary_rpc_method_handler(
|
|
117
|
+
servicer.GetListByWorkerSourceId,
|
|
118
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.GetListByWorkerSourceIdRequest.FromString,
|
|
119
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.WorkerSourcePipelineListResponse.SerializeToString,
|
|
120
|
+
),
|
|
121
|
+
'SendPipelineImage': grpc.unary_unary_rpc_method_handler(
|
|
122
|
+
servicer.SendPipelineImage,
|
|
123
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineImageRequest.FromString,
|
|
124
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineImageResponse.SerializeToString,
|
|
125
|
+
),
|
|
126
|
+
'UpdateStatus': grpc.unary_unary_rpc_method_handler(
|
|
127
|
+
servicer.UpdateStatus,
|
|
128
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.UpdatePipelineStatusRequest.FromString,
|
|
129
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.UpdatePipelineStatusResponse.SerializeToString,
|
|
130
|
+
),
|
|
131
|
+
'SendPipelineDebug': grpc.unary_unary_rpc_method_handler(
|
|
132
|
+
servicer.SendPipelineDebug,
|
|
133
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDebugRequest.FromString,
|
|
134
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDebugResponse.SerializeToString,
|
|
135
|
+
),
|
|
136
|
+
'SendPipelineDetectionData': grpc.unary_unary_rpc_method_handler(
|
|
137
|
+
servicer.SendPipelineDetectionData,
|
|
138
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDetectionDataRequest.FromString,
|
|
139
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDetectionDataResponse.SerializeToString,
|
|
140
|
+
),
|
|
141
|
+
}
|
|
142
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
143
|
+
'Sindika.AspNet.App005.Services.WorkerSourcePipelineService', rpc_method_handlers)
|
|
144
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
145
|
+
server.add_registered_method_handlers('Sindika.AspNet.App005.Services.WorkerSourcePipelineService', rpc_method_handlers)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
# This class is part of an EXPERIMENTAL API.
|
|
149
|
+
class WorkerSourcePipelineService(object):
|
|
150
|
+
"""Missing associated documentation comment in .proto file."""
|
|
151
|
+
|
|
152
|
+
@staticmethod
|
|
153
|
+
def GetListByWorkerId(request,
|
|
154
|
+
target,
|
|
155
|
+
options=(),
|
|
156
|
+
channel_credentials=None,
|
|
157
|
+
call_credentials=None,
|
|
158
|
+
insecure=False,
|
|
159
|
+
compression=None,
|
|
160
|
+
wait_for_ready=None,
|
|
161
|
+
timeout=None,
|
|
162
|
+
metadata=None):
|
|
163
|
+
return grpc.experimental.unary_unary(
|
|
164
|
+
request,
|
|
165
|
+
target,
|
|
166
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/GetListByWorkerId',
|
|
167
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.GetListByWorkerIdRequest.SerializeToString,
|
|
168
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.WorkerSourcePipelineListResponse.FromString,
|
|
169
|
+
options,
|
|
170
|
+
channel_credentials,
|
|
171
|
+
insecure,
|
|
172
|
+
call_credentials,
|
|
173
|
+
compression,
|
|
174
|
+
wait_for_ready,
|
|
175
|
+
timeout,
|
|
176
|
+
metadata,
|
|
177
|
+
_registered_method=True)
|
|
178
|
+
|
|
179
|
+
@staticmethod
|
|
180
|
+
def GetListByWorkerSourceId(request,
|
|
181
|
+
target,
|
|
182
|
+
options=(),
|
|
183
|
+
channel_credentials=None,
|
|
184
|
+
call_credentials=None,
|
|
185
|
+
insecure=False,
|
|
186
|
+
compression=None,
|
|
187
|
+
wait_for_ready=None,
|
|
188
|
+
timeout=None,
|
|
189
|
+
metadata=None):
|
|
190
|
+
return grpc.experimental.unary_unary(
|
|
191
|
+
request,
|
|
192
|
+
target,
|
|
193
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/GetListByWorkerSourceId',
|
|
194
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.GetListByWorkerSourceIdRequest.SerializeToString,
|
|
195
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.WorkerSourcePipelineListResponse.FromString,
|
|
196
|
+
options,
|
|
197
|
+
channel_credentials,
|
|
198
|
+
insecure,
|
|
199
|
+
call_credentials,
|
|
200
|
+
compression,
|
|
201
|
+
wait_for_ready,
|
|
202
|
+
timeout,
|
|
203
|
+
metadata,
|
|
204
|
+
_registered_method=True)
|
|
205
|
+
|
|
206
|
+
@staticmethod
|
|
207
|
+
def SendPipelineImage(request,
|
|
208
|
+
target,
|
|
209
|
+
options=(),
|
|
210
|
+
channel_credentials=None,
|
|
211
|
+
call_credentials=None,
|
|
212
|
+
insecure=False,
|
|
213
|
+
compression=None,
|
|
214
|
+
wait_for_ready=None,
|
|
215
|
+
timeout=None,
|
|
216
|
+
metadata=None):
|
|
217
|
+
return grpc.experimental.unary_unary(
|
|
218
|
+
request,
|
|
219
|
+
target,
|
|
220
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/SendPipelineImage',
|
|
221
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineImageRequest.SerializeToString,
|
|
222
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineImageResponse.FromString,
|
|
223
|
+
options,
|
|
224
|
+
channel_credentials,
|
|
225
|
+
insecure,
|
|
226
|
+
call_credentials,
|
|
227
|
+
compression,
|
|
228
|
+
wait_for_ready,
|
|
229
|
+
timeout,
|
|
230
|
+
metadata,
|
|
231
|
+
_registered_method=True)
|
|
232
|
+
|
|
233
|
+
@staticmethod
|
|
234
|
+
def UpdateStatus(request,
|
|
235
|
+
target,
|
|
236
|
+
options=(),
|
|
237
|
+
channel_credentials=None,
|
|
238
|
+
call_credentials=None,
|
|
239
|
+
insecure=False,
|
|
240
|
+
compression=None,
|
|
241
|
+
wait_for_ready=None,
|
|
242
|
+
timeout=None,
|
|
243
|
+
metadata=None):
|
|
244
|
+
return grpc.experimental.unary_unary(
|
|
245
|
+
request,
|
|
246
|
+
target,
|
|
247
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/UpdateStatus',
|
|
248
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.UpdatePipelineStatusRequest.SerializeToString,
|
|
249
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.UpdatePipelineStatusResponse.FromString,
|
|
250
|
+
options,
|
|
251
|
+
channel_credentials,
|
|
252
|
+
insecure,
|
|
253
|
+
call_credentials,
|
|
254
|
+
compression,
|
|
255
|
+
wait_for_ready,
|
|
256
|
+
timeout,
|
|
257
|
+
metadata,
|
|
258
|
+
_registered_method=True)
|
|
259
|
+
|
|
260
|
+
@staticmethod
|
|
261
|
+
def SendPipelineDebug(request,
|
|
262
|
+
target,
|
|
263
|
+
options=(),
|
|
264
|
+
channel_credentials=None,
|
|
265
|
+
call_credentials=None,
|
|
266
|
+
insecure=False,
|
|
267
|
+
compression=None,
|
|
268
|
+
wait_for_ready=None,
|
|
269
|
+
timeout=None,
|
|
270
|
+
metadata=None):
|
|
271
|
+
return grpc.experimental.unary_unary(
|
|
272
|
+
request,
|
|
273
|
+
target,
|
|
274
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/SendPipelineDebug',
|
|
275
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDebugRequest.SerializeToString,
|
|
276
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDebugResponse.FromString,
|
|
277
|
+
options,
|
|
278
|
+
channel_credentials,
|
|
279
|
+
insecure,
|
|
280
|
+
call_credentials,
|
|
281
|
+
compression,
|
|
282
|
+
wait_for_ready,
|
|
283
|
+
timeout,
|
|
284
|
+
metadata,
|
|
285
|
+
_registered_method=True)
|
|
286
|
+
|
|
287
|
+
@staticmethod
|
|
288
|
+
def SendPipelineDetectionData(request,
|
|
289
|
+
target,
|
|
290
|
+
options=(),
|
|
291
|
+
channel_credentials=None,
|
|
292
|
+
call_credentials=None,
|
|
293
|
+
insecure=False,
|
|
294
|
+
compression=None,
|
|
295
|
+
wait_for_ready=None,
|
|
296
|
+
timeout=None,
|
|
297
|
+
metadata=None):
|
|
298
|
+
return grpc.experimental.unary_unary(
|
|
299
|
+
request,
|
|
300
|
+
target,
|
|
301
|
+
'/Sindika.AspNet.App005.Services.WorkerSourcePipelineService/SendPipelineDetectionData',
|
|
302
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDetectionDataRequest.SerializeToString,
|
|
303
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2.SendPipelineDetectionDataResponse.FromString,
|
|
304
|
+
options,
|
|
305
|
+
channel_credentials,
|
|
306
|
+
insecure,
|
|
307
|
+
call_credentials,
|
|
308
|
+
compression,
|
|
309
|
+
wait_for_ready,
|
|
310
|
+
timeout,
|
|
311
|
+
metadata,
|
|
312
|
+
_registered_method=True)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
|
+
# source: nedo_vision_worker/protos/WorkerSourceService.proto
|
|
5
|
+
# Protobuf Python Version: 6.31.0
|
|
6
|
+
"""Generated protocol buffer code."""
|
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
11
|
+
from google.protobuf.internal import builder as _builder
|
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
|
14
|
+
6,
|
|
15
|
+
31,
|
|
16
|
+
0,
|
|
17
|
+
'',
|
|
18
|
+
'nedo_vision_worker/protos/WorkerSourceService.proto'
|
|
19
|
+
)
|
|
20
|
+
# @@protoc_insertion_point(imports)
|
|
21
|
+
|
|
22
|
+
_sym_db = _symbol_database.Default()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n3nedo_vision_worker/protos/WorkerSourceService.proto\x12\x1eSindika.AspNet.App005.Services\">\n\x1aGetWorkerSourceListRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"\x9b\x01\n\x19UpdateWorkerSourceRequest\x12\x18\n\x10worker_source_id\x18\x01 \x01(\t\x12\x12\n\nresolution\x18\x02 \x01(\t\x12\x13\n\x0bstatus_code\x18\x03 \x01(\t\x12\x12\n\nframe_rate\x18\x04 \x01(\x01\x12\x18\n\x10worker_timestamp\x18\x05 \x01(\t\x12\r\n\x05token\x18\x06 \x01(\t\"\x80\x01\n\x18WorkerSourceListResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x42\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32\x34.Sindika.AspNet.App005.Services.WorkerSourceResponse\"v\n\x14WorkerSourceResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x11\n\tworker_id\x18\x03 \x01(\t\x12\x11\n\ttype_code\x18\x04 \x01(\t\x12\x0b\n\x03url\x18\x05 \x01(\t\x12\x11\n\tfile_path\x18\x06 \x01(\t\">\n\x1aUpdateWorkerSourceResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\"=\n\x19\x44ownloadSourceFileRequest\x12\x11\n\tsource_id\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"0\n\x1a\x44ownloadSourceFileResponse\x12\x12\n\nfile_chunk\x18\x01 \x01(\x0c\x32\xb4\x03\n\x13WorkerSourceService\x12\x8b\x01\n\x13GetWorkerSourceList\x12:.Sindika.AspNet.App005.Services.GetWorkerSourceListRequest\x1a\x38.Sindika.AspNet.App005.Services.WorkerSourceListResponse\x12\x7f\n\x06Update\x12\x39.Sindika.AspNet.App005.Services.UpdateWorkerSourceRequest\x1a:.Sindika.AspNet.App005.Services.UpdateWorkerSourceResponse\x12\x8d\x01\n\x12\x44ownloadSourceFile\x12\x39.Sindika.AspNet.App005.Services.DownloadSourceFileRequest\x1a:.Sindika.AspNet.App005.Services.DownloadSourceFileResponse0\x01\x62\x06proto3')
|
|
28
|
+
|
|
29
|
+
_globals = globals()
|
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'nedo_vision_worker.protos.WorkerSourceService_pb2', _globals)
|
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
|
33
|
+
DESCRIPTOR._loaded_options = None
|
|
34
|
+
_globals['_GETWORKERSOURCELISTREQUEST']._serialized_start=87
|
|
35
|
+
_globals['_GETWORKERSOURCELISTREQUEST']._serialized_end=149
|
|
36
|
+
_globals['_UPDATEWORKERSOURCEREQUEST']._serialized_start=152
|
|
37
|
+
_globals['_UPDATEWORKERSOURCEREQUEST']._serialized_end=307
|
|
38
|
+
_globals['_WORKERSOURCELISTRESPONSE']._serialized_start=310
|
|
39
|
+
_globals['_WORKERSOURCELISTRESPONSE']._serialized_end=438
|
|
40
|
+
_globals['_WORKERSOURCERESPONSE']._serialized_start=440
|
|
41
|
+
_globals['_WORKERSOURCERESPONSE']._serialized_end=558
|
|
42
|
+
_globals['_UPDATEWORKERSOURCERESPONSE']._serialized_start=560
|
|
43
|
+
_globals['_UPDATEWORKERSOURCERESPONSE']._serialized_end=622
|
|
44
|
+
_globals['_DOWNLOADSOURCEFILEREQUEST']._serialized_start=624
|
|
45
|
+
_globals['_DOWNLOADSOURCEFILEREQUEST']._serialized_end=685
|
|
46
|
+
_globals['_DOWNLOADSOURCEFILERESPONSE']._serialized_start=687
|
|
47
|
+
_globals['_DOWNLOADSOURCEFILERESPONSE']._serialized_end=735
|
|
48
|
+
_globals['_WORKERSOURCESERVICE']._serialized_start=738
|
|
49
|
+
_globals['_WORKERSOURCESERVICE']._serialized_end=1174
|
|
50
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
import warnings
|
|
5
|
+
|
|
6
|
+
from nedo_vision_worker.protos import WorkerSourceService_pb2 as nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2
|
|
7
|
+
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.73.1'
|
|
9
|
+
GRPC_VERSION = grpc.__version__
|
|
10
|
+
_version_not_supported = False
|
|
11
|
+
|
|
12
|
+
try:
|
|
13
|
+
from grpc._utilities import first_version_is_lower
|
|
14
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
|
15
|
+
except ImportError:
|
|
16
|
+
_version_not_supported = True
|
|
17
|
+
|
|
18
|
+
if _version_not_supported:
|
|
19
|
+
raise RuntimeError(
|
|
20
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
|
21
|
+
+ f' but the generated code in nedo_vision_worker/protos/WorkerSourceService_pb2_grpc.py depends on'
|
|
22
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
|
23
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
|
24
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class WorkerSourceServiceStub(object):
|
|
29
|
+
"""Missing associated documentation comment in .proto file."""
|
|
30
|
+
|
|
31
|
+
def __init__(self, channel):
|
|
32
|
+
"""Constructor.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
channel: A grpc.Channel.
|
|
36
|
+
"""
|
|
37
|
+
self.GetWorkerSourceList = channel.unary_unary(
|
|
38
|
+
'/Sindika.AspNet.App005.Services.WorkerSourceService/GetWorkerSourceList',
|
|
39
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.GetWorkerSourceListRequest.SerializeToString,
|
|
40
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.WorkerSourceListResponse.FromString,
|
|
41
|
+
_registered_method=True)
|
|
42
|
+
self.Update = channel.unary_unary(
|
|
43
|
+
'/Sindika.AspNet.App005.Services.WorkerSourceService/Update',
|
|
44
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.UpdateWorkerSourceRequest.SerializeToString,
|
|
45
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.UpdateWorkerSourceResponse.FromString,
|
|
46
|
+
_registered_method=True)
|
|
47
|
+
self.DownloadSourceFile = channel.unary_stream(
|
|
48
|
+
'/Sindika.AspNet.App005.Services.WorkerSourceService/DownloadSourceFile',
|
|
49
|
+
request_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.DownloadSourceFileRequest.SerializeToString,
|
|
50
|
+
response_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.DownloadSourceFileResponse.FromString,
|
|
51
|
+
_registered_method=True)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class WorkerSourceServiceServicer(object):
|
|
55
|
+
"""Missing associated documentation comment in .proto file."""
|
|
56
|
+
|
|
57
|
+
def GetWorkerSourceList(self, request, context):
|
|
58
|
+
"""Missing associated documentation comment in .proto file."""
|
|
59
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
60
|
+
context.set_details('Method not implemented!')
|
|
61
|
+
raise NotImplementedError('Method not implemented!')
|
|
62
|
+
|
|
63
|
+
def Update(self, request, context):
|
|
64
|
+
"""Missing associated documentation comment in .proto file."""
|
|
65
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
66
|
+
context.set_details('Method not implemented!')
|
|
67
|
+
raise NotImplementedError('Method not implemented!')
|
|
68
|
+
|
|
69
|
+
def DownloadSourceFile(self, request, context):
|
|
70
|
+
"""Missing associated documentation comment in .proto file."""
|
|
71
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
72
|
+
context.set_details('Method not implemented!')
|
|
73
|
+
raise NotImplementedError('Method not implemented!')
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def add_WorkerSourceServiceServicer_to_server(servicer, server):
|
|
77
|
+
rpc_method_handlers = {
|
|
78
|
+
'GetWorkerSourceList': grpc.unary_unary_rpc_method_handler(
|
|
79
|
+
servicer.GetWorkerSourceList,
|
|
80
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.GetWorkerSourceListRequest.FromString,
|
|
81
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.WorkerSourceListResponse.SerializeToString,
|
|
82
|
+
),
|
|
83
|
+
'Update': grpc.unary_unary_rpc_method_handler(
|
|
84
|
+
servicer.Update,
|
|
85
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.UpdateWorkerSourceRequest.FromString,
|
|
86
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.UpdateWorkerSourceResponse.SerializeToString,
|
|
87
|
+
),
|
|
88
|
+
'DownloadSourceFile': grpc.unary_stream_rpc_method_handler(
|
|
89
|
+
servicer.DownloadSourceFile,
|
|
90
|
+
request_deserializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.DownloadSourceFileRequest.FromString,
|
|
91
|
+
response_serializer=nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.DownloadSourceFileResponse.SerializeToString,
|
|
92
|
+
),
|
|
93
|
+
}
|
|
94
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
95
|
+
'Sindika.AspNet.App005.Services.WorkerSourceService', rpc_method_handlers)
|
|
96
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
97
|
+
server.add_registered_method_handlers('Sindika.AspNet.App005.Services.WorkerSourceService', rpc_method_handlers)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
# This class is part of an EXPERIMENTAL API.
|
|
101
|
+
class WorkerSourceService(object):
|
|
102
|
+
"""Missing associated documentation comment in .proto file."""
|
|
103
|
+
|
|
104
|
+
@staticmethod
|
|
105
|
+
def GetWorkerSourceList(request,
|
|
106
|
+
target,
|
|
107
|
+
options=(),
|
|
108
|
+
channel_credentials=None,
|
|
109
|
+
call_credentials=None,
|
|
110
|
+
insecure=False,
|
|
111
|
+
compression=None,
|
|
112
|
+
wait_for_ready=None,
|
|
113
|
+
timeout=None,
|
|
114
|
+
metadata=None):
|
|
115
|
+
return grpc.experimental.unary_unary(
|
|
116
|
+
request,
|
|
117
|
+
target,
|
|
118
|
+
'/Sindika.AspNet.App005.Services.WorkerSourceService/GetWorkerSourceList',
|
|
119
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.GetWorkerSourceListRequest.SerializeToString,
|
|
120
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.WorkerSourceListResponse.FromString,
|
|
121
|
+
options,
|
|
122
|
+
channel_credentials,
|
|
123
|
+
insecure,
|
|
124
|
+
call_credentials,
|
|
125
|
+
compression,
|
|
126
|
+
wait_for_ready,
|
|
127
|
+
timeout,
|
|
128
|
+
metadata,
|
|
129
|
+
_registered_method=True)
|
|
130
|
+
|
|
131
|
+
@staticmethod
|
|
132
|
+
def Update(request,
|
|
133
|
+
target,
|
|
134
|
+
options=(),
|
|
135
|
+
channel_credentials=None,
|
|
136
|
+
call_credentials=None,
|
|
137
|
+
insecure=False,
|
|
138
|
+
compression=None,
|
|
139
|
+
wait_for_ready=None,
|
|
140
|
+
timeout=None,
|
|
141
|
+
metadata=None):
|
|
142
|
+
return grpc.experimental.unary_unary(
|
|
143
|
+
request,
|
|
144
|
+
target,
|
|
145
|
+
'/Sindika.AspNet.App005.Services.WorkerSourceService/Update',
|
|
146
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.UpdateWorkerSourceRequest.SerializeToString,
|
|
147
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.UpdateWorkerSourceResponse.FromString,
|
|
148
|
+
options,
|
|
149
|
+
channel_credentials,
|
|
150
|
+
insecure,
|
|
151
|
+
call_credentials,
|
|
152
|
+
compression,
|
|
153
|
+
wait_for_ready,
|
|
154
|
+
timeout,
|
|
155
|
+
metadata,
|
|
156
|
+
_registered_method=True)
|
|
157
|
+
|
|
158
|
+
@staticmethod
|
|
159
|
+
def DownloadSourceFile(request,
|
|
160
|
+
target,
|
|
161
|
+
options=(),
|
|
162
|
+
channel_credentials=None,
|
|
163
|
+
call_credentials=None,
|
|
164
|
+
insecure=False,
|
|
165
|
+
compression=None,
|
|
166
|
+
wait_for_ready=None,
|
|
167
|
+
timeout=None,
|
|
168
|
+
metadata=None):
|
|
169
|
+
return grpc.experimental.unary_stream(
|
|
170
|
+
request,
|
|
171
|
+
target,
|
|
172
|
+
'/Sindika.AspNet.App005.Services.WorkerSourceService/DownloadSourceFile',
|
|
173
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.DownloadSourceFileRequest.SerializeToString,
|
|
174
|
+
nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2.DownloadSourceFileResponse.FromString,
|
|
175
|
+
options,
|
|
176
|
+
channel_credentials,
|
|
177
|
+
insecure,
|
|
178
|
+
call_credentials,
|
|
179
|
+
compression,
|
|
180
|
+
wait_for_ready,
|
|
181
|
+
timeout,
|
|
182
|
+
metadata,
|
|
183
|
+
_registered_method=True)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import logging
|
|
3
|
+
from sqlalchemy.orm import Session
|
|
4
|
+
from sqlalchemy.exc import SQLAlchemyError
|
|
5
|
+
from ..database.DatabaseManager import DatabaseManager
|
|
6
|
+
from ..models.ai_model import AIModelEntity
|
|
7
|
+
|
|
8
|
+
class AIModelRepository:
|
|
9
|
+
"""Handles storage of AI Models into SQLite using SQLAlchemy."""
|
|
10
|
+
|
|
11
|
+
def __init__(self):
|
|
12
|
+
self.db_manager = DatabaseManager()
|
|
13
|
+
self.session: Session = self.db_manager.get_session("default")
|
|
14
|
+
|
|
15
|
+
def get_models(self) -> list:
|
|
16
|
+
"""
|
|
17
|
+
Retrieves all AI models from the database.
|
|
18
|
+
|
|
19
|
+
Returns:
|
|
20
|
+
list: A list of AIModelEntity objects.
|
|
21
|
+
"""
|
|
22
|
+
try:
|
|
23
|
+
models = self.session.query(AIModelEntity).all()
|
|
24
|
+
return models
|
|
25
|
+
except SQLAlchemyError as e:
|
|
26
|
+
logging.error(f"Error retrieving models: {e}")
|
|
27
|
+
return []
|
|
28
|
+
|
|
29
|
+
def get_model_by_id(self, model_id: str) -> AIModelEntity:
|
|
30
|
+
"""
|
|
31
|
+
Retrieves a specific AI model by ID from the database.
|
|
32
|
+
|
|
33
|
+
Args:
|
|
34
|
+
model_id (str): The ID of the model to retrieve.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
AIModelEntity: The model entity if found, None otherwise.
|
|
38
|
+
"""
|
|
39
|
+
try:
|
|
40
|
+
model = self.session.query(AIModelEntity).filter(AIModelEntity.id == model_id).first()
|
|
41
|
+
return model
|
|
42
|
+
except SQLAlchemyError as e:
|
|
43
|
+
logging.error(f"Error retrieving model {model_id}: {e}")
|
|
44
|
+
return None
|