nedo-vision-worker 1.1.3__py3-none-any.whl → 1.2.1__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 +1 -1
- nedo_vision_worker/cli.py +196 -167
- nedo_vision_worker/database/DatabaseManager.py +3 -3
- nedo_vision_worker/doctor.py +1066 -386
- nedo_vision_worker/models/ai_model.py +35 -2
- nedo_vision_worker/protos/AIModelService_pb2.py +12 -10
- nedo_vision_worker/protos/AIModelService_pb2_grpc.py +1 -1
- nedo_vision_worker/protos/DatasetSourceService_pb2.py +2 -2
- nedo_vision_worker/protos/DatasetSourceService_pb2_grpc.py +1 -1
- nedo_vision_worker/protos/HumanDetectionService_pb2.py +2 -2
- nedo_vision_worker/protos/HumanDetectionService_pb2_grpc.py +1 -1
- nedo_vision_worker/protos/PPEDetectionService_pb2.py +2 -2
- nedo_vision_worker/protos/PPEDetectionService_pb2_grpc.py +1 -1
- nedo_vision_worker/protos/VisionWorkerService_pb2.py +2 -2
- nedo_vision_worker/protos/VisionWorkerService_pb2_grpc.py +1 -1
- nedo_vision_worker/protos/WorkerSourcePipelineService_pb2.py +2 -2
- nedo_vision_worker/protos/WorkerSourcePipelineService_pb2_grpc.py +1 -1
- nedo_vision_worker/protos/WorkerSourceService_pb2.py +2 -2
- nedo_vision_worker/protos/WorkerSourceService_pb2_grpc.py +1 -1
- nedo_vision_worker/services/AIModelClient.py +184 -160
- nedo_vision_worker/services/DirectDeviceToRTMPStreamer.py +534 -0
- nedo_vision_worker/services/GrpcClientBase.py +142 -108
- nedo_vision_worker/services/PPEDetectionClient.py +0 -7
- nedo_vision_worker/services/RestrictedAreaClient.py +0 -5
- nedo_vision_worker/services/SharedDirectDeviceClient.py +278 -0
- nedo_vision_worker/services/SharedVideoStreamServer.py +315 -0
- nedo_vision_worker/services/SystemWideDeviceCoordinator.py +236 -0
- nedo_vision_worker/services/VideoSharingDaemon.py +832 -0
- nedo_vision_worker/services/VideoStreamClient.py +43 -20
- nedo_vision_worker/services/WorkerSourceClient.py +1 -1
- nedo_vision_worker/services/WorkerSourcePipelineClient.py +35 -12
- nedo_vision_worker/services/WorkerSourceUpdater.py +30 -3
- nedo_vision_worker/util/FFmpegUtil.py +124 -0
- nedo_vision_worker/util/VideoProbeUtil.py +227 -17
- nedo_vision_worker/worker/DataSyncWorker.py +1 -0
- nedo_vision_worker/worker/PipelineImageWorker.py +1 -1
- nedo_vision_worker/worker/VideoStreamWorker.py +27 -3
- nedo_vision_worker/worker/WorkerManager.py +2 -29
- nedo_vision_worker/worker_service.py +22 -5
- {nedo_vision_worker-1.1.3.dist-info → nedo_vision_worker-1.2.1.dist-info}/METADATA +1 -3
- {nedo_vision_worker-1.1.3.dist-info → nedo_vision_worker-1.2.1.dist-info}/RECORD +44 -38
- {nedo_vision_worker-1.1.3.dist-info → nedo_vision_worker-1.2.1.dist-info}/WHEEL +0 -0
- {nedo_vision_worker-1.1.3.dist-info → nedo_vision_worker-1.2.1.dist-info}/entry_points.txt +0 -0
- {nedo_vision_worker-1.1.3.dist-info → nedo_vision_worker-1.2.1.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import uuid
|
|
2
|
+
import json
|
|
2
3
|
from sqlalchemy import Column, String, DateTime
|
|
3
|
-
from datetime import datetime
|
|
4
4
|
from ..database.DatabaseManager import Base
|
|
5
5
|
|
|
6
6
|
class AIModelEntity(Base):
|
|
@@ -15,6 +15,9 @@ class AIModelEntity(Base):
|
|
|
15
15
|
download_status = Column(String, nullable=True, default="completed") # pending, downloading, completed, failed
|
|
16
16
|
last_download_attempt = Column(DateTime, nullable=True)
|
|
17
17
|
download_error = Column(String, nullable=True)
|
|
18
|
+
classes = Column(String, nullable=True)
|
|
19
|
+
ppe_class_groups = Column(String, nullable=True)
|
|
20
|
+
main_class = Column(String, nullable=True)
|
|
18
21
|
|
|
19
22
|
def __repr__(self):
|
|
20
23
|
return (
|
|
@@ -26,4 +29,34 @@ class AIModelEntity(Base):
|
|
|
26
29
|
return (
|
|
27
30
|
f"AIModelEntity(id={self.id}, name={self.name}, type={self.type}, "
|
|
28
31
|
f"file={self.file}, version={self.version}, status={self.download_status})"
|
|
29
|
-
)
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
def is_ready_for_use(self) -> bool:
|
|
35
|
+
"""Check if the model is ready for use (downloaded and available)."""
|
|
36
|
+
return self.download_status == "completed"
|
|
37
|
+
|
|
38
|
+
def is_downloading(self) -> bool:
|
|
39
|
+
"""Check if the model is currently being downloaded."""
|
|
40
|
+
return self.download_status in ["pending", "downloading"]
|
|
41
|
+
|
|
42
|
+
def has_download_failed(self) -> bool:
|
|
43
|
+
"""Check if the model download has failed."""
|
|
44
|
+
return self.download_status == "failed"
|
|
45
|
+
|
|
46
|
+
def set_classes(self, classes_list):
|
|
47
|
+
self.classes = json.dumps(classes_list)
|
|
48
|
+
|
|
49
|
+
def get_classes(self):
|
|
50
|
+
return json.loads(self.classes) if self.classes else []
|
|
51
|
+
|
|
52
|
+
def set_ppe_class_groups(self, groups_list):
|
|
53
|
+
self.ppe_class_groups = json.dumps(groups_list)
|
|
54
|
+
|
|
55
|
+
def get_ppe_class_groups(self):
|
|
56
|
+
return json.loads(self.ppe_class_groups) if self.ppe_class_groups else []
|
|
57
|
+
|
|
58
|
+
def set_main_class(self, main_class):
|
|
59
|
+
self.main_class = main_class
|
|
60
|
+
|
|
61
|
+
def get_main_class(self):
|
|
62
|
+
return self.main_class or None
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: nedo_vision_worker/protos/AIModelService.proto
|
|
5
|
-
# Protobuf Python Version: 6.31.
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -13,7 +13,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
15
|
31,
|
|
16
|
-
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'nedo_vision_worker/protos/AIModelService.proto'
|
|
19
19
|
)
|
|
@@ -24,7 +24,7 @@ _sym_db = _symbol_database.Default()
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.nedo_vision_worker/protos/AIModelService.proto\x12\x1eSindika.AspNet.App005.Services\"9\n\x15GetAIModelListRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"y\n\x16GetAIModelListResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\x12=\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32/.Sindika.AspNet.App005.Services.AIModelResponse\"\
|
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n.nedo_vision_worker/protos/AIModelService.proto\x12\x1eSindika.AspNet.App005.Services\"9\n\x15GetAIModelListRequest\x12\x11\n\tworker_id\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"y\n\x16GetAIModelListResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\x0f\n\x07message\x18\x02 \x01(\t\x12=\n\x04\x64\x61ta\x18\x03 \x03(\x0b\x32/.Sindika.AspNet.App005.Services.AIModelResponse\"\x93\x02\n\x0f\x41IModelResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x1e\n\x16\x61i_model_category_code\x18\x03 \x01(\t\x12\x1a\n\x12\x61i_model_type_code\x18\x04 \x01(\t\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\x11\n\tfile_path\x18\x06 \x01(\t\x12\x11\n\tworker_id\x18\x07 \x01(\t\x12\x0f\n\x07\x63lasses\x18\x08 \x03(\t\x12N\n\x10ppe_class_groups\x18\t \x03(\x0b\x32\x34.Sindika.AspNet.App005.Services.AIModelPPEClassGroup\x12\x12\n\nmain_class\x18\n \x01(\t\"K\n\x14\x41IModelPPEClassGroup\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\ncompliance\x18\x02 \x01(\t\x12\x11\n\tviolation\x18\x03 \x01(\t\"<\n\x16\x44ownloadAIModelRequest\x12\x13\n\x0b\x61i_model_id\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\"-\n\x17\x44ownloadAIModelResponse\x12\x12\n\nfile_chunk\x18\x01 \x01(\x0c\x32\x9c\x02\n\x12\x41IModelGRPCService\x12\x7f\n\x0eGetAIModelList\x12\x35.Sindika.AspNet.App005.Services.GetAIModelListRequest\x1a\x36.Sindika.AspNet.App005.Services.GetAIModelListResponse\x12\x84\x01\n\x0f\x44ownloadAIModel\x12\x36.Sindika.AspNet.App005.Services.DownloadAIModelRequest\x1a\x37.Sindika.AspNet.App005.Services.DownloadAIModelResponse0\x01\x62\x06proto3')
|
|
28
28
|
|
|
29
29
|
_globals = globals()
|
|
30
30
|
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
@@ -36,11 +36,13 @@ if not _descriptor._USE_C_DESCRIPTORS:
|
|
|
36
36
|
_globals['_GETAIMODELLISTRESPONSE']._serialized_start=141
|
|
37
37
|
_globals['_GETAIMODELLISTRESPONSE']._serialized_end=262
|
|
38
38
|
_globals['_AIMODELRESPONSE']._serialized_start=265
|
|
39
|
-
_globals['_AIMODELRESPONSE']._serialized_end=
|
|
40
|
-
_globals['
|
|
41
|
-
_globals['
|
|
42
|
-
_globals['
|
|
43
|
-
_globals['
|
|
44
|
-
_globals['
|
|
45
|
-
_globals['
|
|
39
|
+
_globals['_AIMODELRESPONSE']._serialized_end=540
|
|
40
|
+
_globals['_AIMODELPPECLASSGROUP']._serialized_start=542
|
|
41
|
+
_globals['_AIMODELPPECLASSGROUP']._serialized_end=617
|
|
42
|
+
_globals['_DOWNLOADAIMODELREQUEST']._serialized_start=619
|
|
43
|
+
_globals['_DOWNLOADAIMODELREQUEST']._serialized_end=679
|
|
44
|
+
_globals['_DOWNLOADAIMODELRESPONSE']._serialized_start=681
|
|
45
|
+
_globals['_DOWNLOADAIMODELRESPONSE']._serialized_end=726
|
|
46
|
+
_globals['_AIMODELGRPCSERVICE']._serialized_start=729
|
|
47
|
+
_globals['_AIMODELGRPCSERVICE']._serialized_end=1013
|
|
46
48
|
# @@protoc_insertion_point(module_scope)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from nedo_vision_worker.protos import AIModelService_pb2 as nedo__vision__worker_dot_protos_dot_AIModelService__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.74.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: nedo_vision_worker/protos/DatasetSourceService.proto
|
|
5
|
-
# Protobuf Python Version: 6.31.
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -13,7 +13,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
15
|
31,
|
|
16
|
-
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'nedo_vision_worker/protos/DatasetSourceService.proto'
|
|
19
19
|
)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from nedo_vision_worker.protos import DatasetSourceService_pb2 as nedo__vision__worker_dot_protos_dot_DatasetSourceService__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.74.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: nedo_vision_worker/protos/HumanDetectionService.proto
|
|
5
|
-
# Protobuf Python Version: 6.31.
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -13,7 +13,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
15
|
31,
|
|
16
|
-
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'nedo_vision_worker/protos/HumanDetectionService.proto'
|
|
19
19
|
)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from nedo_vision_worker.protos import HumanDetectionService_pb2 as nedo__vision__worker_dot_protos_dot_HumanDetectionService__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.74.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: nedo_vision_worker/protos/PPEDetectionService.proto
|
|
5
|
-
# Protobuf Python Version: 6.31.
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -13,7 +13,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
15
|
31,
|
|
16
|
-
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'nedo_vision_worker/protos/PPEDetectionService.proto'
|
|
19
19
|
)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from nedo_vision_worker.protos import PPEDetectionService_pb2 as nedo__vision__worker_dot_protos_dot_PPEDetectionService__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.74.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: nedo_vision_worker/protos/VisionWorkerService.proto
|
|
5
|
-
# Protobuf Python Version: 6.31.
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -13,7 +13,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
15
|
31,
|
|
16
|
-
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'nedo_vision_worker/protos/VisionWorkerService.proto'
|
|
19
19
|
)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from nedo_vision_worker.protos import VisionWorkerService_pb2 as nedo__vision__worker_dot_protos_dot_VisionWorkerService__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.74.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: nedo_vision_worker/protos/WorkerSourcePipelineService.proto
|
|
5
|
-
# Protobuf Python Version: 6.31.
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -13,7 +13,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
15
|
31,
|
|
16
|
-
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'nedo_vision_worker/protos/WorkerSourcePipelineService.proto'
|
|
19
19
|
)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from nedo_vision_worker.protos import WorkerSourcePipelineService_pb2 as nedo__vision__worker_dot_protos_dot_WorkerSourcePipelineService__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.74.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
|
4
4
|
# source: nedo_vision_worker/protos/WorkerSourceService.proto
|
|
5
|
-
# Protobuf Python Version: 6.31.
|
|
5
|
+
# Protobuf Python Version: 6.31.1
|
|
6
6
|
"""Generated protocol buffer code."""
|
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
@@ -13,7 +13,7 @@ _runtime_version.ValidateProtobufRuntimeVersion(
|
|
|
13
13
|
_runtime_version.Domain.PUBLIC,
|
|
14
14
|
6,
|
|
15
15
|
31,
|
|
16
|
-
|
|
16
|
+
1,
|
|
17
17
|
'',
|
|
18
18
|
'nedo_vision_worker/protos/WorkerSourceService.proto'
|
|
19
19
|
)
|
|
@@ -5,7 +5,7 @@ import warnings
|
|
|
5
5
|
|
|
6
6
|
from nedo_vision_worker.protos import WorkerSourceService_pb2 as nedo__vision__worker_dot_protos_dot_WorkerSourceService__pb2
|
|
7
7
|
|
|
8
|
-
GRPC_GENERATED_VERSION = '1.
|
|
8
|
+
GRPC_GENERATED_VERSION = '1.74.0'
|
|
9
9
|
GRPC_VERSION = grpc.__version__
|
|
10
10
|
_version_not_supported = False
|
|
11
11
|
|