Skip to content

Commit

Permalink
OCR cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jbest committed Oct 18, 2022
1 parent e894ffb commit 1836c11
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/torch/prefect_flows/tasks/ocr.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# from https://github.com/aws-samples/amazon-textract-code-samples/blob/master/python/01-detect-text-local.py

from prefect import task
import prefect
from torch.prefect_flows.tasks.save_specimen import save_specimen
Expand All @@ -15,10 +13,8 @@

import boto3


Specimen = None


@task
def textract(specimen: Specimen, flow_config, app_config):

Expand Down Expand Up @@ -52,9 +48,9 @@ def textract(specimen: Specimen, flow_config, app_config):

# Call Amazon Textract
response = textract.detect_document_text(Document={'Bytes': imageBytes})
# Print detected text
print(response)

# Print detected text
response_json = json.dumps(response)
except Exception as e:
response_json = None
Expand Down

0 comments on commit 1836c11

Please sign in to comment.