'commit'
This commit is contained in:
@@ -77,6 +77,29 @@ class ReadImageKit:
|
||||
logger.error(f"分析电价详情失败: {e}")
|
||||
return []
|
||||
|
||||
async def analyze_detail_basic_info(self, image_path):
|
||||
"""
|
||||
分析详情页首屏截图,提取场站名称和精确地址
|
||||
"""
|
||||
prompt = """
|
||||
分析这张充电站详情页首屏截图,提取:
|
||||
1. 场站名称 (通常在页面中部,大字体)
|
||||
2. 详细地址 (通常在名称下方或页面下半部分,伴有地址图标)
|
||||
|
||||
输出格式为 JSON:
|
||||
{
|
||||
"name": "xxx充电站",
|
||||
"address": "xxx省xxx市xxx区xxx路xxx号"
|
||||
}
|
||||
"""
|
||||
try:
|
||||
res_text = await self.vlm.analyze_image(image_path, prompt)
|
||||
json_str = self.vlm.extract_json(res_text)
|
||||
return json.loads(json_str)
|
||||
except Exception as e:
|
||||
logger.error(f"分析详情页基础信息失败: {e}")
|
||||
return {}
|
||||
|
||||
async def analyze_station_list(self, image_path):
|
||||
"""
|
||||
分析场站列表页图片,提取场站位置和基本信息
|
||||
|
||||
Reference in New Issue
Block a user