Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write tests #4

Open
junhoyeo opened this issue Oct 29, 2023 · 0 comments
Open

Write tests #4

junhoyeo opened this issue Oct 29, 2023 · 0 comments

Comments

@junhoyeo
Copy link
Owner

junhoyeo commented Oct 29, 2023

  • Start by writing unit tests for https://github.com/junhoyeo/BetterOCR/blob/main/betterocr/parsers.py
  • And also
    for idx, item in enumerate(items):
    box = item["box"]
    # [x,y,w,h]
    if len(box) == 4 and isinstance(box[0], int):
    rect = rectangle_corners(box)
    items[idx]["box"] = rect
    # [[x,y],[w,h]]
    elif len(box) == 2 and isinstance(box[0], list) and len(box[0]) == 2:
    flattened = [i for sublist in box for i in sublist]
    rect = rectangle_corners(flattened)
    items[idx]["box"] = rect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant