33 lines
960 B
Python
33 lines
960 B
Python
|
|
|
||
|
|
import asyncio
|
||
|
|
import os
|
||
|
|
import sys
|
||
|
|
|
||
|
|
# 将项目根目录添加到 sys.path
|
||
|
|
project_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||
|
|
if project_root not in sys.path:
|
||
|
|
sys.path.append(project_root)
|
||
|
|
|
||
|
|
from Apps.XinDianTu.ReadImageKit import ReadImageKit
|
||
|
|
|
||
|
|
async def verify_vl_ad_check():
|
||
|
|
target_path = r"d:\dsWork\aiData\Output\Screenshot_20260112_215026.jpg"
|
||
|
|
|
||
|
|
if not os.path.exists(target_path):
|
||
|
|
print(f"Target not found: {target_path}")
|
||
|
|
return
|
||
|
|
|
||
|
|
print("Checking for ads using VL model...")
|
||
|
|
# Mock device info for verification script
|
||
|
|
device_info = {"displayWidth": 1080, "displayHeight": 2244}
|
||
|
|
|
||
|
|
res = await ReadImageKit.detect_ad_popup(target_path, device_info=device_info)
|
||
|
|
|
||
|
|
if res:
|
||
|
|
print(f"SUCCESS: Ad detected! Close button at ({res['x']}, {res['y']})")
|
||
|
|
else:
|
||
|
|
print("No ad detected.")
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
asyncio.run(verify_vl_ad_check())
|