mindee 4.0.0 → 4.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/bin/cli_products.rb +172 -0
- data/bin/mindee.rb +6 -121
- data/docs/advanced_file_operations.md +7 -9
- data/docs/code_samples/invoice_splitter_v1_async.txt +2 -1
- data/docs/code_samples/{license_plates_v1.txt → us_mail_v2_async.txt} +1 -1
- data/docs/code_samples/workflow_execution.txt +28 -0
- data/docs/getting_started.md +1 -1
- data/docs/global_products/barcode_reader_v1.md +1 -1
- data/docs/global_products/bill_of_lading_v1.md +1 -1
- data/docs/global_products/business_card_v1.md +1 -1
- data/docs/global_products/cropper_v1.md +1 -1
- data/docs/global_products/delivery_notes_v1.md +2 -2
- data/docs/global_products/driver_license_v1.md +1 -1
- data/docs/global_products/expense_receipts_v5.md +26 -25
- data/docs/global_products/financial_document_v1.md +34 -33
- data/docs/global_products/international_id_v2.md +7 -7
- data/docs/global_products/invoice_splitter_v1.md +53 -33
- data/docs/global_products/invoices_v4.md +19 -19
- data/docs/global_products/multi_receipts_detector_v1.md +1 -1
- data/docs/global_products/nutrition_facts_v1.md +1 -1
- data/docs/global_products/passport_v1.md +1 -1
- data/docs/global_products/resume_v1.md +4 -4
- data/docs/global_products/universal.md +1 -1
- data/docs/global_products.md +1 -1
- data/docs/loading_a_document.md +87 -73
- data/docs/localized_products/bank_account_details_v2.md +1 -1
- data/docs/localized_products/bank_check_v1.md +1 -1
- data/docs/localized_products/bank_statement_fr_v2.md +1 -1
- data/docs/localized_products/carte_grise_v1.md +1 -1
- data/docs/localized_products/energy_bill_fra_v1.md +11 -3
- data/docs/localized_products/french_healthcard_v1.md +1 -1
- data/docs/localized_products/idcard_fr_v2.md +6 -6
- data/docs/localized_products/ind_passport_v1.md +5 -5
- data/docs/localized_products/payslip_fra_v3.md +1 -1
- data/docs/localized_products/us_healthcare_cards_v1.md +2 -2
- data/docs/localized_products/us_mail_v3.md +1 -1
- data/docs/localized_products/us_w9_v1.md +1 -1
- data/docs/localized_products.md +1 -1
- data/lib/mindee/client.rb +6 -8
- data/lib/mindee/http/workflow_endpoint.rb +23 -23
- data/lib/mindee/pdf/pdf_extractor.rb +3 -3
- data/lib/mindee/product/delivery_note/delivery_note_v1_document.rb +1 -1
- data/lib/mindee/product/delivery_note/delivery_note_v1_page.rb +1 -1
- data/lib/mindee/product/financial_document/financial_document_v1_document.rb +15 -14
- data/lib/mindee/product/financial_document/financial_document_v1_line_item.rb +1 -1
- data/lib/mindee/product/financial_document/financial_document_v1_line_items.rb +1 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_document.rb +5 -1
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rb +18 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rb +4 -0
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_meter_detail.rb +2 -2
- data/lib/mindee/product/fr/energy_bill/energy_bill_v1_page.rb +1 -1
- data/lib/mindee/product/invoice/invoice_v4_document.rb +14 -14
- data/lib/mindee/product/invoice/invoice_v4_line_item.rb +2 -2
- data/lib/mindee/product/invoice/invoice_v4_line_items.rb +1 -1
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1.rb +2 -2
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_document.rb +38 -42
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rb +55 -0
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rb +48 -0
- data/lib/mindee/product/invoice_splitter/invoice_splitter_v1_page.rb +9 -5
- data/lib/mindee/product/receipt/receipt_v5_document.rb +8 -8
- data/lib/mindee/product/receipt/receipt_v5_line_item.rb +1 -1
- data/lib/mindee/product/receipt/receipt_v5_line_items.rb +1 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_document.rb +1 -1
- data/lib/mindee/product/us/healthcare_card/healthcare_card_v1_page.rb +1 -1
- data/lib/mindee/product/{eu/license_plate/license_plate_v1.rb → us/us_mail/us_mail_v2.rb} +13 -13
- data/lib/mindee/product/us/us_mail/us_mail_v2_document.rb +105 -0
- data/lib/mindee/product/{eu/license_plate/license_plate_v1_page.rb → us/us_mail/us_mail_v2_page.rb} +8 -8
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_address.rb +105 -0
- data/lib/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rb +63 -0
- data/lib/mindee/product/us/us_mail/us_mail_v2_sender_address.rb +66 -0
- data/lib/mindee/product.rb +5 -5
- data/lib/mindee/version.rb +1 -1
- data/mindee.gemspec +3 -3
- data/sig/custom/net_http.rbs +5 -0
- data/sig/mindee/client.rbs +1 -0
- data/sig/mindee/http/workflow_endpoint.rbs +8 -2
- data/sig/mindee/pdf/pdf_extractor.rbs +1 -1
- data/sig/mindee/product/bill_of_lading/bill_of_lading_v1_carrier_items.rbs +1 -1
- data/sig/mindee/product/financial_document/financial_document_v1_line_items.rbs +1 -1
- data/sig/mindee/product/fr/bank_statement/bank_statement_v2_transactions.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usage.rbs +2 -0
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_energy_usages.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_subscriptions.rbs +1 -1
- data/sig/mindee/product/fr/energy_bill/energy_bill_v1_taxes_and_contributions.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v2_salary_details.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v3_paid_time_offs.rbs +1 -1
- data/sig/mindee/product/fr/payslip/payslip_v3_salary_details.rbs +1 -1
- data/sig/mindee/product/invoice/invoice_v4_line_items.rbs +1 -1
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1.rbs +1 -4
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_document.rbs +5 -9
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_group.rbs +14 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_invoice_page_groups.rbs +13 -0
- data/sig/mindee/product/invoice_splitter/invoice_splitter_v1_page.rbs +2 -0
- data/sig/mindee/product/nutrition_facts_label/nutrition_facts_label_v1_nutrients.rbs +1 -1
- data/sig/mindee/product/receipt/receipt_v5_line_items.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_certificates.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_educations.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_languages.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_professional_experiences.rbs +1 -1
- data/sig/mindee/product/resume/resume_v1_social_networks_urls.rbs +1 -1
- data/sig/mindee/product/us/healthcare_card/healthcare_card_v1_copays.rbs +1 -1
- data/sig/mindee/product/us/us_mail/us_mail_v2.rbs +13 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_document.rbs +20 -0
- data/sig/mindee/product/{eu/license_plate/license_plate_v1_page.rbs → us/us_mail/us_mail_v2_page.rbs} +5 -5
- data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_address.rbs +22 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_recipient_addresses.rbs +15 -0
- data/sig/mindee/product/us/us_mail/us_mail_v2_sender_address.rbs +18 -0
- data/sig/mindee/product/us/us_mail/us_mail_v3_recipient_addresses.rbs +1 -1
- metadata +23 -12
- data/docs/localized_products/license_plates_v1.md +0 -112
- data/lib/mindee/product/eu/license_plate/license_plate_v1_document.rb +0 -37
- data/sig/mindee/product/eu/license_plate/license_plate_v1.rbs +0 -13
- data/sig/mindee/product/eu/license_plate/license_plate_v1_document.rbs +0 -15
@@ -1,112 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Ruby Client Library - EU License Plate
|
3
|
-
category: 622b805aaec68102ea7fcbc2
|
4
|
-
slug: ruby-eu-license-plate-ocr
|
5
|
-
parentDoc: 67b49e29a2cd6f08d69a40d8
|
6
|
-
---
|
7
|
-
The Ruby Client Library supports the [License Plate API](https://platform.mindee.com/mindee/license_plates).
|
8
|
-
|
9
|
-
|
10
|
-
> 📝 Product Specs
|
11
|
-
>
|
12
|
-
> | Specification | Details |
|
13
|
-
> | ------------------------------ | -------------------------------------------------- |
|
14
|
-
> | Endpoint Name | `license_plates` |
|
15
|
-
> | Recommended Version | `v1.1` |
|
16
|
-
> | Supports Polling/Webhooks | ❌ No |
|
17
|
-
> | Support Synchronous HTTP Calls | ✔️ Yes |
|
18
|
-
> | Geography | 🇪🇺 Europe |
|
19
|
-
|
20
|
-
|
21
|
-
Using the [sample below](https://github.com/mindee/client-lib-test-data/blob/main/products/license_plates/default_sample.jpg),
|
22
|
-
we are going to illustrate how to extract the data that we want using the Ruby Client Library.
|
23
|
-

|
24
|
-
|
25
|
-
# Quick-Start
|
26
|
-
```rb
|
27
|
-
#
|
28
|
-
# Install the Ruby client library by running:
|
29
|
-
# gem install mindee
|
30
|
-
#
|
31
|
-
|
32
|
-
require 'mindee'
|
33
|
-
|
34
|
-
# Init a new client
|
35
|
-
mindee_client = Mindee::Client.new(api_key: 'my-api-key')
|
36
|
-
|
37
|
-
# Load a file from disk
|
38
|
-
input_source = mindee_client.source_from_path('/path/to/the/file.ext')
|
39
|
-
|
40
|
-
# Parse the file
|
41
|
-
result = mindee_client.parse(
|
42
|
-
input_source,
|
43
|
-
Mindee::Product::EU::LicensePlate::LicensePlateV1
|
44
|
-
)
|
45
|
-
|
46
|
-
# Print a full summary of the parsed data in RST format
|
47
|
-
puts result.document
|
48
|
-
|
49
|
-
# Print the document-level parsed data
|
50
|
-
# puts result.document.inference.prediction
|
51
|
-
```
|
52
|
-
|
53
|
-
**Output (RST):**
|
54
|
-
```rst
|
55
|
-
########
|
56
|
-
Document
|
57
|
-
########
|
58
|
-
:Mindee ID: f0f48232-2c80-4473-9c6f-88a09111b84d
|
59
|
-
:Filename: default_sample.jpg
|
60
|
-
|
61
|
-
Inference
|
62
|
-
#########
|
63
|
-
:Product: mindee/license_plates v1.0
|
64
|
-
:Rotation applied: No
|
65
|
-
|
66
|
-
Prediction
|
67
|
-
==========
|
68
|
-
:License Plates: BY-323-YB
|
69
|
-
|
70
|
-
Page Predictions
|
71
|
-
================
|
72
|
-
|
73
|
-
Page 0
|
74
|
-
------
|
75
|
-
:License Plates: BY-323-YB
|
76
|
-
```
|
77
|
-
|
78
|
-
# Field Types
|
79
|
-
## Standard Fields
|
80
|
-
These fields are generic and used in several products.
|
81
|
-
|
82
|
-
### Basic Field
|
83
|
-
Each prediction object contains a set of fields that inherit from the generic `Field` class.
|
84
|
-
A typical `Field` object will have the following attributes:
|
85
|
-
|
86
|
-
* **value** (`String`, `Float`, `Integer`, `bool`): corresponds to the field value. Can be `nil` if no value was extracted.
|
87
|
-
* **confidence** (Float, nil): the confidence score of the field prediction.
|
88
|
-
* **bounding_box** (`Mindee::Geometry::Quadrilateral`, `nil`): contains exactly 4 relative vertices (points) coordinates of a right rectangle containing the field in the document.
|
89
|
-
* **polygon** (`Mindee::Geometry::Polygon`, `nil`): contains the relative vertices coordinates (`Point`) of a polygon containing the field in the image.
|
90
|
-
* **page_id** (`Integer`, `nil`): the ID of the page, always `nil` when at document-level.
|
91
|
-
* **reconstructed** (`bool`): indicates whether an object was reconstructed (not extracted as the API gave it).
|
92
|
-
|
93
|
-
|
94
|
-
Aside from the previous attributes, all basic fields have access to a `to_s` method that can be used to print their value as a string.
|
95
|
-
|
96
|
-
### String Field
|
97
|
-
The text field `StringField` only has one constraint: it's **value** is a `String` (or `nil`).
|
98
|
-
|
99
|
-
# Attributes
|
100
|
-
The following fields are extracted for License Plate V1:
|
101
|
-
|
102
|
-
## License Plates
|
103
|
-
**license_plates** (Array<[StringField](#string-field)>): List of all license plates found in the image.
|
104
|
-
|
105
|
-
```rb
|
106
|
-
result.document.inference.prediction.license_plates do |license_plates_elem|
|
107
|
-
puts license_plates_elem.value
|
108
|
-
end
|
109
|
-
```
|
110
|
-
|
111
|
-
# Questions?
|
112
|
-
[Join our Slack](https://join.slack.com/t/mindee-community/shared_invite/zt-2d0ds7dtz-DPAF81ZqTy20chsYpQBW5g)
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative '../../../parsing'
|
4
|
-
|
5
|
-
module Mindee
|
6
|
-
module Product
|
7
|
-
module EU
|
8
|
-
module LicensePlate
|
9
|
-
# License Plate API version 1.1 document data.
|
10
|
-
class LicensePlateV1Document < Mindee::Parsing::Common::Prediction
|
11
|
-
include Mindee::Parsing::Standard
|
12
|
-
# List of all license plates found in the image.
|
13
|
-
# @return [Array<Mindee::Parsing::Standard::StringField>]
|
14
|
-
attr_reader :license_plates
|
15
|
-
|
16
|
-
# @param prediction [Hash]
|
17
|
-
# @param page_id [Integer, nil]
|
18
|
-
def initialize(prediction, page_id)
|
19
|
-
super
|
20
|
-
@license_plates = [] # : Array[Parsing::Standard::StringField]
|
21
|
-
prediction['license_plates'].each do |item|
|
22
|
-
@license_plates.push(Parsing::Standard::StringField.new(item, page_id))
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
# @return [String]
|
27
|
-
def to_s
|
28
|
-
license_plates = @license_plates.join("\n #{' ' * 16}")
|
29
|
-
out_str = String.new
|
30
|
-
out_str << "\n:License Plates: #{license_plates}".rstrip
|
31
|
-
out_str[1..].to_s
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# lib/mindee/product/../license_plate/license_plate_v1.rb
|
2
|
-
|
3
|
-
module Mindee
|
4
|
-
module Product
|
5
|
-
module EU
|
6
|
-
module LicensePlate
|
7
|
-
class LicensePlateV1 < Parsing::Common::Inference
|
8
|
-
def initialize: (Hash[Symbol | String, untyped]) -> void
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
# lib/mindee/product/../license_plate/license_plate_v1_document.rb
|
2
|
-
|
3
|
-
module Mindee
|
4
|
-
module Product
|
5
|
-
module EU
|
6
|
-
module LicensePlate
|
7
|
-
class LicensePlateV1Document < Parsing::Common::Prediction
|
8
|
-
def initialize: (Hash[Symbol | String, untyped], Integer?) -> void
|
9
|
-
def license_plates: -> (Array[Parsing::Standard::StringField])
|
10
|
-
def to_s: -> String
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|