mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-23 03:06:35 +00:00
move annotation_queue_handler to a separate repository
This commit is contained in:
@@ -78,7 +78,7 @@ class Detection:
|
|||||||
self.confidence = confidence
|
self.confidence = confidence
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{annotation_classes[self.cls].name}: {self.x:.2f} {self.y:.2f} {self.w:.2f} {self.h:.2f}, prob: {(self.confidence * 100):.1f}%'
|
return f'{annotation_classes[self.cls].name}: {(self.confidence * 100):.1f}%'
|
||||||
|
|
||||||
|
|
||||||
class AnnotationCreatedMessageNarrow:
|
class AnnotationCreatedMessageNarrow:
|
||||||
@@ -111,7 +111,7 @@ class AnnotationMessage:
|
|||||||
detections_str_list = [str(detection) for detection in self.detections]
|
detections_str_list = [str(detection) for detection in self.detections]
|
||||||
detections_str = " [" + ", ".join(detections_str_list) + "]"
|
detections_str = " [" + ", ".join(detections_str_list) + "]"
|
||||||
createdBy = 'AI' if self.source == SourceEnum.AI else self.createdRole
|
createdBy = 'AI' if self.source == SourceEnum.AI else self.createdRole
|
||||||
return f'{self.status} {self.name} by [{createdBy} {self.createdEmail}]{detections_str}'
|
return f'{self.status} {self.name} by [{createdBy} {self.createdEmail}|{self.createdDate:%m-%d %H:%M}]{detections_str}'
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _parse_detections(detections_json_str):
|
def _parse_detections(detections_json_str):
|
||||||
@@ -139,4 +139,4 @@ class AnnotationBulkMessage:
|
|||||||
self.createdDate = datetime.utcfromtimestamp(ts.seconds) + timedelta(microseconds=ts.nanoseconds / 1000)
|
self.createdDate = datetime.utcfromtimestamp(ts.seconds) + timedelta(microseconds=ts.nanoseconds / 1000)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.annotation_status}: [{self.annotation_names}]'
|
return f'{self.annotation_status}: [{self.annotation_names}] by [{self.createdEmail}|{self.createdDate:%m-%d %H:%M}]'
|
||||||
+2
-2
@@ -9,7 +9,7 @@ from datetime import datetime, timedelta
|
|||||||
import logging
|
import logging
|
||||||
from logging.handlers import TimedRotatingFileHandler
|
from logging.handlers import TimedRotatingFileHandler
|
||||||
|
|
||||||
from annotation_queue.annotation_queue_dto import AnnotationStatus, AnnotationMessage, AnnotationBulkMessage
|
from annotation_queue_dto import AnnotationStatus, AnnotationMessage, AnnotationBulkMessage
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logger.setLevel(logging.INFO)
|
logger.setLevel(logging.INFO)
|
||||||
@@ -21,7 +21,7 @@ handler = TimedRotatingFileHandler(
|
|||||||
backupCount=7,
|
backupCount=7,
|
||||||
encoding="utf-8"
|
encoding="utf-8"
|
||||||
)
|
)
|
||||||
formatter = logging.Formatter('%(asctime)s|%(levelname)s|%(message)s', "%H:%M:%S")
|
formatter = logging.Formatter('%(asctime)s|%(message)s', "%H:%M:%S")
|
||||||
handler.setFormatter(formatter)
|
handler.setFormatter(formatter)
|
||||||
logger.addHandler(handler)
|
logger.addHandler(handler)
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
yaml
|
||||||
|
msgpack
|
||||||
|
rstream
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
if [ ! -d "venv" ]; then
|
||||||
|
python3 -m venv venv
|
||||||
|
fi
|
||||||
|
|
||||||
|
venv/bin/python -m pip install --upgrade pip
|
||||||
|
venv/bin/pip install -r requirements.txt
|
||||||
|
venv/bin/pip install --upgrade pyinstaller pyinstaller-hooks-contrib
|
||||||
@@ -1 +0,0 @@
|
|||||||
offset_queue: 0
|
|
||||||
Reference in New Issue
Block a user