matrice-inference 0.1.0__py3-none-manylinux_2_17_x86_64.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.
Potentially problematic release.
This version of matrice-inference might be problematic. Click here for more details.
- matrice_inference/deploy/aggregator/aggregator.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/aggregator/aggregator.pyi +55 -0
- matrice_inference/deploy/aggregator/analytics.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/aggregator/analytics.pyi +63 -0
- matrice_inference/deploy/aggregator/ingestor.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/aggregator/ingestor.pyi +79 -0
- matrice_inference/deploy/aggregator/pipeline.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/aggregator/pipeline.pyi +139 -0
- matrice_inference/deploy/aggregator/publisher.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/aggregator/publisher.pyi +59 -0
- matrice_inference/deploy/aggregator/synchronizer.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/aggregator/synchronizer.pyi +58 -0
- matrice_inference/deploy/client/auto_streaming/auto_streaming.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/client/auto_streaming/auto_streaming.pyi +145 -0
- matrice_inference/deploy/client/auto_streaming/auto_streaming_utils.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/client/auto_streaming/auto_streaming_utils.pyi +126 -0
- matrice_inference/deploy/client/client.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/client/client.pyi +337 -0
- matrice_inference/deploy/client/client_stream_utils.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/client/client_stream_utils.pyi +83 -0
- matrice_inference/deploy/client/client_utils.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/client/client_utils.pyi +77 -0
- matrice_inference/deploy/client/streaming_gateway/streaming_gateway.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/client/streaming_gateway/streaming_gateway.pyi +120 -0
- matrice_inference/deploy/client/streaming_gateway/streaming_gateway_utils.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/client/streaming_gateway/streaming_gateway_utils.pyi +442 -0
- matrice_inference/deploy/client/streaming_gateway/streaming_results_handler.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/client/streaming_gateway/streaming_results_handler.pyi +19 -0
- matrice_inference/deploy/optimize/cache_manager.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/optimize/cache_manager.pyi +15 -0
- matrice_inference/deploy/optimize/frame_comparators.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/optimize/frame_comparators.pyi +203 -0
- matrice_inference/deploy/optimize/frame_difference.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/optimize/frame_difference.pyi +165 -0
- matrice_inference/deploy/optimize/transmission.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/optimize/transmission.pyi +97 -0
- matrice_inference/deploy/server/inference/batch_manager.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/inference/batch_manager.pyi +50 -0
- matrice_inference/deploy/server/inference/inference_interface.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/inference/inference_interface.pyi +114 -0
- matrice_inference/deploy/server/inference/model_manager.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/inference/model_manager.pyi +80 -0
- matrice_inference/deploy/server/inference/triton_utils.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/inference/triton_utils.pyi +115 -0
- matrice_inference/deploy/server/proxy/proxy_interface.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/proxy/proxy_interface.pyi +90 -0
- matrice_inference/deploy/server/proxy/proxy_utils.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/proxy/proxy_utils.pyi +113 -0
- matrice_inference/deploy/server/server.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/server.pyi +155 -0
- matrice_inference/deploy/server/stream/inference_worker.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/stream/inference_worker.pyi +56 -0
- matrice_inference/deploy/server/stream/kafka_consumer_worker.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/stream/kafka_consumer_worker.pyi +51 -0
- matrice_inference/deploy/server/stream/kafka_producer_worker.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/stream/kafka_producer_worker.pyi +50 -0
- matrice_inference/deploy/server/stream/stream_debug_logger.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/stream/stream_debug_logger.pyi +47 -0
- matrice_inference/deploy/server/stream/stream_manager.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/stream/stream_manager.pyi +69 -0
- matrice_inference/deploy/server/stream/video_buffer.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/server/stream/video_buffer.pyi +120 -0
- matrice_inference/deploy/stream/kafka_stream.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/stream/kafka_stream.pyi +444 -0
- matrice_inference/deploy/stream/redis_stream.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deploy/stream/redis_stream.pyi +447 -0
- matrice_inference/deployment/camera_manager.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deployment/camera_manager.pyi +669 -0
- matrice_inference/deployment/deployment.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deployment/deployment.pyi +736 -0
- matrice_inference/deployment/inference_pipeline.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deployment/inference_pipeline.pyi +527 -0
- matrice_inference/deployment/streaming_gateway_manager.cpython-312-x86_64-linux-gnu.so +0 -0
- matrice_inference/deployment/streaming_gateway_manager.pyi +275 -0
- matrice_inference/py.typed +0 -0
- matrice_inference-0.1.0.dist-info/METADATA +26 -0
- matrice_inference-0.1.0.dist-info/RECORD +80 -0
- matrice_inference-0.1.0.dist-info/WHEEL +5 -0
- matrice_inference-0.1.0.dist-info/licenses/LICENSE.txt +21 -0
- matrice_inference-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
"""Auto-generated stub for module: camera_manager."""
|
|
2
|
+
from typing import Any, Dict, List, Optional, Set, Tuple
|
|
3
|
+
|
|
4
|
+
from dataclasses import dataclass, asdict
|
|
5
|
+
import logging
|
|
6
|
+
|
|
7
|
+
# Classes
|
|
8
|
+
class Camera:
|
|
9
|
+
"""
|
|
10
|
+
Camera instance class for managing individual camera configurations.
|
|
11
|
+
|
|
12
|
+
This class represents a single camera and provides methods to manage
|
|
13
|
+
its configuration, stream settings, and operational status.
|
|
14
|
+
|
|
15
|
+
Example:
|
|
16
|
+
Basic usage:
|
|
17
|
+
```python
|
|
18
|
+
from matrice import Session
|
|
19
|
+
from matrice_inference.deployment.camera_manager import Camera, CameraConfig
|
|
20
|
+
|
|
21
|
+
session = Session(account_number="...", access_key="...", secret_key="...")
|
|
22
|
+
|
|
23
|
+
# Create camera config
|
|
24
|
+
config = CameraConfig(
|
|
25
|
+
camera_name="entrance_cam_01",
|
|
26
|
+
stream_url="rtsp://192.168.1.100:554/stream1",
|
|
27
|
+
camera_group_id="group_id_123",
|
|
28
|
+
custom_stream_settings={"videoQuality": 90}
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
# Create camera instance
|
|
32
|
+
camera = Camera(session, config)
|
|
33
|
+
|
|
34
|
+
# Save to backend
|
|
35
|
+
result, error, message = camera.save(service_id="deployment_id")
|
|
36
|
+
if not error:
|
|
37
|
+
print(f"Camera created with ID: {camera.id}")
|
|
38
|
+
|
|
39
|
+
# Update configuration
|
|
40
|
+
camera.stream_url = "rtsp://192.168.1.101:554/stream1"
|
|
41
|
+
result, error, message = camera.update()
|
|
42
|
+
```
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
def __init__(self: Any, session: Any, config: Any = None, camera_id: str = None) -> None: ...
|
|
46
|
+
"""
|
|
47
|
+
Initialize a Camera instance.
|
|
48
|
+
|
|
49
|
+
Args:
|
|
50
|
+
session: Session object containing RPC client for API communication
|
|
51
|
+
config: CameraConfig object (for new cameras)
|
|
52
|
+
camera_id: ID of existing camera to load (mutually exclusive with config)
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
def camera_group_id(self: Any) -> str: ...
|
|
56
|
+
"""
|
|
57
|
+
Get the camera group ID.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
def camera_group_id(self: Any, value: str) -> Any: ...
|
|
61
|
+
"""
|
|
62
|
+
Set the camera group ID.
|
|
63
|
+
"""
|
|
64
|
+
|
|
65
|
+
def camera_name(self: Any) -> str: ...
|
|
66
|
+
"""
|
|
67
|
+
Get the camera name.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
def camera_name(self: Any, value: str) -> Any: ...
|
|
71
|
+
"""
|
|
72
|
+
Set the camera name.
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
def custom_stream_settings(self: Any) -> Dict: ...
|
|
76
|
+
"""
|
|
77
|
+
Get the custom stream settings.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
def custom_stream_settings(self: Any, value: Dict) -> Any: ...
|
|
81
|
+
"""
|
|
82
|
+
Set the custom stream settings.
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
def delete(self: Any) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
86
|
+
"""
|
|
87
|
+
Delete the camera from the backend.
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
tuple: (result, error, message)
|
|
91
|
+
"""
|
|
92
|
+
|
|
93
|
+
def get_effective_stream_settings(self: Any, group_defaults: Any) -> Any: ...
|
|
94
|
+
"""
|
|
95
|
+
Get the effective stream settings by merging group defaults with custom overrides.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
group_defaults: Default stream settings from the camera group
|
|
99
|
+
|
|
100
|
+
Returns:
|
|
101
|
+
StreamSettings with effective values
|
|
102
|
+
"""
|
|
103
|
+
|
|
104
|
+
def get_stream_url(self: Any) -> str: ...
|
|
105
|
+
"""
|
|
106
|
+
Get the camera stream URL.
|
|
107
|
+
"""
|
|
108
|
+
|
|
109
|
+
def id(self: Any) -> Optional[str]: ...
|
|
110
|
+
"""
|
|
111
|
+
Get the camera ID.
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
def is_stream_url(self: Any) -> bool: ...
|
|
115
|
+
"""
|
|
116
|
+
Get whether the camera stream URL is a valid URL.
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
def is_stream_url(self: Any, value: bool) -> Any: ...
|
|
120
|
+
"""
|
|
121
|
+
Set whether the camera stream URL is a valid URL.
|
|
122
|
+
"""
|
|
123
|
+
|
|
124
|
+
def refresh(self: Any) -> Any: ...
|
|
125
|
+
"""
|
|
126
|
+
Refresh the camera configuration from the backend.
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
def save(self: Any, service_id: str = None) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
130
|
+
"""
|
|
131
|
+
Save the camera configuration to the backend (create new).
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
service_id: The deployment or inference pipeline ID to associate with
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
tuple: (result, error, message)
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
def stream_url(self: Any) -> str: ...
|
|
141
|
+
"""
|
|
142
|
+
Get the camera stream URL.
|
|
143
|
+
"""
|
|
144
|
+
|
|
145
|
+
def stream_url(self: Any, value: str) -> Any: ...
|
|
146
|
+
"""
|
|
147
|
+
Set the camera stream URL.
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
def update(self: Any) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
151
|
+
"""
|
|
152
|
+
Update the camera configuration in the backend.
|
|
153
|
+
|
|
154
|
+
Returns:
|
|
155
|
+
tuple: (result, error, message)
|
|
156
|
+
"""
|
|
157
|
+
|
|
158
|
+
class CameraConfig:
|
|
159
|
+
"""
|
|
160
|
+
Camera configuration data class.
|
|
161
|
+
|
|
162
|
+
Attributes:
|
|
163
|
+
id: Unique identifier for the camera config (MongoDB ObjectID)
|
|
164
|
+
id_service: Deployment ID this camera config belongs to (MongoDB ObjectID)
|
|
165
|
+
camera_group_id: ID of the camera group this camera belongs to
|
|
166
|
+
is_stream_url: Whether the stream URL is a valid URL
|
|
167
|
+
camera_name: Name/identifier for the camera
|
|
168
|
+
stream_url: URL for the camera stream
|
|
169
|
+
custom_stream_settings: Custom stream settings that override group defaults
|
|
170
|
+
created_at: Creation timestamp
|
|
171
|
+
updated_at: Last update timestamp
|
|
172
|
+
"""
|
|
173
|
+
|
|
174
|
+
def from_dict(cls: Any, data: Dict) -> Any: ...
|
|
175
|
+
"""
|
|
176
|
+
Create a CameraConfig instance from API response data.
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
def get_effective_stream_settings(self: Any, group_defaults: Any) -> Any: ...
|
|
180
|
+
"""
|
|
181
|
+
Get the effective stream settings by merging group defaults with custom overrides.
|
|
182
|
+
|
|
183
|
+
Args:
|
|
184
|
+
group_defaults: Default stream settings from the camera group
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
StreamSettings with effective values
|
|
188
|
+
"""
|
|
189
|
+
|
|
190
|
+
def to_dict(self: Any) -> Dict: ...
|
|
191
|
+
"""
|
|
192
|
+
Convert the camera config to a dictionary for API calls.
|
|
193
|
+
"""
|
|
194
|
+
|
|
195
|
+
class CameraGroup:
|
|
196
|
+
"""
|
|
197
|
+
Camera group instance class for managing individual camera groups and their cameras.
|
|
198
|
+
|
|
199
|
+
This class represents a single camera group and provides methods to manage
|
|
200
|
+
its configuration, cameras, and operational status.
|
|
201
|
+
|
|
202
|
+
Example:
|
|
203
|
+
Basic usage:
|
|
204
|
+
```python
|
|
205
|
+
from matrice import Session
|
|
206
|
+
from matrice_inference.deployment.camera_manager import CameraGroup, CameraGroup, StreamSettings
|
|
207
|
+
|
|
208
|
+
session = Session(account_number="...", access_key="...", secret_key="...")
|
|
209
|
+
|
|
210
|
+
# Create camera group config
|
|
211
|
+
default_settings = StreamSettings(
|
|
212
|
+
aspect_ratio="16:9",
|
|
213
|
+
video_quality=80,
|
|
214
|
+
height=1080,
|
|
215
|
+
width=1920,
|
|
216
|
+
fps=30
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
group_config = CameraGroupConfig(
|
|
220
|
+
name="Indoor Cameras",
|
|
221
|
+
location="Building A - First Floor",
|
|
222
|
+
default_stream_settings=default_settings
|
|
223
|
+
)
|
|
224
|
+
|
|
225
|
+
# Create camera group instance
|
|
226
|
+
camera_group = CameraGroup(session, group_config)
|
|
227
|
+
|
|
228
|
+
# Save to backend
|
|
229
|
+
result, error, message = camera_group.save(service_id="deployment_id")
|
|
230
|
+
if not error:
|
|
231
|
+
print(f"Camera group created with ID: {camera_group.id}")
|
|
232
|
+
|
|
233
|
+
# Add cameras to the group
|
|
234
|
+
camera_config = CameraConfig(
|
|
235
|
+
camera_name="entrance_cam_01",
|
|
236
|
+
stream_url="rtsp://192.168.1.100:554/stream1",
|
|
237
|
+
camera_group_id=camera_group.id
|
|
238
|
+
)
|
|
239
|
+
camera, error, message = camera_group.add_camera(camera_config)
|
|
240
|
+
```
|
|
241
|
+
"""
|
|
242
|
+
|
|
243
|
+
def __init__(self: Any, session: Any, config: Any = None, group_id: str = None) -> None: ...
|
|
244
|
+
"""
|
|
245
|
+
Initialize a CameraGroup.
|
|
246
|
+
|
|
247
|
+
Args:
|
|
248
|
+
session: Session object containing RPC client for API communication
|
|
249
|
+
config: CameraGroup object (for new groups)
|
|
250
|
+
group_id: ID of existing group to load (mutually exclusive with config)
|
|
251
|
+
"""
|
|
252
|
+
|
|
253
|
+
def add_camera(self: Any, camera_config: Any) -> Tuple[Optional['Camera'], Optional[str], str]: ...
|
|
254
|
+
"""
|
|
255
|
+
Add a camera to this camera group.
|
|
256
|
+
|
|
257
|
+
Args:
|
|
258
|
+
camera_config: CameraConfig object containing the camera configuration
|
|
259
|
+
|
|
260
|
+
Returns:
|
|
261
|
+
tuple: (camera_instance, error, message)
|
|
262
|
+
"""
|
|
263
|
+
|
|
264
|
+
def cameras(self: Any) -> List['Camera']: ...
|
|
265
|
+
"""
|
|
266
|
+
Get all cameras in this group.
|
|
267
|
+
"""
|
|
268
|
+
|
|
269
|
+
def default_stream_settings(self: Any) -> Optional[StreamSettings]: ...
|
|
270
|
+
"""
|
|
271
|
+
Get the default stream settings.
|
|
272
|
+
"""
|
|
273
|
+
|
|
274
|
+
def default_stream_settings(self: Any, value: Any) -> Any: ...
|
|
275
|
+
"""
|
|
276
|
+
Set the default stream settings.
|
|
277
|
+
"""
|
|
278
|
+
|
|
279
|
+
def delete(self: Any) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
280
|
+
"""
|
|
281
|
+
Delete the camera group from the backend.
|
|
282
|
+
|
|
283
|
+
Returns:
|
|
284
|
+
tuple: (result, error, message)
|
|
285
|
+
"""
|
|
286
|
+
|
|
287
|
+
def get_cameras(self: Any, page: int = 1, limit: int = 10, search: str = None) -> Tuple[Optional[List['Camera']], Optional[str], str]: ...
|
|
288
|
+
"""
|
|
289
|
+
Get all cameras in this camera group.
|
|
290
|
+
|
|
291
|
+
Args:
|
|
292
|
+
page: Page number for pagination
|
|
293
|
+
limit: Items per page
|
|
294
|
+
search: Optional search term
|
|
295
|
+
|
|
296
|
+
Returns:
|
|
297
|
+
tuple: (camera_instances, error, message)
|
|
298
|
+
"""
|
|
299
|
+
|
|
300
|
+
def id(self: Any) -> Optional[str]: ...
|
|
301
|
+
"""
|
|
302
|
+
Get the group ID.
|
|
303
|
+
"""
|
|
304
|
+
|
|
305
|
+
def location(self: Any) -> str: ...
|
|
306
|
+
"""
|
|
307
|
+
Get the group location.
|
|
308
|
+
"""
|
|
309
|
+
|
|
310
|
+
def location(self: Any, value: str) -> Any: ...
|
|
311
|
+
"""
|
|
312
|
+
Set the group location.
|
|
313
|
+
"""
|
|
314
|
+
|
|
315
|
+
def name(self: Any) -> str: ...
|
|
316
|
+
"""
|
|
317
|
+
Get the group name.
|
|
318
|
+
"""
|
|
319
|
+
|
|
320
|
+
def name(self: Any, value: str) -> Any: ...
|
|
321
|
+
"""
|
|
322
|
+
Set the group name.
|
|
323
|
+
"""
|
|
324
|
+
|
|
325
|
+
def refresh(self: Any) -> Any: ...
|
|
326
|
+
"""
|
|
327
|
+
Refresh the camera group configuration and cameras from the backend.
|
|
328
|
+
"""
|
|
329
|
+
|
|
330
|
+
def remove_camera(self: Any, camera_id: str) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
331
|
+
"""
|
|
332
|
+
Remove a camera from this camera group.
|
|
333
|
+
|
|
334
|
+
Args:
|
|
335
|
+
camera_id: ID of the camera to remove
|
|
336
|
+
|
|
337
|
+
Returns:
|
|
338
|
+
tuple: (result, error, message)
|
|
339
|
+
"""
|
|
340
|
+
|
|
341
|
+
def save(self: Any, service_id: str = None) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
342
|
+
"""
|
|
343
|
+
Save the camera group configuration to the backend (create new).
|
|
344
|
+
|
|
345
|
+
Args:
|
|
346
|
+
service_id: The deployment or inference pipeline ID to associate with
|
|
347
|
+
|
|
348
|
+
Returns:
|
|
349
|
+
tuple: (result, error, message)
|
|
350
|
+
"""
|
|
351
|
+
|
|
352
|
+
def update(self: Any) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
353
|
+
"""
|
|
354
|
+
Update the camera group configuration in the backend.
|
|
355
|
+
|
|
356
|
+
Returns:
|
|
357
|
+
tuple: (result, error, message)
|
|
358
|
+
"""
|
|
359
|
+
|
|
360
|
+
class CameraGroupConfig:
|
|
361
|
+
"""
|
|
362
|
+
Camera group data class for managing collections of cameras with shared settings.
|
|
363
|
+
|
|
364
|
+
Attributes:
|
|
365
|
+
id: Unique identifier for the camera group (MongoDB ObjectID)
|
|
366
|
+
id_service: Deployment ID this group belongs to (MongoDB ObjectID)
|
|
367
|
+
name: Name of the camera group
|
|
368
|
+
location: Physical location description of the group
|
|
369
|
+
default_stream_settings: Default stream settings for cameras in this group
|
|
370
|
+
created_at: Creation timestamp
|
|
371
|
+
updated_at: Last update timestamp
|
|
372
|
+
"""
|
|
373
|
+
|
|
374
|
+
def from_dict(cls: Any, data: Dict) -> Any: ...
|
|
375
|
+
"""
|
|
376
|
+
Create a CameraGroup instance from API response data.
|
|
377
|
+
"""
|
|
378
|
+
|
|
379
|
+
def to_dict(self: Any) -> Dict: ...
|
|
380
|
+
"""
|
|
381
|
+
Convert the camera group to a dictionary for API calls.
|
|
382
|
+
"""
|
|
383
|
+
|
|
384
|
+
class CameraManager:
|
|
385
|
+
"""
|
|
386
|
+
Camera manager client for handling camera groups and configurations in deployments.
|
|
387
|
+
|
|
388
|
+
This class provides methods to create, read, update, and delete camera groups and
|
|
389
|
+
camera configurations associated with deployments. It offers a streamlined flow
|
|
390
|
+
for managing camera infrastructure.
|
|
391
|
+
|
|
392
|
+
Example:
|
|
393
|
+
Basic usage:
|
|
394
|
+
```python
|
|
395
|
+
from matrice import Session
|
|
396
|
+
from matrice_inference.deployment.camera_manager import CameraManager, CameraGroup, CameraConfig, StreamSettings
|
|
397
|
+
|
|
398
|
+
session = Session(account_number="...", access_key="...", secret_key="...")
|
|
399
|
+
camera_manager = CameraManager(session, service_id="...")
|
|
400
|
+
|
|
401
|
+
# Create a camera group with default settings
|
|
402
|
+
default_settings = StreamSettings(
|
|
403
|
+
aspect_ratio="16:9",
|
|
404
|
+
video_quality=80,
|
|
405
|
+
height=1080,
|
|
406
|
+
width=1920,
|
|
407
|
+
fps=30
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
group = CameraGroup(
|
|
411
|
+
name="Indoor Cameras",
|
|
412
|
+
location="Building A - First Floor",
|
|
413
|
+
default_stream_settings=default_settings
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
# Create the camera group
|
|
417
|
+
camera_group, error, message = camera_manager.create_camera_group(group)
|
|
418
|
+
if error:
|
|
419
|
+
print(f"Error: {error}")
|
|
420
|
+
else:
|
|
421
|
+
print(f"Camera group created: {camera_group.name}")
|
|
422
|
+
|
|
423
|
+
# Add cameras to the group
|
|
424
|
+
camera_config = CameraConfig(
|
|
425
|
+
camera_name="main_entrance_cam",
|
|
426
|
+
stream_url="rtsp://192.168.1.100:554/stream1",
|
|
427
|
+
camera_group_id=camera_group.id,
|
|
428
|
+
custom_stream_settings={"videoQuality": 90}
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
camera, error, message = camera_group.add_camera(camera_config)
|
|
432
|
+
if not error:
|
|
433
|
+
print(f"Camera added: {camera.camera_name}")
|
|
434
|
+
```
|
|
435
|
+
"""
|
|
436
|
+
|
|
437
|
+
def __init__(self: Any, session: Any, service_id: str = None) -> None: ...
|
|
438
|
+
"""
|
|
439
|
+
Initialize the CameraManager client.
|
|
440
|
+
|
|
441
|
+
Args:
|
|
442
|
+
session: Session object containing RPC client for API communication
|
|
443
|
+
service_id: The ID of the deployment or the ID of the inference pipeline
|
|
444
|
+
"""
|
|
445
|
+
|
|
446
|
+
def add_camera_config(self: Any, config: Any) -> Tuple[Optional['Camera'], Optional[str], str]: ...
|
|
447
|
+
"""
|
|
448
|
+
Legacy method - use create_camera instead.
|
|
449
|
+
"""
|
|
450
|
+
|
|
451
|
+
def add_camera_configs(self: Any, configs: List[CameraConfig]) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
452
|
+
"""
|
|
453
|
+
Legacy method - use add_cameras_to_group instead.
|
|
454
|
+
"""
|
|
455
|
+
|
|
456
|
+
def add_cameras_to_group(self: Any, group_id: str, camera_configs: List[CameraConfig]) -> Tuple[Optional[List['Camera']], Optional[str], str]: ...
|
|
457
|
+
"""
|
|
458
|
+
Add multiple cameras to a camera group.
|
|
459
|
+
|
|
460
|
+
Args:
|
|
461
|
+
group_id: The ID of the camera group
|
|
462
|
+
camera_configs: List of CameraConfig objects
|
|
463
|
+
|
|
464
|
+
Returns:
|
|
465
|
+
tuple: (camera_instances, error, message)
|
|
466
|
+
"""
|
|
467
|
+
|
|
468
|
+
def create_camera(self: Any, camera_config: Any) -> Tuple[Optional['Camera'], Optional[str], str]: ...
|
|
469
|
+
"""
|
|
470
|
+
Create a new camera configuration.
|
|
471
|
+
|
|
472
|
+
Args:
|
|
473
|
+
camera_config: CameraConfig object containing the camera configuration
|
|
474
|
+
|
|
475
|
+
Returns:
|
|
476
|
+
tuple: (camera_instance, error, message)
|
|
477
|
+
"""
|
|
478
|
+
|
|
479
|
+
def create_camera_group(self: Any, group: Any) -> Tuple[Optional['CameraGroup'], Optional[str], str]: ...
|
|
480
|
+
"""
|
|
481
|
+
Create a new camera group for a deployment.
|
|
482
|
+
|
|
483
|
+
Args:
|
|
484
|
+
group: CameraGroup object containing the group configuration
|
|
485
|
+
|
|
486
|
+
Returns:
|
|
487
|
+
tuple: (camera_group_instance, error, message)
|
|
488
|
+
- camera_group_instance: CameraGroupInstance if successful, None otherwise
|
|
489
|
+
- error: Error message if failed, None otherwise
|
|
490
|
+
- message: Status message
|
|
491
|
+
"""
|
|
492
|
+
|
|
493
|
+
def delete_all_cameras(self: Any, confirm: bool = False) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
494
|
+
"""
|
|
495
|
+
Delete all cameras for a specific deployment.
|
|
496
|
+
|
|
497
|
+
Args:
|
|
498
|
+
confirm: Must be True to confirm bulk deletion
|
|
499
|
+
|
|
500
|
+
Returns:
|
|
501
|
+
tuple: (result, error, message)
|
|
502
|
+
"""
|
|
503
|
+
|
|
504
|
+
def delete_camera(self: Any, camera_id: str) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
505
|
+
"""
|
|
506
|
+
Delete a camera by its ID.
|
|
507
|
+
|
|
508
|
+
Args:
|
|
509
|
+
camera_id: The ID of the camera to delete
|
|
510
|
+
|
|
511
|
+
Returns:
|
|
512
|
+
tuple: (result, error, message)
|
|
513
|
+
"""
|
|
514
|
+
|
|
515
|
+
def delete_camera_config_by_id(self: Any, config_id: str) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
516
|
+
"""
|
|
517
|
+
Legacy method - use delete_camera instead.
|
|
518
|
+
"""
|
|
519
|
+
|
|
520
|
+
def delete_camera_configs(self: Any, confirm: bool = False) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
521
|
+
"""
|
|
522
|
+
Legacy method - use delete_all_cameras instead.
|
|
523
|
+
"""
|
|
524
|
+
|
|
525
|
+
def delete_camera_group(self: Any, group_id: str) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
526
|
+
"""
|
|
527
|
+
Delete a camera group by its ID.
|
|
528
|
+
|
|
529
|
+
Args:
|
|
530
|
+
group_id: The ID of the camera group to delete
|
|
531
|
+
|
|
532
|
+
Returns:
|
|
533
|
+
tuple: (result, error, message)
|
|
534
|
+
"""
|
|
535
|
+
|
|
536
|
+
def get_camera_by_id(self: Any, camera_id: str) -> Tuple[Optional['Camera'], Optional[str], str]: ...
|
|
537
|
+
"""
|
|
538
|
+
Get a camera by its ID.
|
|
539
|
+
|
|
540
|
+
Args:
|
|
541
|
+
camera_id: The ID of the camera to retrieve
|
|
542
|
+
|
|
543
|
+
Returns:
|
|
544
|
+
tuple: (camera_instance, error, message)
|
|
545
|
+
"""
|
|
546
|
+
|
|
547
|
+
def get_camera_config_by_id(self: Any, config_id: str) -> Tuple[Optional['Camera'], Optional[str], str]: ...
|
|
548
|
+
"""
|
|
549
|
+
Legacy method - use get_camera_by_id instead.
|
|
550
|
+
"""
|
|
551
|
+
|
|
552
|
+
def get_camera_configs(self: Any, page: int = 1, limit: int = 10, search: str = None, group_id: str = None) -> Tuple[Optional[List['Camera']], Optional[str], str]: ...
|
|
553
|
+
"""
|
|
554
|
+
Legacy method - use get_cameras instead.
|
|
555
|
+
"""
|
|
556
|
+
|
|
557
|
+
def get_camera_group_by_id(self: Any, group_id: str) -> Tuple[Optional['CameraGroup'], Optional[str], str]: ...
|
|
558
|
+
"""
|
|
559
|
+
Get a camera group by its ID.
|
|
560
|
+
|
|
561
|
+
Args:
|
|
562
|
+
group_id: The ID of the camera group to retrieve
|
|
563
|
+
|
|
564
|
+
Returns:
|
|
565
|
+
tuple: (camera_group_instance, error, message)
|
|
566
|
+
"""
|
|
567
|
+
|
|
568
|
+
def get_camera_groups(self: Any, page: int = 1, limit: int = 10, search: str = None) -> Tuple[Optional[List['CameraGroup']], Optional[str], str]: ...
|
|
569
|
+
"""
|
|
570
|
+
Get all camera groups for a specific deployment.
|
|
571
|
+
|
|
572
|
+
Args:
|
|
573
|
+
page: Page number for pagination
|
|
574
|
+
limit: Items per page
|
|
575
|
+
search: Optional search term
|
|
576
|
+
|
|
577
|
+
Returns:
|
|
578
|
+
tuple: (camera_group_instances, error, message)
|
|
579
|
+
"""
|
|
580
|
+
|
|
581
|
+
def get_cameras(self: Any, page: int = 1, limit: int = 10, search: str = None, group_id: str = None) -> Tuple[Optional[List['Camera']], Optional[str], str]: ...
|
|
582
|
+
"""
|
|
583
|
+
Get all cameras for a specific deployment.
|
|
584
|
+
|
|
585
|
+
Args:
|
|
586
|
+
page: Page number for pagination
|
|
587
|
+
limit: Items per page
|
|
588
|
+
search: Optional search term
|
|
589
|
+
group_id: Optional filter by camera group ID
|
|
590
|
+
|
|
591
|
+
Returns:
|
|
592
|
+
tuple: (camera_instances, error, message)
|
|
593
|
+
"""
|
|
594
|
+
|
|
595
|
+
def get_stream_url(self: Any, config_id: str) -> Tuple[Optional[str], Optional[str], str]: ...
|
|
596
|
+
"""
|
|
597
|
+
Get the stream URL for a camera configuration.
|
|
598
|
+
|
|
599
|
+
Args:
|
|
600
|
+
config_id: The ID of the camera configuration
|
|
601
|
+
|
|
602
|
+
Returns:
|
|
603
|
+
tuple: (stream_url, error, message)
|
|
604
|
+
"""
|
|
605
|
+
|
|
606
|
+
def handle_response(self: Any, response: Dict, success_message: str, failure_message: str) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
607
|
+
"""
|
|
608
|
+
Handle API response and return standardized tuple.
|
|
609
|
+
"""
|
|
610
|
+
|
|
611
|
+
def list_camera_configs(self: Any, page: int = 1, limit: int = 10, search: str = None, group_id: str = None) -> Tuple[Optional[List[Dict]], Optional[str], str]: ...
|
|
612
|
+
"""
|
|
613
|
+
List all camera configs for a specific deployment.
|
|
614
|
+
|
|
615
|
+
Returns:
|
|
616
|
+
tuple: (camera_configs, error, message)
|
|
617
|
+
"""
|
|
618
|
+
|
|
619
|
+
def update_camera(self: Any, camera_id: str, camera_config: Any) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
620
|
+
"""
|
|
621
|
+
Update an existing camera configuration.
|
|
622
|
+
|
|
623
|
+
Args:
|
|
624
|
+
camera_id: The ID of the camera to update
|
|
625
|
+
camera_config: CameraConfig object with updated configuration
|
|
626
|
+
|
|
627
|
+
Returns:
|
|
628
|
+
tuple: (result, error, message)
|
|
629
|
+
"""
|
|
630
|
+
|
|
631
|
+
def update_camera_config(self: Any, config_id: str, config: Any) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
632
|
+
"""
|
|
633
|
+
Legacy method - use update_camera instead.
|
|
634
|
+
"""
|
|
635
|
+
|
|
636
|
+
def update_camera_group(self: Any, group_id: str, group: Any) -> Tuple[Optional[Dict], Optional[str], str]: ...
|
|
637
|
+
"""
|
|
638
|
+
Update an existing camera group.
|
|
639
|
+
|
|
640
|
+
Args:
|
|
641
|
+
group_id: The ID of the camera group to update
|
|
642
|
+
group: CameraGroup object with updated configuration
|
|
643
|
+
|
|
644
|
+
Returns:
|
|
645
|
+
tuple: (result, error, message)
|
|
646
|
+
"""
|
|
647
|
+
|
|
648
|
+
class StreamSettings:
|
|
649
|
+
"""
|
|
650
|
+
Stream settings data class for camera configurations.
|
|
651
|
+
|
|
652
|
+
Attributes:
|
|
653
|
+
aspect_ratio: Aspect ratio of the camera (e.g., "16:9", "4:3")
|
|
654
|
+
video_quality: Video quality setting (0-100)
|
|
655
|
+
height: Video height in pixels
|
|
656
|
+
width: Video width in pixels
|
|
657
|
+
fps: Frames per second
|
|
658
|
+
"""
|
|
659
|
+
|
|
660
|
+
def from_dict(cls: Any, data: Dict) -> Any: ...
|
|
661
|
+
"""
|
|
662
|
+
Create a StreamSettings instance from API response data.
|
|
663
|
+
"""
|
|
664
|
+
|
|
665
|
+
def to_dict(self: Any) -> Dict: ...
|
|
666
|
+
"""
|
|
667
|
+
Convert the stream settings to a dictionary for API calls.
|
|
668
|
+
"""
|
|
669
|
+
|
|
Binary file
|