MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / __init__

Method __init__

utils/src/multimodal.py:16–34  ·  view source on GitHub ↗

Initialize the ImageLabler. Args: presentation (Presentation): The presentation object. config (Config): The configuration object.

(self, presentation: Presentation, config: Config)

Source from the content-addressed store, hash-verified

14 """
15
16 def __init__(self, presentation: Presentation, config: Config):
17 """
18 Initialize the ImageLabler.
19
20 Args:
21 presentation (Presentation): The presentation object.
22 config (Config): The configuration object.
23 """
24 self.presentation = presentation
25 self.slide_area = presentation.slide_width.pt * presentation.slide_height.pt
26 self.image_stats = {}
27 self.stats_file = pjoin(config.RUN_DIR, "image_stats.json")
28 self.config = config
29 self.collect_images()
30 if pexists(self.stats_file):
31 image_stats: dict[str, dict] = json.load(open(self.stats_file, "r"))
32 for name, stat in image_stats.items():
33 if pbasename(name) in self.image_stats:
34 self.image_stats[pbasename(name)] = stat
35
36 def apply_stats(self):
37 """

Callers

nothing calls this directly

Calls 2

collect_imagesMethod · 0.95
loadMethod · 0.45

Tested by

no test coverage detected