learning-loop-node 0.20.1__tar.gz → 0.21.0__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 (66) hide show
  1. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/PKG-INFO +38 -1
  2. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/README.md +37 -0
  3. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_classes/general.py +1 -0
  4. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/detector_node.py +2 -0
  5. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/rest/operation_mode.py +1 -1
  6. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node.egg-info/PKG-INFO +38 -1
  7. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/pyproject.toml +1 -1
  8. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/__init__.py +0 -0
  9. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/annotation/__init__.py +0 -0
  10. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/annotation/annotator_logic.py +0 -0
  11. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/annotation/annotator_node.py +0 -0
  12. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_classes/__init__.py +0 -0
  13. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_classes/annotation_data.py +0 -0
  14. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_classes/annotations.py +0 -0
  15. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_classes/detections.py +0 -0
  16. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_classes/image_metadata.py +0 -0
  17. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_classes/socket_response.py +0 -0
  18. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_classes/training.py +0 -0
  19. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/data_exchanger.py +0 -0
  20. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/__init__.py +0 -0
  21. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/detector_logic.py +0 -0
  22. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/exceptions.py +0 -0
  23. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/inbox_filter/__init__.py +0 -0
  24. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/inbox_filter/cam_observation_history.py +0 -0
  25. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/inbox_filter/relevance_filter.py +0 -0
  26. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/outbox.py +0 -0
  27. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/rest/__init__.py +0 -0
  28. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/rest/about.py +0 -0
  29. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/rest/backdoor_controls.py +0 -0
  30. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/rest/detect.py +0 -0
  31. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/rest/model_version_control.py +0 -0
  32. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/rest/outbox_mode.py +0 -0
  33. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/detector/rest/upload.py +0 -0
  34. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/enums/__init__.py +0 -0
  35. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/enums/annotator.py +0 -0
  36. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/enums/detector.py +0 -0
  37. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/enums/general.py +0 -0
  38. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/enums/trainer.py +0 -0
  39. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/globals.py +0 -0
  40. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/helpers/__init__.py +0 -0
  41. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/helpers/background_tasks.py +0 -0
  42. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/helpers/environment_reader.py +0 -0
  43. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/helpers/gdrive_downloader.py +0 -0
  44. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/helpers/log_conf.py +0 -0
  45. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/helpers/misc.py +0 -0
  46. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/helpers/run.py +0 -0
  47. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/loop_communication.py +0 -0
  48. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/node.py +0 -0
  49. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/py.typed +0 -0
  50. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/rest.py +0 -0
  51. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/__init__.py +0 -0
  52. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/downloader.py +0 -0
  53. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/exceptions.py +0 -0
  54. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/executor.py +0 -0
  55. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/io_helpers.py +0 -0
  56. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/rest/__init__.py +0 -0
  57. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/rest/backdoor_controls.py +0 -0
  58. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/test_executor.py +0 -0
  59. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/trainer_logic.py +0 -0
  60. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/trainer_logic_generic.py +0 -0
  61. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node/trainer/trainer_node.py +0 -0
  62. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node.egg-info/SOURCES.txt +0 -0
  63. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node.egg-info/dependency_links.txt +0 -0
  64. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node.egg-info/requires.txt +0 -0
  65. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/learning_loop_node.egg-info/top_level.txt +0 -0
  66. {learning_loop_node-0.20.1 → learning_loop_node-0.21.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: learning_loop_node
3
- Version: 0.20.1
3
+ Version: 0.21.0
4
4
  Summary: Python Library for Nodes which connect to the Zauberzeug Learning Loop
5
5
  Author-email: Zauberzeug GmbH <info@zauberzeug.com>
6
6
  License: MIT
@@ -140,6 +140,27 @@ The endpoint returns None if the upload was successful and an error message othe
140
140
 
141
141
  For both ways to upload an image, the tag `picked_by_system` is automatically added to the image metadata.
142
142
 
143
+ ### Node and model information
144
+
145
+ The detector has a REST endpoint that reports what the node is currently doing and which model it has loaded:
146
+
147
+ `curl http://localhost/about`
148
+
149
+ The response contains:
150
+
151
+ - `operation_mode`: the current operation mode (`startup`, `idle` or `detecting`)
152
+ - `state`: the state of the node (e.g. `idle`, `online`, `detecting`)
153
+ - `model_info`: information about the loaded model (id, organization, project, version, categories, resolution, model size), or `null` if no model is loaded yet
154
+ - `target_model`: the model version the detector is trying to load, or `null` if none is set
155
+ - `version_control`: the model versioning mode (`follow_loop`, `specific_version` or `pause`)
156
+
157
+ The same information is available via the socketio event `about`:
158
+ `sio.emit('about')`
159
+
160
+ Use this endpoint if you need the model uuid or its categories. If you only need the version numbers, use `/model_version` (see below).
161
+
162
+ All REST endpoints of the node are also listed in the automatically generated API documentation at `http://localhost/docs`.
163
+
143
164
  ### Changing the model versioning mode
144
165
 
145
166
  The detector can be configured to one of the following behaviors:
@@ -167,6 +188,22 @@ The model versioning configuration can also be changed via a socketio event:
167
188
  There is also a GET endpoint to fetch the current model versioning configuration:
168
189
  `sio.emit('get_model_version')` or `curl http://localhost/model_version`
169
190
 
191
+ ### Changing the operation mode
192
+
193
+ The operation mode controls whether the detector may load a new model:
194
+
195
+ - `startup`: used until the first model is loaded
196
+ - `idle`: the detector checks for and performs model updates
197
+ - `detecting`: the detector runs detections and does not load new models
198
+
199
+ The mode can be read and changed via a REST endpoint. Example Usage:
200
+
201
+ - Fetch the current operation mode: `curl http://localhost/operation_mode`
202
+ - Allow model updates: `curl -X PUT -d "idle" http://localhost/operation_mode`
203
+ - Block model updates: `curl -X PUT -d "detecting" http://localhost/operation_mode`
204
+
205
+ The GET request returns the mode as plain text. The PUT request returns status code 422 if the given value is not one of the three modes above.
206
+
170
207
  ### Changing the outbox mode
171
208
 
172
209
  If the autoupload is set to `all` or `filtered` (selected) images and the corresponding detections are saved on HDD (the outbox). A background thread will upload the images and detections to the Learning Loop. The outbox is located in the `outbox` folder in the root directory of the node. The outbox can be cleared by deleting the files in the folder.
@@ -104,6 +104,27 @@ The endpoint returns None if the upload was successful and an error message othe
104
104
 
105
105
  For both ways to upload an image, the tag `picked_by_system` is automatically added to the image metadata.
106
106
 
107
+ ### Node and model information
108
+
109
+ The detector has a REST endpoint that reports what the node is currently doing and which model it has loaded:
110
+
111
+ `curl http://localhost/about`
112
+
113
+ The response contains:
114
+
115
+ - `operation_mode`: the current operation mode (`startup`, `idle` or `detecting`)
116
+ - `state`: the state of the node (e.g. `idle`, `online`, `detecting`)
117
+ - `model_info`: information about the loaded model (id, organization, project, version, categories, resolution, model size), or `null` if no model is loaded yet
118
+ - `target_model`: the model version the detector is trying to load, or `null` if none is set
119
+ - `version_control`: the model versioning mode (`follow_loop`, `specific_version` or `pause`)
120
+
121
+ The same information is available via the socketio event `about`:
122
+ `sio.emit('about')`
123
+
124
+ Use this endpoint if you need the model uuid or its categories. If you only need the version numbers, use `/model_version` (see below).
125
+
126
+ All REST endpoints of the node are also listed in the automatically generated API documentation at `http://localhost/docs`.
127
+
107
128
  ### Changing the model versioning mode
108
129
 
109
130
  The detector can be configured to one of the following behaviors:
@@ -131,6 +152,22 @@ The model versioning configuration can also be changed via a socketio event:
131
152
  There is also a GET endpoint to fetch the current model versioning configuration:
132
153
  `sio.emit('get_model_version')` or `curl http://localhost/model_version`
133
154
 
155
+ ### Changing the operation mode
156
+
157
+ The operation mode controls whether the detector may load a new model:
158
+
159
+ - `startup`: used until the first model is loaded
160
+ - `idle`: the detector checks for and performs model updates
161
+ - `detecting`: the detector runs detections and does not load new models
162
+
163
+ The mode can be read and changed via a REST endpoint. Example Usage:
164
+
165
+ - Fetch the current operation mode: `curl http://localhost/operation_mode`
166
+ - Allow model updates: `curl -X PUT -d "idle" http://localhost/operation_mode`
167
+ - Block model updates: `curl -X PUT -d "detecting" http://localhost/operation_mode`
168
+
169
+ The GET request returns the mode as plain text. The PUT request returns status code 422 if the given value is not one of the three modes above.
170
+
134
171
  ### Changing the outbox mode
135
172
 
136
173
  If the autoupload is set to `all` or `filtered` (selected) images and the corresponding detections are saved on HDD (the outbox). A background thread will upload the images and detections to the Learning Loop. The outbox is located in the `outbox` folder in the root directory of the node. The outbox can be cleared by deleting the files in the folder.
@@ -185,3 +185,4 @@ class DetectorStatus():
185
185
  target_model: Optional[str]
186
186
  errors: Dict
187
187
  operation_mode: str
188
+ node_version: Optional[str] = None
@@ -52,6 +52,7 @@ class DetectorNode(Node):
52
52
  uuid: Optional[str] = None, use_backdoor_controls: bool = False) -> None:
