ocrb 0.1.0 → 0.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/README.md +12 -0
- data/lib/ocrb/version.rb +1 -1
- data/lib/ocrb.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87117cbbb5090e9d9a381038266b798be6186e63370bbd88f0704dab4a4d7682
|
|
4
|
+
data.tar.gz: b6a8e44a0d11c0376ed9d5ae58388d75df044262477a7658f6688978a27917a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2660d8a572ab57f11af8e08ac3f50e6226c417d90759ab20c09faae2949e5d3e1703df44f40aadc4b66daeca10d6ccee4712ef1d12b96c81f72e0df17eb5744d
|
|
7
|
+
data.tar.gz: 8d8b176cfc183531fb9b79bcf407a4833e2d4787e3604dc3ee43a4aece58a855a70921e10d7aee5fc7bef8eb5b300cb2e509eadb8aa0437a49bcd330eaf3d4b0
|
data/README.md
CHANGED
|
@@ -50,6 +50,18 @@ text = Ocrb.run(
|
|
|
50
50
|
)
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
Or Auge:
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
require "ocrb"
|
|
57
|
+
|
|
58
|
+
text = Ocrb.run(
|
|
59
|
+
"receipt.jpg",
|
|
60
|
+
"zh-Hans", # language, can be en/zh-Hans/ja... or mixed
|
|
61
|
+
extractor: Ocrb::Extractors::Auge.new
|
|
62
|
+
)
|
|
63
|
+
```
|
|
64
|
+
|
|
53
65
|
You can also resize the image before OCR by passing a resizer:
|
|
54
66
|
|
|
55
67
|
```ruby
|
data/lib/ocrb/version.rb
CHANGED
data/lib/ocrb.rb
CHANGED
|
@@ -19,6 +19,13 @@ module Ocrb
|
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
class Auge
|
|
23
|
+
def extract(image_path, prompt)
|
|
24
|
+
result, = Open3.capture2('auge', '--ocr', '--langs', prompt, image_path)
|
|
25
|
+
result
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
22
29
|
class OpenAi
|
|
23
30
|
def initialize(
|
|
24
31
|
# url: 'http://localhost:11434/v1',
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ocrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- c
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: base64
|
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
55
55
|
- !ruby/object:Gem::Version
|
|
56
56
|
version: '0'
|
|
57
57
|
requirements: []
|
|
58
|
-
rubygems_version: 3.6.
|
|
58
|
+
rubygems_version: 3.6.9
|
|
59
59
|
specification_version: 4
|
|
60
60
|
summary: OCR
|
|
61
61
|
test_files: []
|