kevinlu1248 / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
Apache License 2.0
0 stars 0 forks source link

Refactor e2e_eval function for modularity #4

Closed sweep-nightly[bot] closed 10 months ago

sweep-nightly[bot] commented 10 months ago

Description

This PR refactors the e2e_eval function in tools/end2end/eval_end2end.py to improve its modularity. The function was previously quite large and performed multiple tasks, making it difficult to understand and maintain. The changes in this PR break down the e2e_eval function into smaller, more manageable functions, each performing a specific task.

Summary of Changes

  1. Extracted the part of the e2e_eval function that calculates the Intersection over Union (IoU) into a new function named calculate_iou.
  2. Extracted the part of the e2e_eval function that calculates the edit distance into a new function named calculate_edit_distance.
  3. Extracted the part of the e2e_eval function that calculates the precision, recall, and f-measure into a new function named calculate_metrics.
  4. Extracted the part of the e2e_eval function that calculates the average edit distance per image and per field into a new function named calculate_avg_edit_distance.

These changes make the e2e_eval function easier to understand and maintain, and allow for better testing and reuse of the individual tasks performed by the function.

Fixes #1.


🎉 Latest improvements to Sweep:


💡 To get Sweep to edit this pull request, you can:

sweep-nightly[bot] commented 10 months ago

Sandbox Executions

sweep-nightly[bot] commented 10 months ago

Apply Sweep Rules to your PR?