Skip to content

Commit

Permalink
try fix detection handling in upload
Browse files Browse the repository at this point in the history
  • Loading branch information
denniswittich committed Dec 6, 2023
1 parent 173bb1c commit ee76b40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion learning_loop_node/detector/detector_logic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from abc import abstractmethod
from typing import Any, Optional
from typing import Optional

import numpy as np

Expand Down
7 changes: 6 additions & 1 deletion learning_loop_node/detector/detector_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,14 @@ async def _upload(sid, data: Dict) -> Optional[Dict]:
detections = from_dict(data_class=Detections, data=detection_data)
detections = self.add_category_id_to_detections(self.detector_logic.model_info, detections)
else:
print(f'No detections: {detection_data}', flush=True)
detections = Detections()

tags = data.get('tags', ['picked_by_system'])
tags = data.get('tags', [])
tags.append('picked_by_system')
camera_id = data.get('camera-id', None) or data.get('mac', None)
if camera_id is not None:
tags.append(camera_id)

loop = asyncio.get_event_loop()
try:
Expand Down

0 comments on commit ee76b40

Please sign in to comment.