Moving from matplotlib to pillow for score

This commit is contained in:
2026-03-15 23:57:14 +01:00
parent f43c296e8a
commit e703662d9e
3 changed files with 7 additions and 8 deletions
+2 -2
View File
@@ -19,6 +19,7 @@ def render_item(item):
student_id, label, content = item
pdf_path = content['pdf_path']
if not os.path.exists(pdf_path):
print("no pdf path")
return None
base_img, _, _ = annotating.make_base_image(pdf_path)
@@ -135,7 +136,7 @@ def main():
os.makedirs(bgnot_dir, exist_ok=True)
for line in lines:
labels = [l.replace(":", "").strip() for l in line.split(',') if l.strip()]
labels = [l.strip() for l in line.split(',') if l.strip()]
if not labels:
continue
@@ -154,7 +155,6 @@ def main():
annotating_with_checks.natural_key(x[0]),
annotating_with_checks.natural_key(x[1])
))
# Render images in parallel using the pre-existing lock & render function
with concurrent.futures.ThreadPoolExecutor(max_workers=2) as executor:
rendered = list(executor.map(render_item, items_to_render))