diff --git a/attached_assets/image_1772314526188.png b/attached_assets/image_1772314526188.png new file mode 100644 index 0000000..b8a02c6 Binary files /dev/null and b/attached_assets/image_1772314526188.png differ diff --git a/attached_assets/image_1772314568728.png b/attached_assets/image_1772314568728.png new file mode 100644 index 0000000..838d338 Binary files /dev/null and b/attached_assets/image_1772314568728.png differ diff --git a/server/focal-point.ts b/server/focal-point.ts index 00839a1..c3cde95 100644 --- a/server/focal-point.ts +++ b/server/focal-point.ts @@ -13,12 +13,15 @@ const SYSTEM_PROMPT = `You are an image analysis tool that detects where faces a Analyze the image and find the PRIMARY person or group of people. Report the CENTER of their face(s) as x,y percentages. - x=0 means far left edge, x=100 means far right edge - y=0 means very top edge, y=100 means very bottom edge -- For a person's face in the upper third, y should be around 15-35 -- For a person standing centered, x should be around 40-60 -- For a group photo, find the center of the group's faces -- Be PRECISE, do NOT default to 50,50. Actually look at where faces are. -- If there are multiple people, find the most prominent face or group center. -Return ONLY a JSON object like {"x":42,"y":28} with no other text.`; +- Think carefully: divide the image into a 10x10 grid and locate faces precisely +- For a typical portrait where a person is standing, faces are usually at y=25-40 +- For a group photo with people standing, the faces are usually at y=30-45 +- For a close-up headshot, the face center is usually at y=40-55 +- For people sitting at a table, faces are usually at y=35-50 +- Do NOT assume faces are at the very top. Faces are rarely below y=20 unless it's a very tight crop. +- Be PRECISE. Actually look at where the eyes/faces are in the image. +- If there are multiple people, find the center point of ALL their faces. +Return ONLY a JSON object like {"x":42,"y":38} with no other text.`; export async function analyzeFocalPoint(imagePath: string): Promise<{ x: number; y: number }> { const originalPath = imagePath;