From bdd2d322ebe5d08ce00aa23cb91483cc0c45c1c1 Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Thu, 28 Nov 2024 16:35:55 +0530 Subject: [PATCH 1/2] added new project type OCRTextlineSegmentation --- backend/projects/annotation_registry.py | 9 +++++++++ .../ocr/ocr_textline_segmentation.jsx | 5 +++++ backend/projects/project_registry.yaml | 16 ++++++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 backend/projects/label_studio_jsx_files/ocr/ocr_textline_segmentation.jsx diff --git a/backend/projects/annotation_registry.py b/backend/projects/annotation_registry.py index 22b7ae05d..7d92ba606 100644 --- a/backend/projects/annotation_registry.py +++ b/backend/projects/annotation_registry.py @@ -108,6 +108,15 @@ "type": "labels", }, }, + "OCRTextlineSegmentation": { + "ocr_transcribed_json": { + "to_name": "image_url", + "from_name": [ + "annotation_bboxes", + ], + "type": ["rectangle"], + }, + }, "OCRTranscription": { "ocr_transcribed_json": { "to_name": "image_url", diff --git a/backend/projects/label_studio_jsx_files/ocr/ocr_textline_segmentation.jsx b/backend/projects/label_studio_jsx_files/ocr/ocr_textline_segmentation.jsx new file mode 100644 index 000000000..d75a1a705 --- /dev/null +++ b/backend/projects/label_studio_jsx_files/ocr/ocr_textline_segmentation.jsx @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/backend/projects/project_registry.yaml b/backend/projects/project_registry.yaml index 334b850e2..77b484d21 100644 --- a/backend/projects/project_registry.yaml +++ b/backend/projects/project_registry.yaml @@ -83,6 +83,22 @@ Translation: OCR: description: "Performing OCR on images" project_types: + OCRTextlineSegmentation: + project_mode: "Annotation" + label_studio_jsx_file: "ocr_textline_segmentation.jsx" + input_dataset: + class: OCRDocument + fields: + - image_url + display_fields: + - image_url + prediction: ocr_prediction_json + output_dataset: + class: OCRDocument + save_type: in_place + fields: + annotations: + - ocr_transcribed_json OCRTranscription: project_mode: "Annotation" label_studio_jsx_file: "ocr/ocr_transcription.jsx" From bf5d5ae30a09f6d1a4ba80ba081b32591af3476a Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Thu, 28 Nov 2024 16:38:54 +0530 Subject: [PATCH 2/2] added new project type OCRTextlineSegmentation --- backend/projects/project_registry.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/projects/project_registry.yaml b/backend/projects/project_registry.yaml index 77b484d21..8d9dc03e3 100644 --- a/backend/projects/project_registry.yaml +++ b/backend/projects/project_registry.yaml @@ -85,7 +85,7 @@ OCR: project_types: OCRTextlineSegmentation: project_mode: "Annotation" - label_studio_jsx_file: "ocr_textline_segmentation.jsx" + label_studio_jsx_file: "ocr/ocr_textline_segmentation.jsx" input_dataset: class: OCRDocument fields: