Initial Persp generation
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user