learning-loop-node 0.11.0__py3-none-any.whl → 0.11.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.
- learning_loop_node/data_classes/image_metadata.py +1 -1
- learning_loop_node/detector/detector_node.py +3 -2
- learning_loop_node/detector/outbox.py +8 -5
- learning_loop_node/loop_communication.py +3 -3
- {learning_loop_node-0.11.0.dist-info → learning_loop_node-0.11.1.dist-info}/METADATA +1 -1
- {learning_loop_node-0.11.0.dist-info → learning_loop_node-0.11.1.dist-info}/RECORD +7 -7
- {learning_loop_node-0.11.0.dist-info → learning_loop_node-0.11.1.dist-info}/WHEEL +0 -0
|
@@ -28,7 +28,7 @@ class ImageMetadata():
|
|
|
28
28
|
tags: List[str] = field(default_factory=list, metadata={
|
|
29
29
|
'description': 'List of tags'})
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
created: Optional[str] = field(default_factory=current_datetime, metadata={
|
|
32
32
|
'description': 'Creation date of the image'})
|
|
33
33
|
source: Optional[str] = field(default=None, metadata={
|
|
34
34
|
'description': 'Source of the image'})
|
|
@@ -140,7 +140,6 @@ class DetectorNode(Node):
|
|
|
140
140
|
|
|
141
141
|
@self.sio.event
|
|
142
142
|
async def detect(sid, data: Dict) -> Dict:
|
|
143
|
-
self.log.debug('running detect via socketio')
|
|
144
143
|
try:
|
|
145
144
|
np_image = np.frombuffer(data['image'], np.uint8)
|
|
146
145
|
det = await self.get_detections(
|
|
@@ -153,7 +152,6 @@ class DetectorNode(Node):
|
|
|
153
152
|
if det is None:
|
|
154
153
|
return {'error': 'no model loaded'}
|
|
155
154
|
detection_dict = jsonable_encoder(asdict(det))
|
|
156
|
-
self.log.debug('detect via socketio finished')
|
|
157
155
|
return detection_dict
|
|
158
156
|
except Exception as e:
|
|
159
157
|
self.log.exception('could not detect via socketio')
|
|
@@ -188,6 +186,9 @@ class DetectorNode(Node):
|
|
|
188
186
|
source = data.get('source', None)
|
|
189
187
|
creation_date = data.get('creation_date', None)
|
|
190
188
|
|
|
189
|
+
self.log.debug('running upload via socketio. tags: %s, source: %s, creation_date: %s',
|
|
190
|
+
tags, source, creation_date)
|
|
191
|
+
|
|
191
192
|
loop = asyncio.get_event_loop()
|
|
192
193
|
try:
|
|
193
194
|
await loop.run_in_executor(None, self.outbox.save, data['image'], image_metadata, tags, source, creation_date)
|
|
@@ -76,10 +76,11 @@ class Outbox():
|
|
|
76
76
|
return
|
|
77
77
|
tmp = f'{GLOBALS.data_folder}/tmp/{identifier}'
|
|
78
78
|
image_metadata.tags = tags
|
|
79
|
-
if
|
|
80
|
-
image_metadata.
|
|
79
|
+
if self._is_valid_isoformat(creation_date):
|
|
80
|
+
image_metadata.created = creation_date
|
|
81
81
|
else:
|
|
82
|
-
image_metadata.
|
|
82
|
+
image_metadata.created = identifier
|
|
83
|
+
|
|
83
84
|
image_metadata.source = source or 'unknown'
|
|
84
85
|
os.makedirs(tmp, exist_ok=True)
|
|
85
86
|
|
|
@@ -94,7 +95,9 @@ class Outbox():
|
|
|
94
95
|
else:
|
|
95
96
|
self.log.error('Could not rename %s to %s', tmp, self.path + '/' + identifier)
|
|
96
97
|
|
|
97
|
-
def _is_valid_isoformat(self, date: str) -> bool:
|
|
98
|
+
def _is_valid_isoformat(self, date: Optional[str]) -> bool:
|
|
99
|
+
if date is None:
|
|
100
|
+
return False
|
|
98
101
|
try:
|
|
99
102
|
datetime.fromisoformat(date)
|
|
100
103
|
return True
|
|
@@ -153,7 +156,7 @@ class Outbox():
|
|
|
153
156
|
self.log.exception('Could not upload images')
|
|
154
157
|
return
|
|
155
158
|
finally:
|
|
156
|
-
self.log.
|
|
159
|
+
self.log.debug('Closing files')
|
|
157
160
|
for _, file in data:
|
|
158
161
|
file.close()
|
|
159
162
|
|
|
@@ -35,7 +35,7 @@ class LoopCommunicator():
|
|
|
35
35
|
else:
|
|
36
36
|
self.async_client = httpx.AsyncClient(base_url=self.base_url, timeout=Timeout(60.0))
|
|
37
37
|
|
|
38
|
-
logging.info(
|
|
38
|
+
logging.info('Loop interface initialized with base_url: %s / user: %s', self.base_url, self.username)
|
|
39
39
|
|
|
40
40
|
def websocket_url(self) -> str:
|
|
41
41
|
return f'ws{"s" if "learning-loop.ai" in self.host else ""}://' + self.host
|
|
@@ -48,7 +48,7 @@ class LoopCommunicator():
|
|
|
48
48
|
self.async_client.cookies.clear()
|
|
49
49
|
response = await self.async_client.post('/api/login', data={'username': self.username, 'password': self.password})
|
|
50
50
|
if response.status_code != 200:
|
|
51
|
-
logging.info(
|
|
51
|
+
logging.info('Login failed with response: %s', response)
|
|
52
52
|
raise LoopCommunicationException('Login failed with response: ' + str(response))
|
|
53
53
|
self.async_client.cookies.update(response.cookies)
|
|
54
54
|
|
|
@@ -57,7 +57,7 @@ class LoopCommunicator():
|
|
|
57
57
|
|
|
58
58
|
response = await self.async_client.post('/api/logout')
|
|
59
59
|
if response.status_code != 200:
|
|
60
|
-
logging.info(
|
|
60
|
+
logging.info('Logout failed with response: %s', response)
|
|
61
61
|
raise LoopCommunicationException('Logout failed with response: ' + str(response))
|
|
62
62
|
self.async_client.cookies.clear()
|
|
63
63
|
|
|
@@ -6,17 +6,17 @@ learning_loop_node/data_classes/__init__.py,sha256=JaEwaBHuDOs0DUkeGT8zLtARD5mvk
|
|
|
6
6
|
learning_loop_node/data_classes/annotations.py,sha256=iInU0Nuy_oYT_sj4k_n-W0UShCBI2cHQYrt8imymbtM,1211
|
|
7
7
|
learning_loop_node/data_classes/detections.py,sha256=7vqcS0EK8cmDjRDckHlpSZDZ9YO6qajRmYvx-oxatFc,5425
|
|
8
8
|
learning_loop_node/data_classes/general.py,sha256=usXokcTOVqTuaKJtBf0ffFWfzZhMrQtF7puKfwi6A5k,6195
|
|
9
|
-
learning_loop_node/data_classes/image_metadata.py,sha256=
|
|
9
|
+
learning_loop_node/data_classes/image_metadata.py,sha256=56nNSf_7aMlvKsJOG8vKCzJHcqKGHVRoULp85pJ2imA,1598
|
|
10
10
|
learning_loop_node/data_classes/socket_response.py,sha256=tIdt-oYf6ULoJIDYQCecNM9OtWR6_wJ9tL0Ksu83Vko,655
|
|
11
11
|
learning_loop_node/data_classes/training.py,sha256=hnMHZMk-WNRERyo7U97qL09v1tIdhnzPfTH-JgifLwU,6164
|
|
12
12
|
learning_loop_node/data_exchanger.py,sha256=6wK9hSGjpCxIx3VklEfPoAl3UyEZy5DfKP4sj97kf_w,9116
|
|
13
13
|
learning_loop_node/detector/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
learning_loop_node/detector/detector_logic.py,sha256=fAaeLykvkuOeaQx-scuN1pkydK8cPdmNT75P8xqImY0,2130
|
|
15
|
-
learning_loop_node/detector/detector_node.py,sha256=
|
|
15
|
+
learning_loop_node/detector/detector_node.py,sha256=ryzPcv5wfNjA_Sk5YDcUkZoKEUGPT1s29rvFLGGPIZ8,19929
|
|
16
16
|
learning_loop_node/detector/inbox_filter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
learning_loop_node/detector/inbox_filter/cam_observation_history.py,sha256=8gzxYPD3t1OS9wBHXfIvNV2xTTMo0B70O1b50iaH2D8,3344
|
|
18
18
|
learning_loop_node/detector/inbox_filter/relevance_filter.py,sha256=NPEmrAtuGjIWCtHS0B3zDmnYWkhVFCLbd_7RUp08_AM,1372
|
|
19
|
-
learning_loop_node/detector/outbox.py,sha256=
|
|
19
|
+
learning_loop_node/detector/outbox.py,sha256=AIoQFCX3CA4jcQWKcmCkL9su1SWMDci7p-Xip0kNbTE,8643
|
|
20
20
|
learning_loop_node/detector/rest/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
21
21
|
learning_loop_node/detector/rest/about.py,sha256=COYgmYO1tXGSIwjF__P79mVZUfSDZoHsW0GUarQ2rv0,1686
|
|
22
22
|
learning_loop_node/detector/rest/backdoor_controls.py,sha256=ZNaFOvC0OLWNtcLiG-NIqS_y1kkLP4csgk3CHhp8Gis,885
|
|
@@ -32,7 +32,7 @@ learning_loop_node/helpers/environment_reader.py,sha256=OtCTDc0KT9r-SMygkZB_Mw-Z
|
|
|
32
32
|
learning_loop_node/helpers/gdrive_downloader.py,sha256=zeYJciTAJVRpu_eFjwgYLCpIa6hU1d71anqEBb564Rk,1145
|
|
33
33
|
learning_loop_node/helpers/log_conf.py,sha256=z_0PHh7U7DkJbSbKoSPyUfS7NhBHtRxXHdNcj67Hpbc,951
|
|
34
34
|
learning_loop_node/helpers/misc.py,sha256=j4is8Rv0ttnCqF-R-wP3xwEi67OI6IBJav5Woo5lyDk,7701
|
|
35
|
-
learning_loop_node/loop_communication.py,sha256=
|
|
35
|
+
learning_loop_node/loop_communication.py,sha256=Pdc9jdYFmGh12CAHMYX1sF1ARAXEAhGO4-sbC4jnrIo,6760
|
|
36
36
|
learning_loop_node/node.py,sha256=vbMR_6QsruB2IYYKUWx4--9Ywjf_vuBQb4jyzLRqpRQ,10300
|
|
37
37
|
learning_loop_node/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
38
38
|
learning_loop_node/rest.py,sha256=o1dl4Mtznd5duyEQtCYSGlK04l1Y-p_YRjG40Q4l31c,1491
|
|
@@ -91,6 +91,6 @@ learning_loop_node/trainer/test_executor.py,sha256=6BVGDN_6f5GEMMEvDLSG1yzMybSvg
|
|
|
91
91
|
learning_loop_node/trainer/trainer_logic.py,sha256=PlYExIskU9pWJO0e9m_0KJnUdOI10GtW0oDOevYmg1o,8461
|
|
92
92
|
learning_loop_node/trainer/trainer_logic_generic.py,sha256=zXoi1wWkRy6SGp2sd9xkD2DGd7hiCHxa4NE0RiC71v4,26147
|
|
93
93
|
learning_loop_node/trainer/trainer_node.py,sha256=8ANS9iy-swdTLvt9wEFixE6YlmqvqBl17A-R4tVYD-I,5384
|
|
94
|
-
learning_loop_node-0.11.
|
|
95
|
-
learning_loop_node-0.11.
|
|
96
|
-
learning_loop_node-0.11.
|
|
94
|
+
learning_loop_node-0.11.1.dist-info/METADATA,sha256=AyF22d7GjFT2yktztap-HALd6f8jwDSqJYzy9wH5PHc,11906
|
|
95
|
+
learning_loop_node-0.11.1.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
|
|
96
|
+
learning_loop_node-0.11.1.dist-info/RECORD,,
|
|
File without changes
|