Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zdeveloper committed Aug 30, 2024
1 parent 4b7806d commit 075b5e0
Show file tree
Hide file tree
Showing 8 changed files with 816 additions and 77 deletions.
2 changes: 1 addition & 1 deletion OCR/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ poetry run pytest
Run benchmark tests
```shell
cd tests
poetry run pytest bench_test.py -v
poetry run pytest benchmark_test.py -v
```

poetry run pytest bench_test.py -v
Expand Down
4 changes: 2 additions & 2 deletions OCR/ocr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def main():
input_image = args["INPUT-IMAGE-PATH"]
labels_path = args["LABELS-PATH"]

segmenter = ImageSegmenter(input_image, segmentation_template, labels_path)
segments = segmenter.segment()
segmenter = ImageSegmenter()
segments = segmenter.load_and_segment(input_image, segmentation_template, labels_path)

print("{:<20} {:<20}".format("Label", "Segment shape"))
for label, segment in segments.items():
Expand Down
2 changes: 1 addition & 1 deletion OCR/ocr/services/image_segmenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ def load_and_segment(self,
print(f"raw_image shape: {raw_image.shape}")
print(f"segmentation_template shape: {segmentation_template.shape}")

self.segment(raw_image, segmentation_template, labels)
return self.segment(raw_image, segmentation_template, labels)
Binary file modified OCR/tests/assets/per_example_marked.pdf
Binary file not shown.
Loading

0 comments on commit 075b5e0

Please sign in to comment.