'commit'
This commit is contained in:
@@ -84,10 +84,13 @@ class TeLaiDianCrawler(BaseCrawler):
|
||||
await self.clear_ads(d)
|
||||
|
||||
# [优化] 向下滚动以刷新/校准地理位置
|
||||
logger.info("执行下拉操作以刷新校准地理位置...")
|
||||
d.swipe_ext("down", scale=0.6)
|
||||
logger.info("等待 2 秒让位置校准生效...")
|
||||
await asyncio.sleep(2.0)
|
||||
# 使用更加显式的 swipe 方式:从屏幕 30% 划到 80%
|
||||
w, h = d.window_size()
|
||||
logger.info(f"执行显式下拉刷新操作: (x={w//2}, y1={int(h*0.3)} -> y2={int(h*0.8)})")
|
||||
d.swipe(w // 2, int(h * 0.3), w // 2, int(h * 0.8), duration=0.5)
|
||||
|
||||
logger.info("等待 2.5 秒确保位置校准和列表刷新完成...")
|
||||
await asyncio.sleep(2.5)
|
||||
|
||||
processed_count = 0
|
||||
last_md5 = None
|
||||
|
||||
@@ -267,9 +267,19 @@ class ReadImageKit:
|
||||
|
||||
final_stations = []
|
||||
if cv_bboxes and isinstance(vlm_results, list):
|
||||
img = read_image(image_path)
|
||||
h, w = img.shape[:2] if img is not None else (2400, 1080)
|
||||
y_threshold = h * 0.58
|
||||
|
||||
for i, res in enumerate(vlm_results):
|
||||
if i < len(cv_bboxes):
|
||||
bbox = cv_bboxes[i]
|
||||
# 物理坐标硬过滤:即使 CV 识别到了,y 坐标在 58% 以上的也统统干掉
|
||||
center_y = (bbox[1] + bbox[3]) // 2
|
||||
if center_y < y_threshold:
|
||||
logger.warning(f"CV 误报过滤 (y={center_y} < {y_threshold}): 可能是顶部营销卡片")
|
||||
continue
|
||||
|
||||
if res and (res.get("is_valid") is True or (res.get("name") and res.get("is_valid") is not False)):
|
||||
final_stations.append({
|
||||
"name": res.get("name"),
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user