From 76cf2b51d2d30853a2f82d94d091927fa4aa5e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ianar=C3=A9=20S=C3=A9vi?= Date: Tue, 16 Dec 2025 15:39:19 +0100 Subject: [PATCH] :boom: add crop inference --- v2/inference/crop/multiple.json | 90 +++++++++++++++++++ v2/inference/crop/single.json | 42 +++++++++ .../{ => extraction}/data_schema_replace.json | 0 .../{ => extraction}/deep_nested_fields.json | 0 .../{ => extraction}/rag_matched.json | 0 .../{ => extraction}/rag_not_matched.json | 0 v2/inference/{ => extraction}/raw_texts.json | 0 v2/inference/{ => extraction}/raw_texts.txt | 0 .../standard_field_types.json | 0 .../{ => extraction}/standard_field_types.rst | 0 .../text_context_enabled.json | 0 11 files changed, 132 insertions(+) create mode 100644 v2/inference/crop/multiple.json create mode 100644 v2/inference/crop/single.json rename v2/inference/{ => extraction}/data_schema_replace.json (100%) rename v2/inference/{ => extraction}/deep_nested_fields.json (100%) rename v2/inference/{ => extraction}/rag_matched.json (100%) rename v2/inference/{ => extraction}/rag_not_matched.json (100%) rename v2/inference/{ => extraction}/raw_texts.json (100%) rename v2/inference/{ => extraction}/raw_texts.txt (100%) rename v2/inference/{ => extraction}/standard_field_types.json (100%) rename v2/inference/{ => extraction}/standard_field_types.rst (100%) rename v2/inference/{ => extraction}/text_context_enabled.json (100%) diff --git a/v2/inference/crop/multiple.json b/v2/inference/crop/multiple.json new file mode 100644 index 0000000..53de317 --- /dev/null +++ b/v2/inference/crop/multiple.json @@ -0,0 +1,90 @@ +{ + "inference": { + "id": "12345678-1234-1234-1234-123456789abc", + "model": { + "id": "test-model-id" + }, + "file": { + "name": "default_sample.jpg", + "alias": "my_file_alias", + "page_count": 1, + "mime_type": "image/jpeg" + }, + "result": { + "crop": [ + { + "object_type": "driver_license", + "location": { + "polygon": [ + [ + 0.2, + 0.074 + ], + [ + 0.479, + 0.074 + ], + [ + 0.479, + 0.988 + ], + [ + 0.2, + 0.988 + ] + ], + "page": 0 + } + }, + { + "object_type": "passport", + "location": { + "polygon": [ + [ + 0.549, + 0.15 + ], + [ + 0.865, + 0.15 + ], + [ + 0.865, + 0.97 + ], + [ + 0.549, + 0.97 + ] + ], + "page": 0 + } + }, + { + "object_type": "pokémon_card", + "location": { + "polygon": [ + [ + 0.549, + 0.15 + ], + [ + 0.865, + 0.15 + ], + [ + 0.865, + 0.97 + ], + [ + 0.549, + 0.97 + ] + ], + "page": 1 + } + } + ] + } + } +} diff --git a/v2/inference/crop/single.json b/v2/inference/crop/single.json new file mode 100644 index 0000000..8255538 --- /dev/null +++ b/v2/inference/crop/single.json @@ -0,0 +1,42 @@ +{ + "inference": { + "id": "12345678-1234-1234-1234-123456789abc", + "model": { + "id": "test-model-id" + }, + "file": { + "name": "test-file-name.pdf", + "alias": "my_file_alias", + "page_count": 1, + "mime_type": "application/pdf" + }, + "result": { + "crop": [ + { + "object_type": "الفاتورة", + "location": { + "polygon": [ + [ + 0.039, + 0.036 + ], + [ + 0.959, + 0.036 + ], + [ + 0.959, + 0.962 + ], + [ + 0.039, + 0.962 + ] + ], + "page": 0 + } + } + ] + } + } +} diff --git a/v2/inference/data_schema_replace.json b/v2/inference/extraction/data_schema_replace.json similarity index 100% rename from v2/inference/data_schema_replace.json rename to v2/inference/extraction/data_schema_replace.json diff --git a/v2/inference/deep_nested_fields.json b/v2/inference/extraction/deep_nested_fields.json similarity index 100% rename from v2/inference/deep_nested_fields.json rename to v2/inference/extraction/deep_nested_fields.json diff --git a/v2/inference/rag_matched.json b/v2/inference/extraction/rag_matched.json similarity index 100% rename from v2/inference/rag_matched.json rename to v2/inference/extraction/rag_matched.json diff --git a/v2/inference/rag_not_matched.json b/v2/inference/extraction/rag_not_matched.json similarity index 100% rename from v2/inference/rag_not_matched.json rename to v2/inference/extraction/rag_not_matched.json diff --git a/v2/inference/raw_texts.json b/v2/inference/extraction/raw_texts.json similarity index 100% rename from v2/inference/raw_texts.json rename to v2/inference/extraction/raw_texts.json diff --git a/v2/inference/raw_texts.txt b/v2/inference/extraction/raw_texts.txt similarity index 100% rename from v2/inference/raw_texts.txt rename to v2/inference/extraction/raw_texts.txt diff --git a/v2/inference/standard_field_types.json b/v2/inference/extraction/standard_field_types.json similarity index 100% rename from v2/inference/standard_field_types.json rename to v2/inference/extraction/standard_field_types.json diff --git a/v2/inference/standard_field_types.rst b/v2/inference/extraction/standard_field_types.rst similarity index 100% rename from v2/inference/standard_field_types.rst rename to v2/inference/extraction/standard_field_types.rst diff --git a/v2/inference/text_context_enabled.json b/v2/inference/extraction/text_context_enabled.json similarity index 100% rename from v2/inference/text_context_enabled.json rename to v2/inference/extraction/text_context_enabled.json