qqwjq1981 commited on
Commit
41d633f
·
verified ·
1 Parent(s): 8b00075

Update utils/image_utils.py

Browse files
Files changed (1) hide show
  1. utils/image_utils.py +1 -19
utils/image_utils.py CHANGED
@@ -20,22 +20,4 @@ def encode_image_to_html(image: Image.Image) -> str:
20
  <div style="height:500px; overflow-y:auto; border:1px solid #ccc;">
21
  <img src="data:image/png;base64,{encoded}" style="width:100%;" />
22
  </div>
23
- """
24
-
25
- def render_translated_chunk(image: Image.Image, translations, debug_color="green"):
26
- img = image.copy()
27
- draw = ImageDraw.Draw(img)
28
- font = ImageFont.truetype("NotoSansSC-Regular.ttf", size=16)
29
-
30
- for t in translations:
31
- # Debug polygon outline in green
32
- draw.line(t["polygon"] + [t["polygon"][0]], fill=debug_color, width=2)
33
-
34
- # Optional: fill inside polygon with white if needed
35
- # draw.polygon(t["polygon"], fill="white")
36
-
37
- # Draw translated text at first point
38
- x, y = t["polygon"][0]
39
- draw.text((x, y), t["translated"], fill="black", font=font)
40
-
41
- return img
 
20
  <div style="height:500px; overflow-y:auto; border:1px solid #ccc;">
21
  <img src="data:image/png;base64,{encoded}" style="width:100%;" />
22
  </div>
23
+ """