nedo-vision-worker 1.3.10__tar.gz

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.
Files changed (109) hide show
  1. nedo_vision_worker-1.3.10/PKG-INFO +565 -0
  2. nedo_vision_worker-1.3.10/README.md +510 -0
  3. nedo_vision_worker-1.3.10/nedo_vision_worker/__init__.py +10 -0
  4. nedo_vision_worker-1.3.10/nedo_vision_worker/bootstrap.py +51 -0
  5. nedo_vision_worker-1.3.10/nedo_vision_worker/cli.py +75 -0
  6. nedo_vision_worker-1.3.10/nedo_vision_worker/config/ConfigurationManager.py +191 -0
  7. nedo_vision_worker-1.3.10/nedo_vision_worker/config/ConfigurationManagerInterface.py +12 -0
  8. nedo_vision_worker-1.3.10/nedo_vision_worker/config/DummyConfigurationManager.py +52 -0
  9. nedo_vision_worker-1.3.10/nedo_vision_worker/config/__init__.py +1 -0
  10. nedo_vision_worker-1.3.10/nedo_vision_worker/database/DatabaseManager.py +235 -0
  11. nedo_vision_worker-1.3.10/nedo_vision_worker/database/__init__.py +1 -0
  12. nedo_vision_worker-1.3.10/nedo_vision_worker/doctor.py +1163 -0
  13. nedo_vision_worker-1.3.10/nedo_vision_worker/models/__init__.py +15 -0
  14. nedo_vision_worker-1.3.10/nedo_vision_worker/models/ai_model.py +62 -0
  15. nedo_vision_worker-1.3.10/nedo_vision_worker/models/auth.py +14 -0
  16. nedo_vision_worker-1.3.10/nedo_vision_worker/models/config.py +9 -0
  17. nedo_vision_worker-1.3.10/nedo_vision_worker/models/dataset_source.py +30 -0
  18. nedo_vision_worker-1.3.10/nedo_vision_worker/models/logs.py +9 -0
  19. nedo_vision_worker-1.3.10/nedo_vision_worker/models/ppe_detection.py +39 -0
  20. nedo_vision_worker-1.3.10/nedo_vision_worker/models/ppe_detection_label.py +20 -0
  21. nedo_vision_worker-1.3.10/nedo_vision_worker/models/restricted_area_violation.py +20 -0
  22. nedo_vision_worker-1.3.10/nedo_vision_worker/models/user.py +10 -0
  23. nedo_vision_worker-1.3.10/nedo_vision_worker/models/worker_source.py +19 -0
  24. nedo_vision_worker-1.3.10/nedo_vision_worker/models/worker_source_pipeline.py +22 -0
  25. nedo_vision_worker-1.3.10/nedo_vision_worker/models/worker_source_pipeline_config.py +24 -0
  26. nedo_vision_worker-1.3.10/nedo_vision_worker/models/worker_source_pipeline_debug.py +15 -0
  27. nedo_vision_worker-1.3.10/nedo_vision_worker/models/worker_source_pipeline_detection.py +14 -0
  28. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/AIModelService_pb2.py +48 -0
  29. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/AIModelService_pb2_grpc.py +140 -0
  30. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/DatasetSourceService_pb2.py +46 -0
  31. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/DatasetSourceService_pb2_grpc.py +140 -0
  32. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/HumanDetectionService_pb2.py +44 -0
  33. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/HumanDetectionService_pb2_grpc.py +140 -0
  34. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/PPEDetectionService_pb2.py +46 -0
  35. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/PPEDetectionService_pb2_grpc.py +140 -0
  36. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/VisionWorkerService_pb2.py +72 -0
  37. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/VisionWorkerService_pb2_grpc.py +471 -0
  38. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/WorkerSourcePipelineService_pb2.py +64 -0
  39. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/WorkerSourcePipelineService_pb2_grpc.py +312 -0
  40. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/WorkerSourceService_pb2.py +50 -0
  41. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/WorkerSourceService_pb2_grpc.py +183 -0
  42. nedo_vision_worker-1.3.10/nedo_vision_worker/protos/__init__.py +1 -0
  43. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/AIModelRepository.py +44 -0
  44. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/DatasetSourceRepository.py +150 -0
  45. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/PPEDetectionRepository.py +147 -0
  46. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/RestrictedAreaRepository.py +123 -0
  47. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/WorkerSourcePipelineDebugRepository.py +90 -0
  48. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/WorkerSourcePipelineDetectionRepository.py +48 -0
  49. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/WorkerSourcePipelineRepository.py +174 -0
  50. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/WorkerSourceRepository.py +55 -0
  51. nedo_vision_worker-1.3.10/nedo_vision_worker/repositories/__init__.py +1 -0
  52. nedo_vision_worker-1.3.10/nedo_vision_worker/services/AIModelClient.py +386 -0
  53. nedo_vision_worker-1.3.10/nedo_vision_worker/services/ConnectionInfoClient.py +57 -0
  54. nedo_vision_worker-1.3.10/nedo_vision_worker/services/DatasetSourceClient.py +88 -0
  55. nedo_vision_worker-1.3.10/nedo_vision_worker/services/DirectDeviceToRTMPStreamer.py +585 -0
  56. nedo_vision_worker-1.3.10/nedo_vision_worker/services/FileToRTMPServer.py +82 -0
  57. nedo_vision_worker-1.3.10/nedo_vision_worker/services/GrpcClientBase.py +179 -0
  58. nedo_vision_worker-1.3.10/nedo_vision_worker/services/GrpcClientManager.py +141 -0
  59. nedo_vision_worker-1.3.10/nedo_vision_worker/services/GrpcConnection.py +147 -0
  60. nedo_vision_worker-1.3.10/nedo_vision_worker/services/ImageUploadClient.py +82 -0
  61. nedo_vision_worker-1.3.10/nedo_vision_worker/services/PPEDetectionClient.py +125 -0
  62. nedo_vision_worker-1.3.10/nedo_vision_worker/services/RTSPtoRTMPStreamer.py +100 -0
  63. nedo_vision_worker-1.3.10/nedo_vision_worker/services/RestrictedAreaClient.py +121 -0
  64. nedo_vision_worker-1.3.10/nedo_vision_worker/services/SharedDirectDeviceClient.py +278 -0
  65. nedo_vision_worker-1.3.10/nedo_vision_worker/services/SharedVideoStreamServer.py +315 -0
  66. nedo_vision_worker-1.3.10/nedo_vision_worker/services/SystemUsageClient.py +78 -0
  67. nedo_vision_worker-1.3.10/nedo_vision_worker/services/SystemWideDeviceCoordinator.py +236 -0
  68. nedo_vision_worker-1.3.10/nedo_vision_worker/services/VideoSharingDaemon.py +832 -0
  69. nedo_vision_worker-1.3.10/nedo_vision_worker/services/VideoStreamClient.py +184 -0
  70. nedo_vision_worker-1.3.10/nedo_vision_worker/services/WorkerSourceClient.py +226 -0
  71. nedo_vision_worker-1.3.10/nedo_vision_worker/services/WorkerSourcePipelineClient.py +444 -0
  72. nedo_vision_worker-1.3.10/nedo_vision_worker/services/WorkerSourceUpdater.py +182 -0
  73. nedo_vision_worker-1.3.10/nedo_vision_worker/services/WorkerStatusClient.py +65 -0
  74. nedo_vision_worker-1.3.10/nedo_vision_worker/services/__init__.py +1 -0
  75. nedo_vision_worker-1.3.10/nedo_vision_worker/util/CorruptedImageValidator.py +55 -0
  76. nedo_vision_worker-1.3.10/nedo_vision_worker/util/EncoderSelector.py +109 -0
  77. nedo_vision_worker-1.3.10/nedo_vision_worker/util/FFmpegUtil.py +73 -0
  78. nedo_vision_worker-1.3.10/nedo_vision_worker/util/HardwareID.py +104 -0
  79. nedo_vision_worker-1.3.10/nedo_vision_worker/util/ImageUploader.py +92 -0
  80. nedo_vision_worker-1.3.10/nedo_vision_worker/util/Networking.py +94 -0
  81. nedo_vision_worker-1.3.10/nedo_vision_worker/util/PlatformDetector.py +50 -0
  82. nedo_vision_worker-1.3.10/nedo_vision_worker/util/SystemMonitor.py +302 -0
  83. nedo_vision_worker-1.3.10/nedo_vision_worker/util/VideoProbeUtil.py +325 -0
  84. nedo_vision_worker-1.3.10/nedo_vision_worker/util/__init__.py +1 -0
  85. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/CoreActionWorker.py +136 -0
  86. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/DataSenderWorker.py +206 -0
  87. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/DataSyncWorker.py +144 -0
  88. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/DatasetFrameSender.py +208 -0
  89. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/DatasetFrameWorker.py +410 -0
  90. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/PPEDetectionManager.py +145 -0
  91. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/PipelineActionWorker.py +140 -0
  92. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/PipelineImageWorker.py +127 -0
  93. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/PipelinePreviewWorker.py +160 -0
  94. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/RabbitMQListener.py +177 -0
  95. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/RestrictedAreaManager.py +143 -0
  96. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/SystemUsageManager.py +130 -0
  97. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/VideoStreamWorker.py +174 -0
  98. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/WorkerManager.py +132 -0
  99. nedo_vision_worker-1.3.10/nedo_vision_worker/worker/__init__.py +1 -0
  100. nedo_vision_worker-1.3.10/nedo_vision_worker/worker_service.py +204 -0
  101. nedo_vision_worker-1.3.10/nedo_vision_worker.egg-info/PKG-INFO +565 -0
  102. nedo_vision_worker-1.3.10/nedo_vision_worker.egg-info/SOURCES.txt +107 -0
  103. nedo_vision_worker-1.3.10/nedo_vision_worker.egg-info/dependency_links.txt +1 -0
  104. nedo_vision_worker-1.3.10/nedo_vision_worker.egg-info/entry_points.txt +2 -0
  105. nedo_vision_worker-1.3.10/nedo_vision_worker.egg-info/requires.txt +24 -0
  106. nedo_vision_worker-1.3.10/nedo_vision_worker.egg-info/top_level.txt +1 -0
  107. nedo_vision_worker-1.3.10/pyproject.toml +152 -0
  108. nedo_vision_worker-1.3.10/setup.cfg +4 -0
  109. nedo_vision_worker-1.3.10/setup.py +13 -0
