mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
complete refactor javascript to typescript and reorg frontend files and folders
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
# VQA Detection Utilities
|
||||
# Parsing, formatting, and drawing functions for detection results (points, bboxes, gaze)
|
||||
|
||||
import os
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from modules import shared
|
||||
from modules.paths import script_path
|
||||
|
||||
|
||||
def parse_points(result) -> list:
|
||||
@@ -311,7 +313,7 @@ def draw_bounding_boxes(image: Image.Image, detections: list, points: list | Non
|
||||
# Try to load a font, fall back to default if unavailable
|
||||
try:
|
||||
font_size = max(12, int(min(width, height) * 0.02))
|
||||
font_path = shared.opts.font or "javascript/notosans-nerdfont-regular.ttf"
|
||||
font_path = shared.opts.font or os.path.join(script_path, "ui", "fonts", "notosans-nerdfont-regular.ttf")
|
||||
font = ImageFont.truetype(font_path, size=font_size)
|
||||
except Exception:
|
||||
font = ImageFont.load_default()
|
||||
|
||||
Reference in New Issue
Block a user