learning-loop-node 0.10.0__py3-none-any.whl → 0.10.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.

Potentially problematic release.


This version of learning-loop-node might be problematic. Click here for more details.

@@ -152,21 +152,23 @@ class ActiveTrainingIO:
152
152
  current_json_file_index = self.load_detections_upload_file_index()
153
153
  for i in range(current_json_file_index, num_files):
154
154
  detections = self.load_detections(i)
155
- logging.info(f'uploading detections {i}/{num_files}')
155
+ logging.info(f'uploading detections in file {i}/{num_files}')
156
156
  await self._upload_detections_batched(self.context, detections)
157
157
  self.save_detections_upload_file_index(i+1)
158
158
 
159
159
  async def _upload_detections_batched(self, context: Context, detections: List[Detections]):
160
- batch_size = 10
160
+ batch_size = 100
161
161
  skip_detections = self.load_detection_upload_progress()
162
+ up_count = 0
162
163
  for i in range(skip_detections, len(detections), batch_size):
164
+ up_count += 1
163
165
  up_progress = i+batch_size
164
166
  batch_detections = detections[i:up_progress]
165
- dict_detections = [jsonable_encoder(asdict(detection)) for detection in batch_detections]
166
- logging.info(f'uploading detections. File size : {len(json.dumps(dict_detections))}')
167
167
  await self._upload_detections(context, batch_detections, up_progress)
168
168
  skip_detections = up_progress
169
169
 
170
+ logging.info('uploaded %d detections', len(detections))
171
+
170
172
  async def _upload_detections(self, context: Context, batch_detections: List[Detections], up_progress: int):
171
173
  detections_json = [jsonable_encoder(asdict(detections)) for detections in batch_detections]
172
174
  response = await self.loop_communicator.post(
@@ -177,7 +179,7 @@ class ActiveTrainingIO:
177
179
  raise Exception(msg)
178
180
 
179
181
  logging.info('successfully uploaded detections')
180
- if up_progress > len(batch_detections):
182
+ if up_progress >= len(batch_detections):
181
183
  self.save_detection_upload_progress(0)
182
184
  else:
183
185
  self.save_detection_upload_progress(up_progress)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: learning-loop-node
3
- Version: 0.10.0
3
+ Version: 0.10.1
4
4
  Summary: Python Library for Nodes which connect to the Zauberzeug Learning Loop
5
5
  Home-page: https://github.com/zauberzeug/learning_loop_node
6
6
  License: MIT
@@ -58,7 +58,7 @@ learning_loop_node/tests/test_learning_loop_node.py,sha256=4qWi1ovBzebUAbvw8ecSa
58
58
  learning_loop_node/trainer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
59
59
  learning_loop_node/trainer/downloader.py,sha256=qzx7zzObcFEvRVQFe8gi8KJNIapASi1_XssbspXD1Rw,1469
60
60
  learning_loop_node/trainer/executor.py,sha256=j-1pkc_5b1Y0Bh8KiQthAK7SoOfJelr5Qi7L0p1sTxE,3933
61
- learning_loop_node/trainer/io_helpers.py,sha256=MKyGjqK_Ch7EwyU-Iy01NdkufzdJaj2l2UdBa71Ug8Y,7230
61
+ learning_loop_node/trainer/io_helpers.py,sha256=fyjImT1NY10gLV0KM4Ns7sRrtKFswVJU_pV9-c3IVEY,7152
62
62
  learning_loop_node/trainer/rest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
63
63
  learning_loop_node/trainer/rest/backdoor_controls.py,sha256=YQcG0KwxzKDNYeMtHrSwr26q__N7ty0o6Kar6CLWAd0,5869
64
64
  learning_loop_node/trainer/rest/controls.py,sha256=XF37i2edeMHKdSXyJc4ZqaTZ38u6d3u3Sb3C-Mwyfko,934
@@ -80,6 +80,6 @@ learning_loop_node/trainer/tests/testing_trainer_logic.py,sha256=7sQ6okiOhM4IhvR
80
80
  learning_loop_node/trainer/trainer_logic.py,sha256=PJxiO1chPdvpq8UTtzv_nVam9CouCswX9b1FnRwT2Tw,8411
81
81
  learning_loop_node/trainer/trainer_logic_generic.py,sha256=KFDuxgzrGITHQaJoGvhjHxWzhbb4Q7HBxSpks4CeGBg,24801
82
82
  learning_loop_node/trainer/trainer_node.py,sha256=bcyOMeLXrLuLgsPqS8lwEOSZ6vCjGLgT0pLXgaylI1Q,4155
83
- learning_loop_node-0.10.0.dist-info/METADATA,sha256=HnnnPdOewwDQeM9Ha-8Q3NWMKCToQVhfIs6Mp65JtPA,9158
84
- learning_loop_node-0.10.0.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
85
- learning_loop_node-0.10.0.dist-info/RECORD,,
83
+ learning_loop_node-0.10.1.dist-info/METADATA,sha256=j9ZrDeZGnT8IuYUAmt53KSvVtjEhsn3kxBAlPkbX2cE,9158
84
+ learning_loop_node-0.10.1.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
85
+ learning_loop_node-0.10.1.dist-info/RECORD,,