diff --git a/annotation_queue/annotation_queue_dto.py b/annotation-queue/annotation_queue_dto.py similarity index 95% rename from annotation_queue/annotation_queue_dto.py rename to annotation-queue/annotation_queue_dto.py index 2394788..f37d30d 100644 --- a/annotation_queue/annotation_queue_dto.py +++ b/annotation-queue/annotation_queue_dto.py @@ -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}]' diff --git a/annotation_queue/annotation_queue_handler.py b/annotation-queue/annotation_queue_handler.py similarity index 97% rename from annotation_queue/annotation_queue_handler.py rename to annotation-queue/annotation_queue_handler.py index 8a38576..ef2a8fe 100644 --- a/annotation_queue/annotation_queue_handler.py +++ b/annotation-queue/annotation_queue_handler.py @@ -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) diff --git a/annotation_queue/classes.json b/annotation-queue/classes.json similarity index 100% rename from annotation_queue/classes.json rename to annotation-queue/classes.json diff --git a/annotation_queue/config.yaml b/annotation-queue/config.yaml similarity index 100% rename from annotation_queue/config.yaml rename to annotation-queue/config.yaml diff --git a/annotation_queue/offset.yaml b/annotation-queue/offset.yaml similarity index 100% rename from annotation_queue/offset.yaml rename to annotation-queue/offset.yaml diff --git a/annotation-queue/requirements.txt b/annotation-queue/requirements.txt new file mode 100644 index 0000000..a1370c4 --- /dev/null +++ b/annotation-queue/requirements.txt @@ -0,0 +1,3 @@ +yaml +msgpack +rstream \ No newline at end of file diff --git a/annotation-queue/run.sh b/annotation-queue/run.sh new file mode 100644 index 0000000..2a74c26 --- /dev/null +++ b/annotation-queue/run.sh @@ -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 \ No newline at end of file diff --git a/offset.yaml b/offset.yaml deleted file mode 100644 index c70ccd2..0000000 --- a/offset.yaml +++ /dev/null @@ -1 +0,0 @@ -offset_queue: 0 \ No newline at end of file