@@ -44,9 +44,13 @@ def render_scene(record: dict[str, Any], output_path: Path, image_size: int = 22
|
||||
for index in range(10):
|
||||
current_radius = radius if index % 2 == 0 else radius * 0.45
|
||||
angle = -math.pi / 2 + index * math.pi / 5
|
||||
points.append((x + current_radius * math.cos(angle), y + current_radius * math.sin(angle)))
|
||||
points.append(
|
||||
(
|
||||
x + current_radius * math.cos(angle),
|
||||
y + current_radius * math.sin(angle),
|
||||
)
|
||||
)
|
||||
draw.polygon(points, fill=color, outline=(20, 20, 20))
|
||||
draw.text((x - radius, y + radius + int(4 * scale)), item["object_id"], fill=(20, 20, 20))
|
||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
image.save(output_path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user