53
53
  super().__init__(name, uuid=uuid, node_type='detector', needs_login=False, needs_sio=False)
54
54
  self._detector_factory = detector_factory
55
+ self.node_version: Optional[str] = os.environ.get('NODE_VERSION')
55
56
  self._detector: _DetectorState = _Initializing()
56
57
  self._exclusive_model_build: bool = os.environ.get('EXCLUSIVE_MODEL_BUILD', '0').lower() in ('1', 'true')
57
58
  self._remaining_init_attempts: int = 2
@@ -409,6 +410,7 @@ class DetectorNode(Node):
409
410
  current_model=current_model,
410
411
  target_model=target_model_version,
411
412
  model_format=self._detector_factory.model_format,
413
+ node_version=self.node_version,
412
414
  )
413
415
 
414
416
  self.log_status_on_change(status.state, status)
@@ -19,7 +19,7 @@ async def put_operation_mode(request: Request):
19
19
 
20
20
  Example Usage
21
21
 
22
- curl -X PUT -d "check_for_updates" http://localhost/operation_mode
22
+ curl -X PUT -d "idle" http://localhost/operation_mode
23
23
  curl -X PUT -d "detecting" http://localhost/operation_mode
24
24
  '''
25
25
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: learning_loop_node
3
- Version: 0.20.1
3
+ Version: 0.21.0
4
4
  Summary: Python Library for Nodes which connect to the Zauberzeug Learning Loop
5
5
  Author-email: Zauberzeug GmbH <info@zauberzeug.com>
6
6
  License: MIT
@@ -140,6 +140,27 @@ The endpoint returns None if the upload was successful and an error message othe
140
140
 
141
141
  For both ways to upload an image, the tag `picked_by_system` is automatically added to the image metadata.
142
142
 
143
+ ### Node and model information
144
+
145
+ The detector has a REST endpoint that reports what the node is currently doing and which model it has loaded:
146
+
147
+ `curl http://localhost/about`
148
+
149
+ The response contains:
150
+
151
+ - `operation_mode`: the current operation mode (`startup`, `idle` or `detecting`)
152
+ - `state`: the state of the node (e.g. `idle`, `online`, `detecting`)
153
+ - `model_info`: information about the loaded model (id, organization, project, version, categories, resolution, model size), or `null` if no model is loaded yet
154
+ - `target_model`: the model version the detector is trying to load, or `null` if none is set
155
+ - `version_control`: the model versioning mode (`follow_loop`, `specific_version` or `pause`)
156
+
157
+ The same information is available via the socketio event `about`:
158
+ `sio.emit('about')`
159
+
160
+ Use this endpoint if you need the model uuid or its categories. If you only need the version numbers, use `/model_version` (see below).
161
+
162
+ All REST endpoints of the node are also listed in the automatically generated API documentation at `http://localhost/docs`.
163
+
143
164
  ### Changing the model versioning mode
144
165
 
145
166
  The detector can be configured to one of the following behaviors:
@@ -167,6 +188,22 @@ The model versioning configuration can also be changed via a socketio event:
167
188
  There is also a GET endpoint to fetch the current model versioning configuration:
168
189
  `sio.emit('get_model_version')` or `curl http://localhost/model_version`
169
190
 
191
+ ### Changing the operation mode
192
+
193
+ The operation mode controls whether the detector may load a new model:
194
+
195
+ - `startup`: used until the first model is loaded
196
+ - `idle`: the detector checks for and performs model updates
197
+ - `detecting`: the detector runs detections and does not load new models
198
+
199
+ The mode can be read and changed via a REST endpoint. Example Usage:
200
+
201
+ - Fetch the current operation mode: `curl http://localhost/operation_mode`
202
+ - Allow model updates: `curl -X PUT -d "idle" http://localhost/operation_mode`
203
+ - Block model updates: `curl -X PUT -d "detecting" http://localhost/operation_mode`
204
+
205
+ The GET request returns the mode as plain text. The PUT request returns status code 422 if the given value is not one of the three modes above.
206
+
170
207
  ### Changing the outbox mode
171
208
 
172
209
  If the autoupload is set to `all` or `filtered` (selected) images and the corresponding detections are saved on HDD (the outbox). A background thread will upload the images and detections to the Learning Loop. The outbox is located in the `outbox` folder in the root directory of the node. The outbox can be cleared by deleting the files in the folder.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "learning_loop_node"
3
- version = "0.20.1"
3
+ version = "0.21.0"
4
4
  description = "Python Library for Nodes which connect to the Zauberzeug Learning Loop"
5
5
  authors = [{ name = "Zauberzeug GmbH", email = "info@zauberzeug.com" }]
6
6
  license = { text = "MIT" }