mirror of
https://github.com/azaion/ai-training.git
synced 2026-04-22 09:26:36 +00:00
move annotation_queue_handler to a separate repository
This commit is contained in:
@@ -78,7 +78,7 @@ class Detection:
|
||||
self.confidence = confidence
|
||||
|
||||
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:
|
||||
@@ -111,7 +111,7 @@ class AnnotationMessage:
|
||||
detections_str_list = [str(detection) for detection in self.detections]
|
||||
detections_str = " [" + ", ".join(detections_str_list) + "]"
|
||||
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
|
||||
def _parse_detections(detections_json_str):
|
||||
@@ -139,4 +139,4 @@ class AnnotationBulkMessage:
|
||||
self.createdDate = datetime.utcfromtimestamp(ts.seconds) + timedelta(microseconds=ts.nanoseconds / 1000)
|
||||
|
||||
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
|
||||
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.setLevel(logging.INFO)
|
||||
@@ -21,7 +21,7 @@ handler = TimedRotatingFileHandler(
|
||||
backupCount=7,
|
||||
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)
|
||||
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