@@ -0,0 +1,565 @@
1
+ Metadata-Version: 2.4
2
+ Name: nedo-vision-worker
3
+ Version: 1.3.10
4
+ Summary: Nedo Vision Worker Service Library for AI Vision Processing
5
+ Author-email: Willy Achmat Fauzi <willy.achmat@gmail.com>
6
+ Maintainer-email: Willy Achmat Fauzi <willy.achmat@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
9
+ Project-URL: Documentation, https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service/-/blob/main/README.md
10
+ Project-URL: Repository, https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
11
+ Project-URL: Bug Reports, https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service/-/issues
12
+ Keywords: computer-vision,machine-learning,ai,worker-service,deep-learning,object-detection,neural-networks,video-processing
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Operating System :: Microsoft :: Windows
18
+ Classifier: Operating System :: MacOS
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3 :: Only
21
+ Classifier: Programming Language :: Python :: 3.8
22
+ Classifier: Programming Language :: Python :: 3.9
23
+ Classifier: Programming Language :: Python :: 3.10
24
+ Classifier: Programming Language :: Python :: 3.11
25
+ Classifier: Programming Language :: Python :: 3.12
26
+ Classifier: Programming Language :: Python :: 3.13
27
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
28
+ Classifier: Topic :: Multimedia :: Video
29
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
30
+ Classifier: Topic :: System :: Hardware
31
+ Classifier: Environment :: GPU
32
+ Classifier: Environment :: No Input/Output (Daemon)
33
+ Requires-Python: >=3.8
34
+ Description-Content-Type: text/markdown
35
+ Requires-Dist: alembic>=1.8.0
36
+ Requires-Dist: ffmpeg-python>=0.2.0
37
+ Requires-Dist: grpcio>=1.50.0
38
+ Requires-Dist: pika>=1.3.0
39
+ Requires-Dist: protobuf>=3.20.0
40
+ Requires-Dist: psutil>=5.9.0
41
+ Requires-Dist: requests>=2.28.0
42
+ Requires-Dist: SQLAlchemy>=1.4.0
43
+ Requires-Dist: Pillow>=12.1.0
44
+ Requires-Dist: opencv-python-headless>=4.6.0
45
+ Requires-Dist: pynvml>=11.4.1; platform_system != "Darwin" or platform_machine != "arm64"
46
+ Provides-Extra: opencv
47
+ Requires-Dist: opencv-python>=4.6.0; extra == "opencv"
48
+ Provides-Extra: dev
49
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
50
+ Requires-Dist: black>=22.0.0; extra == "dev"
51
+ Requires-Dist: isort>=5.10.0; extra == "dev"
52
+ Requires-Dist: mypy>=0.950; extra == "dev"
53
+ Requires-Dist: flake8>=4.0.0; extra == "dev"
54
+ Requires-Dist: pre-commit>=2.17.0; extra == "dev"
55
+
56
+ # Nedo Vision Worker Service
57
+
58
+ A high-performance, multiplatform Python worker service for the Nedo Vision system that handles AI-powered computer vision tasks with GPU acceleration support.
59
+
60
+ ## 🚀 Features
61
+
62
+ - **🎯 AI-Powered Computer Vision** - Advanced object detection and video processing
63
+ - **🔐 Token-Based Authentication** - Secure worker registration and management
64
+ - **⚡ GPU Acceleration** - NVIDIA CUDA support for high-performance inference
65
+ - **🌍 Multiplatform Support** - Linux, Windows, macOS, ARM devices, and cloud platforms
66
+ - **🚀 Jetson Optimized** - Native support for NVIDIA Jetson devices
67
+ - **☁️ Cloud Ready** - Docker, Kubernetes, and major cloud platform support
68
+ - **🔧 Self-Diagnostic** - Built-in system requirements checker
69
+ - **📊 Real-time Monitoring** - System usage and performance metrics
70
+
71
+ ## 📋 System Requirements
72
+
73
+ ### Minimum Requirements
74
+
75
+ - **Python**: 3.8+
76
+ - **CPU**: 2 cores, 1.5 GHz
77
+ - **RAM**: 2 GB
78
+ - **Storage**: 1 GB free space
79
+
80
+ ### Recommended Requirements
81
+
82
+ - **CPU**: 4+ cores, 2.0+ GHz
83
+ - **RAM**: 4+ GB (8+ GB for GPU acceleration)
84
+ - **GPU**: NVIDIA GPU with CUDA support (optional)
85
+ - **Storage**: 5+ GB free space
86
+
87
+ ### Supported Platforms
88
+
89
+ - **Linux** (x86_64, ARM64, ARMv7) - Ubuntu, Debian, CentOS, Alpine
90
+ - **Windows** (x86_64) - Windows 10+, Server 2019+
91
+ - **macOS** (x86_64, Apple Silicon) - macOS 10.15+
92
+ - **NVIDIA Jetson** - Nano, Xavier NX, Xavier AGX, Orin
93
+ - **Cloud Platforms** - AWS, GCP, Azure (with GPU instance support)
94
+
95
+ ## 🛠️ Installation
96
+
97
+ ### Quick Install (PyPI)
98
+
99
+ ```bash
100
+ pip install nedo-vision-worker
101
+ ```
102
+
103
+ ### Platform-Specific Installation
104
+
105
+ #### Standard Linux/Windows/macOS
106
+
107
+ ```bash
108
+ # Install from PyPI
109
+ pip install nedo-vision-worker
110
+
111
+ # Verify installation
112
+ nedo-worker doctor
113
+ ```
114
+
115
+ #### NVIDIA Jetson Devices
116
+
117
+ ```bash
118
+ # Use system OpenCV for optimal performance
119
+ sudo apt install python3-opencv
120
+
121
+ # Install without OpenCV dependency
122
+ pip install nedo-vision-worker --no-deps
123
+ pip install alembic ffmpeg-python grpcio pika protobuf psutil pynvml requests SQLAlchemy
124
+
125
+ # Verify Jetson-specific features
126
+ nedo-worker doctor
127
+ ```
128
+
129
+ #### ARM Devices (Raspberry Pi, etc.)
130
+
131
+ ```bash
132
+ # Install with ARM-optimized packages
133
+ pip install nedo-vision-worker
134
+
135
+ # For headless servers, use lightweight OpenCV
136
+ pip install opencv-python-headless --upgrade
137
+ ```
138
+
139
+ #### Docker Deployment
140
+
141
+ ```dockerfile
142
+ # GPU-enabled container
143
+ FROM nvidia/cuda:11.8-runtime-ubuntu20.04
144
+ RUN pip install nedo-vision-worker
145
+
146
+ # CPU-only container
147
+ FROM python:3.9-slim
148
+ RUN apt-get update && apt-get install -y ffmpeg
149
+ RUN pip install nedo-vision-worker
150
+ ```
151
+
152
+ ### Development Installation
153
+
154
+ ```bash
155
+ # Clone the repository
156
+ git clone https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
157
+ cd nedo-vision-worker-service
158
+
159
+ # Create virtual environment
160
+ python -m venv venv
161
+ source venv/bin/activate # On Windows: venv\Scripts\activate
162
+
163
+ # Install in development mode
164
+ pip install -e .
165
+
166
+ # Install development dependencies
167
+ pip install -e .[dev]
168
+ ```
169
+
170
+ See [INSTALL.md](INSTALL.md) for detailed installation instructions.
171
+
172
+ ## 🔍 System Diagnostics
173
+
174
+ Before running the worker service, use the built-in diagnostic tool to verify your system:
175
+
176
+ ```bash
177
+ nedo-worker doctor
178
+ ```
179
+
180
+ This will check:
181
+
182
+ - ✅ Platform compatibility and architecture
183
+ - ✅ Python version and dependencies
184
+ - ✅ FFmpeg installation and functionality
185
+ - ✅ OpenCV installation and optimizations
186
+ - ✅ NVIDIA GPU support and capabilities
187
+ - ✅ Storage permissions
188
+
189
+ ## 📖 Quick Start
190
+
191
+ ### 1. Get Your Worker Token
192
+
193
+ 1. Access the Nedo Vision frontend
194
+ 2. Navigate to Worker Management
195
+ 3. Create a new worker
196
+ 4. Copy the generated authentication token
197
+
198
+ ### 2. Run System Check
199
+
200
+ ```bash
201
+ nedo-worker doctor
202
+ ```
203
+
204
+ ### 3. Start the Worker Service
205
+
206
+ ```bash
207
+ # Basic usage
208
+ nedo-worker run --token YOUR_TOKEN_HERE
209
+
210
+ # With custom configuration
211
+ nedo-worker run --token YOUR_TOKEN_HERE \
212
+ --server-host custom.server.com \
213
+ --storage-path /custom/storage/path \
214
+ --system-usage-interval 60
215
+ ```
216
+
217
+ ## 💻
218
+
219
+ ## 💻 Usage
220
+
221
+ ### Command Line Interface
222
+
223
+ The service uses a modern CLI with subcommands:
224
+
225
+ ```bash
226
+ # Check system compatibility and requirements
227
+ nedo-worker doctor
228
+
229
+ # Run the worker service
230
+ nedo-worker run --token YOUR_TOKEN
231
+
232
+ # Get help
233
+ nedo-worker --help
234
+ nedo-worker run --help
235
+ nedo-worker doctor --help
236
+ ```
237
+
238
+ ### Available Commands
239
+
240
+ #### `doctor` - System Diagnostics
241
+
242
+ ```bash
243
+ # Run comprehensive system check
244
+ nedo-worker doctor
245
+
246
+ # Check specific components
247
+ nedo-worker doctor --verbose
248
+ ```
249
+
250
+ #### `run` - Start Worker Service
251
+
252
+ ```bash
253
+ # Basic usage
254
+ nedo-worker run --token YOUR_TOKEN
255
+
256
+ # Advanced configuration
257
+ nedo-worker run \
258
+ --token YOUR_TOKEN \
259
+ --server-host be.vision.sindika.co.id \
260
+ --server-port 50051 \
261
+ --storage-path ./data \
262
+ --system-usage-interval 30
263
+ ```
264
+
265
+ ### Configuration Options
266
+
267
+ | Parameter | Description | Default | Required |
268
+ | ------------------------- | --------------------------------- | ------------------------- | -------- |
269
+ | `--token` | Worker authentication token | - | ✅ |
270
+ | `--server-host` | Backend server hostname | `be.vision.sindika.co.id` | ❌ |
271
+ | `--server-port` | Backend server port | `50051` | ❌ |
272
+ | `--storage-path` | Local storage directory ⚠️\* | `./data` | ❌ |
273
+ | `--system-usage-interval` | System metrics interval (seconds) | `30` | ❌ |
274
+
275
+ > **⚠️ Storage Path Note**: If using **Nedo Vision Worker Core**, both services must use the **same storage path** for proper data sharing and model access.
276
+
277
+ ### Programmatic Usage
278
+
279
+ ```python
280
+ from nedo_vision_worker.worker_service import WorkerService
281
+
282
+ # Create service instance
283
+ service = WorkerService(
284
+ server_host="be.vision.sindika.co.id",
285
+ token="your-token-here",
286
+ storage_path="./custom_storage",
287
+ system_usage_interval=60
288
+ )
289
+
290
+ # Initialize and run
291
+ if service.initialize():
292
+ print("Service initialized successfully")
293
+ service.run() # This blocks until service stops
294
+ else:
295
+ print("Failed to initialize service")
296
+ ```
297
+
298
+ ### Connection Information Client
299
+
300
+ ```python
301
+ from nedo_vision_worker.services.ConnectionInfoClient import ConnectionInfoClient
302
+
303
+ # Create client
304
+ client = ConnectionInfoClient(
305
+ host="be.vision.sindika.co.id",
306
+ port=50051,
307
+ token="your-token-here"
308
+ )
309
+
310
+ # Get connection information
311
+ result = client.get_connection_info()
312
+ if result["success"]:
313
+ print(f"RabbitMQ Host: {result['rabbitmq_host']}")
314
+ print(f"RabbitMQ Port: {result['rabbitmq_port']}")
315
+ print(f"Database URL: {result['database_url']}")
316
+ else:
317
+ print(f"Error: {result['error']}")
318
+ ```
319
+
320
+ ## 🔐 Authentication Flow
321
+
322
+ 1. **Worker Registration**: Create a worker through the Nedo Vision frontend
323
+ 2. **Token Generation**: System generates a unique authentication token
324
+ 3. **Service Initialization**: Worker service authenticates using the token
325
+ 4. **Connection Setup**: Service establishes secure connections to backend services
326
+ 5. **Task Processing**: Worker receives and processes computer vision tasks
327
+ 6. **Monitoring**: Continuous system monitoring and health reporting
328
+
329
+ ## ⚙️ Configuration Management
330
+
331
+ ## ⚙️ Configuration Management
332
+
333
+ > **⚠️ Important Notice - Storage Path Coordination**
334
+ >
335
+ > If you're using **Nedo Vision Worker Core** alongside this service, ensure both services use the **same storage path**. This is critical for proper data sharing and model access between services.
336
+ >
337
+ > ```bash
338
+ > # Example: Both services should use identical storage paths
339
+ > nedo-worker run --token YOUR_TOKEN --storage-path /shared/nedo/storage
340
+ > nedo-worker-core --storage-path /shared/nedo/storage
341
+ > ```
342
+ >
343
+ > The storage path contains:
344
+ >
345
+ > - 📁 **Models** - Shared AI models and weights
346
+ > - 📁 **Temporary files** - Processing artifacts and cache
347
+ > - 📁 **Logs** - Service operation logs
348
+ > - 📁 **Configurations** - Runtime settings and preferences
349
+
350
+ ### Environment Variables (Legacy Support)
351
+
352
+ ```bash
353
+ export NEDO_WORKER_TOKEN="your-token-here"
354
+ export NEDO_SERVER_HOST="be.vision.sindika.co.id"
355
+ export NEDO_STORAGE_PATH="./data"
356
+
357
+ # Run with environment variables (deprecated)
358
+ nedo-worker run
359
+ ```
360
+
361
+ ### Configuration Priority
362
+
363
+ 1. **Command-line arguments** (highest priority)
364
+ 2. **Environment variables** (legacy support)
365
+ 3. **Default values** (lowest priority)
366
+
367
+ ## 🚀 Platform-Specific Setup
368
+
369
+ ### Windows Setup
370
+
371
+ #### Prerequisites
372
+
373
+ ```powershell
374
+ # Install Chocolatey (package manager)
375
+ Set-ExecutionPolicy Bypass -Scope Process -Force
376
+ [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
377
+ iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
378
+
379
+ # Install FFmpeg
380
+ choco install ffmpeg -y
381
+
382
+ # Verify installation
383
+ ffmpeg -version
384
+ ```
385
+
386
+ #### Worker Installation
387
+
388
+ ```powershell
389
+ # Install Python package
390
+ pip install nedo-vision-worker
391
+
392
+ # Run system check
393
+ nedo-worker doctor
394
+
395
+ # Start worker
396
+ nedo-worker run --token YOUR_TOKEN
397
+ ```
398
+
399
+ ### Linux Setup
400
+
401
+ #### Ubuntu/Debian
402
+
403
+ ```bash
404
+ # Update system
405
+ sudo apt update
406
+
407
+ # Install FFmpeg
408
+ sudo apt install ffmpeg python3-pip
409
+
410
+ # Install worker
411
+ pip3 install nedo-vision-worker
412
+
413
+ # Run diagnostics
414
+ nedo-worker doctor
415
+ ```
416
+
417
+ #### CentOS/RHEL
418
+
419
+ ```bash
420
+ # Install EPEL repository
421
+ sudo yum install epel-release
422
+
423
+ # Install dependencies
424
+ sudo yum install ffmpeg python3-pip
425
+
426
+ # Install worker
427
+ pip3 install nedo-vision-worker
428
+ ```
429
+
430
+ ### NVIDIA Jetson Setup
431
+
432
+ ```bash
433
+ # Ensure JetPack is installed
434
+ sudo apt update
435
+
436
+ # Use system OpenCV (optimized for Jetson)
437
+ sudo apt install python3-opencv
438
+
439
+ # Install worker without OpenCV
440
+ pip3 install nedo-vision-worker --no-deps
441
+ pip3 install alembic ffmpeg-python grpcio pika protobuf psutil pynvml requests SQLAlchemy
442
+
443
+ # Verify GPU support
444
+ nedo-worker doctor
445
+
446
+ # Check Jetson stats
447
+ sudo /usr/bin/tegrastats
448
+ ```
449
+
450
+ ### macOS Setup
451
+
452
+ ```bash
453
+ # Install Homebrew (if not installed)
454
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
455
+
456
+ # Install FFmpeg
457
+ brew install ffmpeg
458
+
459
+ # Install worker
460
+ pip3 install nedo-vision-worker
461
+
462
+ # Run diagnostics
463
+ nedo-worker doctor
464
+ ```
465
+
466
+ ## 🔧 Troubleshooting
467
+
468
+ ### Common Issues
469
+
470
+ #### 1. FFmpeg Not Found
471
+
472
+ ```bash
473
+ # Check if FFmpeg is installed
474
+ ffmpeg -version
475
+
476
+ # Install FFmpeg
477
+ # Ubuntu/Debian: sudo apt install ffmpeg
478
+ # Windows: choco install ffmpeg
479
+ # macOS: brew install ffmpeg
480
+ ```
481
+
482
+ #### 2. OpenCV Issues on ARM
483
+
484
+ ```bash
485
+ # For ARM devices, try headless version
486
+ pip uninstall opencv-python
487
+ pip install opencv-python-headless
488
+ ```
489
+
490
+ #### 3. GPU Not Detected
491
+
492
+ ```bash
493
+ # Check NVIDIA drivers
494
+ nvidia-smi
495
+
496
+ # Check CUDA installation
497
+ nvcc --version
498
+
499
+ # Run system diagnostics
500
+ nedo-worker doctor
501
+ ```
502
+
503
+ #### 4. Connection Issues
504
+
505
+ ```bash
506
+ # Test network connectivity
507
+ ping be.vision.sindika.co.id
508
+
509
+ # Check firewall settings
510
+ # Ensure port 50051 is accessible
511
+
512
+ # Verify token
513
+ nedo-worker run --token YOUR_TOKEN --verbose
514
+ ```
515
+
516
+ ### Debug Mode
517
+
518
+ ```bash
519
+ # Run with verbose logging
520
+ nedo-worker run --token YOUR_TOKEN --verbose
521
+
522
+ # Check logs
523
+ tail -f ~/.nedo_worker/logs/worker.log
524
+ ```
525
+
526
+ ### Performance Optimization
527
+
528
+ #### For High-Performance Workloads
529
+
530
+ ```bash
531
+ # Increase system usage interval
532
+ nedo-worker run --token YOUR_TOKEN --system-usage-interval 60
533
+
534
+ # Use dedicated storage path
535
+ nedo-worker run --token YOUR_TOKEN --storage-path /fast/ssd/storage
536
+ ```
537
+
538
+ #### For Resource-Constrained Devices
539
+
540
+ ```bash
541
+ # Use minimal configuration
542
+ nedo-worker run --token YOUR_TOKEN --system-usage-interval 120
543
+ ```
544
+
545
+ ### Development Setup
546
+
547
+ ```bash
548
+ # Clone and setup
549
+ git clone https://gitlab.com/sindika/research/nedo-vision/nedo-vision-worker-service
550
+ cd nedo-vision-worker-service
551
+
552
+ # Create virtual environment
553
+ python -m venv venv
554
+ source venv/bin/activate
555
+
556
+ # Install in development mode
557
+ pip install -e .[dev]
558
+
559
+ # Run tests
560
+ pytest
561
+
562
+ # Format code
563
+ black .
564
+ isort .
565
+ ```