Initial Persp generation

This commit is contained in:
2026-07-11 20:30:27 +02:00
parent fd35675e4c
commit 09befe1d55
4 changed files with 175 additions and 14 deletions
+5 -4
View File
@@ -9,14 +9,15 @@ import threading
import annotating
from utils import natural_key, pdf_image_of_enonce, pdf_image_of_solution
from utils import natural_key, pdf_image_of_enonce, pdf_image_of_solution, pdf_images_of_contexts
from reading_annotations import detect_checks_and_notes, has_significant_notes
def get_extra_pdfs_as_images(root_dir, label, annotating_module):
def get_extra_pdfs_as_images(root_dir, label, annotating_module, all_labels):
"""Fetches Text and Sol pdfs for a given label and converts them to images."""
extra_images = []
a, b = pdf_image_of_enonce(root_dir, label), pdf_image_of_solution(root_dir, label)
for c in [a, b]:
e = pdf_images_of_contexts(root_dir, label, all_labels)
for c in e + [a, b]:
if c:
img, _, _ = annotating_module.make_base_image(c)
if img:
@@ -239,7 +240,7 @@ def apply_actions_and_regenerate_grouped(root_dir, data, student_id,
perfect_no_comment = False
if not perfect_no_comment or has_notes:
extras = get_extra_pdfs_as_images(root_dir, label, annotating)
extras = get_extra_pdfs_as_images(root_dir, label, annotating, all_labels)
extras.append(final_img)
concat_list_F.append(extras)