Rename NemoRetriverOCR to NemotronOCR
Browse files- README.md +2 -2
- example.py +2 -2
- nemotron-ocr/src/nemotron_ocr/inference/pipeline.py +1 -1
- quickstart.md +3 -3
README.md
CHANGED
|
@@ -212,9 +212,9 @@ Output is saved next to your input image as `<name>-annotated.<ext>` on the host
|
|
| 212 |
3. Run the model using the following code:
|
| 213 |
|
| 214 |
```python
|
| 215 |
-
from nemotron_ocr.inference.pipeline import
|
| 216 |
|
| 217 |
-
ocr =
|
| 218 |
|
| 219 |
predictions = ocr("ocr-example-input-1.png")
|
| 220 |
|
|
|
|
| 212 |
3. Run the model using the following code:
|
| 213 |
|
| 214 |
```python
|
| 215 |
+
from nemotron_ocr.inference.pipeline import NemotronOCR
|
| 216 |
|
| 217 |
+
ocr = NemotronOCR()
|
| 218 |
|
| 219 |
predictions = ocr("ocr-example-input-1.png")
|
| 220 |
|
example.py
CHANGED
|
@@ -4,11 +4,11 @@
|
|
| 4 |
|
| 5 |
import argparse
|
| 6 |
|
| 7 |
-
from nemotron_ocr.inference.pipeline import
|
| 8 |
|
| 9 |
|
| 10 |
def main(image_path, merge_level, no_visualize, model_dir):
|
| 11 |
-
ocr_pipeline =
|
| 12 |
|
| 13 |
predictions = ocr_pipeline(image_path, merge_level=merge_level, visualize=not no_visualize)
|
| 14 |
|
|
|
|
| 4 |
|
| 5 |
import argparse
|
| 6 |
|
| 7 |
+
from nemotron_ocr.inference.pipeline import NemotronOCR
|
| 8 |
|
| 9 |
|
| 10 |
def main(image_path, merge_level, no_visualize, model_dir):
|
| 11 |
+
ocr_pipeline = NemotronOCR()
|
| 12 |
|
| 13 |
predictions = ocr_pipeline(image_path, merge_level=merge_level, visualize=not no_visualize)
|
| 14 |
|
nemotron-ocr/src/nemotron_ocr/inference/pipeline.py
CHANGED
|
@@ -37,7 +37,7 @@ MERGE_LEVELS = {"word", "sentence", "paragraph"}
|
|
| 37 |
DEFAULT_MERGE_LEVEL = "paragraph"
|
| 38 |
|
| 39 |
|
| 40 |
-
class
|
| 41 |
"""
|
| 42 |
A high-level pipeline for performing OCR on images.
|
| 43 |
"""
|
|
|
|
| 37 |
DEFAULT_MERGE_LEVEL = "paragraph"
|
| 38 |
|
| 39 |
|
| 40 |
+
class NemotronOCR:
|
| 41 |
"""
|
| 42 |
A high-level pipeline for performing OCR on images.
|
| 43 |
"""
|
quickstart.md
CHANGED
|
@@ -29,12 +29,12 @@ uv run python -c "import nemotron_ocr; import nemotron_ocr_cpp"
|
|
| 29 |
|
| 30 |
## Usage
|
| 31 |
|
| 32 |
-
`nemotron_ocr.inference.pipeline.
|
| 33 |
|
| 34 |
```python
|
| 35 |
-
from nemotron_ocr.inference.pipeline import
|
| 36 |
|
| 37 |
-
ocr =
|
| 38 |
|
| 39 |
predictions = ocr("ocr-example-input-1.png")
|
| 40 |
|
|
|
|
| 29 |
|
| 30 |
## Usage
|
| 31 |
|
| 32 |
+
`nemotron_ocr.inference.pipeline.NemotronOCR` is the main entry point for performing OCR inference; it can be used to iterate over predictions for a given input image:
|
| 33 |
|
| 34 |
```python
|
| 35 |
+
from nemotron_ocr.inference.pipeline import NemotronOCR
|
| 36 |
|
| 37 |
+
ocr = NemotronOCR()
|
| 38 |
|
| 39 |
predictions = ocr("ocr-example-input-1.png")
|
| 40 |
|