Merge branch 'dev' into pre_release

This commit is contained in:
三洋三洋
2024-04-21 13:14:49 +00:00
4 changed files with 15 additions and 22 deletions

View File

@@ -1,7 +1,8 @@
import os
from pathlib import Path
from PIL import Image, ImageDraw
from typing import List
from pathlib import Path
class Point:
@@ -68,7 +69,6 @@ def draw_bboxes(img: Image.Image, bboxes: List[Bbox], name="annotated_image.png"
curr_work_dir = Path(os.getcwd())
log_dir = curr_work_dir / "logs"
log_dir.mkdir(exist_ok=True)
drawer = ImageDraw.Draw(img)
for bbox in bboxes:
# Calculate the coordinates for the rectangle to be drawn
@@ -88,4 +88,4 @@ def draw_bboxes(img: Image.Image, bboxes: List[Bbox], name="annotated_image.png"
drawer.text((left, bottom - 10), bbox.content[:10], fill="red")
# Save the image with drawn rectangles
img.save(name)
img.save(log_dir / name)

View File

@@ -51,6 +51,7 @@ def change(input_str, old_inst, new_inst, old_surr_l, old_surr_r, new_surr_l, ne
i = start + 1
continue
else:
result += input_str[i:start]
i = start
if old_inst != new_inst and old_inst in result: