当前位置: 首页 > news >正文

站长工具精品ps做网站画布多大

站长工具精品,ps做网站画布多大,黄冈网站建设哪家便宜,枣庄网站开发招聘GUI Agent 之computer use#xff1f;phone use?——多模态大语言模型的进阶之路 1.最新技术事件浅析三、思考和方案设计工具代码部分1.提示词2.工具类API定义#xff0c;这里主要看computer tool就够了 总结 本文会总结概括这一应用的利弊#xff0c;然后给出分析和工具代… GUI Agent 之computer usephone use?——多模态大语言模型的进阶之路 1.最新技术事件浅析三、思考和方案设计工具代码部分1.提示词2.工具类API定义这里主要看computer tool就够了 总结 本文会总结概括这一应用的利弊然后给出分析和工具代码部分解析以及优化方案 1.最新技术事件浅析 事件1. 2024年10月 Anthropics放出了最新的claude3.5 sonnect编码、复杂推理能力大幅提升确实很强其中最吸引人眼球的是展示了computer use的demo演示虽然很初级但是未来可期的意思。 事件2. 前后时间内智谱也发布了autoglm系列 展示了web use和phone use的演示。 “冷饭热炒”——AI Agent(LLM)RPA 实际上从2023年就一直涌现相关开源项目通过软硬件交互的RPA、自动化执行指令相关技术一直都有唯一区别多模态大语言模型能力的进化帮助了人们可以通过截屏视觉和自然语言交互来更准确执行软硬件的功能函数指令。 导致一切变化归因“大模型的能力迭代”因此不论是哪家的相关技术本质仍是多模态大语言模型起到决定性作用这一应用点取决于视觉理解屏幕信息 和 LLM决策能力Agent——主要是通过工具调用来决定执行那个操作函数如鼠标左键点击、右键点击这是一种多模态大模型 通过感知屏幕和用户提问走出思考一步步调用预定义好的指令函数来完成回答的一个过程。 快速总结 其实几个核心难点分别在于大模型思考能力特别是function call工具调用能力、截屏视觉分析能力视觉模型要进行精准的语义分析和像素坐标、需要适配操作场景中的各种软件APP的交互。 从算法层面来说其实关键问题仍旧是得有一个强大的LLM能够精准理解和执行这对模型能力要求很高目前来看几B参数的模型很难做到但是如果聚焦场景微调也不是不可行。 因此claude3.5这个demo实际上仍旧是对自己模型能力的一个宣传在评测报告中其复杂COT能力提高正是对于GUI-AGENT应用一个关键助力同理智谱也如此。 我自费一个api key用官方docker体验了下自媒体上面也有很多总体在它沙盒里面感觉还可以这里我推荐一个GIT项目——agent.exe用JS做的DEMO 试用场景和使用限制假设在模型能力达标前提下电脑低风险任务、简单明确的规则场景具体怎么理解比如说订票会给你订错、安装软件因为网络、条款等等使用问题无法识别和进行后续操作总之BAD CASE超多但是claude3.5 确实强后面需要进行每个软件适配。 三、思考和方案设计 不考虑适配问题我们的核心是AI AGENT这里的AGENT更简单加一些提示词规则和工具函数调用配置那么最终问题还是模型本身——工具调用能力和COT能力。 那么最终落到自研角度最关键的问题——首先如何拥有或者训练一个这种类似能力的模型去平替有感兴趣的朋友可以用一些开源的VL去试试我简单放了个截图给自己微调的VL-7B模型进行一个试探就想看看小模型能不能微调来适应这个场景 我们看到一般的视觉语言模型是有基础的视觉定位能力、逻辑思考能力但是还远未到标准所以要是想不通过三方实现训练微调这些函数调用、多模态视觉这个门槛是一定要迈的。 这里我测试了两种DEMO一种是按照官方DEMO DOCKER沙盒里面的系统进行操作理论上是最好的。另一种是脱离Docker容器化那么就是直接在用户系统上进行交互并且要将代码部分函数操作变成windows的函数实际上还是很不稳定比如说输入网址操作时候你的界面上有多个文本框就会识别错误更严重的是帮你执行了比较有风险的操作所以大家用时候还是要监控下还有很多AGENT的常规缺陷在过程中遇到和预期不符的结果进入更多的推理最终结果仍然无效化下面展示下官方的例子理论上也是最好的 1.我输入一个问题看是否能帮我正确执行 2.Claude 会逐步分析思考因为是基于视觉所以每次第一步都会截图去分析图标语义和像素坐标信息调用screenshot函数 3.根据截屏图像理解找到firefox根据坐标移动mouse_move函数调用 4.进行点击 5.点击火狐后模型做出了思考需要继续点进行点击地址栏再输入网址继续第一步截屏需要分析画面 哪个是地址栏 6.因为我搜索过有历史记录所以模型发现可以偷懒直接触发所以他分析了CSDN的坐标位置调用Mouse_move移动鼠标 7.继续左键点击函数调用就成功进去了 8.然后就继续思考要执行我的问题关键信息”Mixtrure-of-Depths“的问题还是每次执行前必须要进行截图 9.根据图像信息理解定位到搜索框进行输入词语查找所以继续mouse_move到搜索框坐标那里 10.同理鼠标点击 11.打印相关信息 12.执行等待返回结果 13.这里貌似漏了个截屏分析不重要继续执行鼠标移动到BOX位置 14.左键点击 15.这里应该是截屏分析最终结果 最终就是根据屏幕信息进行总结但是由于是视觉方案所以仅针对截图部分进行了理解模型本身还是赞的 PS双屏容易发生错误因为其程序只针对一个屏幕进行截屏识别 国内你要用速率受限制的那么开发是不太可能了。 非官方docker的个性化用户界面测试 直接给结论效果很差这里说一个主要原因就是 1.每个人的UI界面不一样主题颜色、界面复杂度等等这会导致claude模型出现视觉定位或者目标识别的错误 界面复杂度这个很重要如果你有大量页面打开大概率会降低截屏识别的准确性。 2.还有一种是模型的思考和视觉界面操作没有对齐 比如这种很容易发生理解和执行错误模型操作到下方Chrome了 但是这个时候我已经存在分页了点击并不会新建所以这种情况执行会无效化。 3.bad case太多了 在自己电脑上体验下就知道了 三 应用可行性思考 1.通过上述我们可以得到一个经验性结论强如claude3.5也会有着很多问题一方面是模型视觉能力和在个性化用户界面存在理解的准确性GAP即使Claude思考的基本都是对的但是视觉能力的差异导致整个操作链路崩溃。 2.操作浏览器和软件都需要经过定制化的适配因为有很多权限或者证书、网络问题 3.那么这个应用没有价值进行落地嘛 答不是恰恰就是没那么成熟所以目前业界一线巨头都要去冲这个应用利用云端大模型这种能力进行任何能联网的操作系统GUI设备的适配电脑、手机等等智谱已经释放了手机DEMO这块应用会蔓延对于个人来说我比较关心如何能够保持特定场景准确性如何使用开源VL模型平替微调 目前针对上述问题1 截屏识别优化简单分享下我的思路 1.端到端微调操作系统界面的图标进行训练适合大模型算法相关人员需要继续后训练 2.进行检测器Caption, 不需要训练大模型进行小模型堆叠增强截屏识别的准确性这点微软已经这么做了,omniparser,简单来说通过YOLO检测器训练了Windows的相关图标能够准确定位识别同时需要caption模型这样有助于大模型对图标的理解正确作为一个视觉增强插件目前结合我实际体会确实这样能Work,对于GPT4、cladue这种模型他们的文本推理能力并不差。 这种方案输出图标类型和坐标并且进行了丰富语义描述这样能帮助大模型进行正确的理解但是如果你这两小模型不行那么一样会拉垮所以这种方案输出给的目标是VLM模型还是LLM我个人觉得仍然要给VLM视觉语言模型 从实现难度上来看直接端到端训练是相对比较难的而第二种方案是风险较小的但是会增强推理开销。 我们继续思考那么这套Detectcaption的组合直接给LLM而不是VLM呢微软没提这个默认是给各种开源和闭源视觉模型从综合来看还是扔给VLM还是缺少完整的图像信息但是硬给这些文本结构化信息呢LLM也并不是不行。 工具代码部分 官方代码 其实就是Fuctionc call 冷饭,我们主要看下sys prompt和工具怎么写的 1.提示词 # System prompt adapted for Windows environment SYSTEM_PROMPT fSYSTEM_CAPABILITY * You are utilizing a Windows {platform.machine()} system with internet access. * You have access to mouse and keyboard control through PyAutoGUI. * You can perform clicks, type text, and take screenshots. * The system maintains exact monitor resolution for perfect accuracy. * Screenshots are taken at full monitor resolution and compressed only if needed. * The system properly accounts for Windows DPI scaling and taskbar position. * When using your computer function calls, they take a while to run and send back to you. Where possible/feasible, try to chain multiple of these calls all into one function calls request. * The current date is {datetime.today().strftime(%A, %B %d, %Y)}. /SYSTEM_CAPABILITYIMPORTANT * The system maintains exact screen dimensions - no resolution scaling is performed. * Screenshots are taken at full monitor resolution to maintain perfect accuracy. * Only compression is applied if needed to stay under size limits. * The system handles Windows-specific elements like taskbar and DPI scaling. * When viewing a page it can be helpful to zoom out so that you can see everything on the page. /IMPORTANTCOORDINATE_HANDLING * Coordinates are maintained at exact screen resolution. * DPI scaling is properly handled for accurate positioning. * Taskbar position is accounted for in coordinate calculations. * The system maintains perfect 1:1 pixel mapping with the screen. * Coordinate translations preserve exact screen positions. /COORDINATE_HANDLINGWindows系统信息You are utilizing a Windows {platform.machine()} system with internet access. 这里使用了platform.machine()来获取Windows系统的机器类型。 鼠标和键盘控制You have access to mouse and keyboard control through PyAutoGUI. PyAutoGUI是一个跨平台的自动化工具但在Windows环境下使用时可以进行鼠标点击、键盘输入等操作。 屏幕分辨率和DPI缩放The system maintains exact monitor resolution for perfect accuracy. 和 The system properly accounts for Windows DPI scaling and taskbar position. 这些提示说明了系统如何处理Windows特有的DPI缩放和任务栏位置。 截图和压缩Screenshots are taken at full monitor resolution and compressed only if needed. 说明了截图的处理方式特别是在Windows环境下如何处理全屏截图和压缩。 2.工具类API定义这里主要看computer tool就够了 ComputerTool这个工具可能包含了一些特定于Windows的操作例如使用PyAutoGUI进行鼠标点击、键盘输入、截图等操作。 这里贴下源码 简单来说就算计算机工具的各种操作函数和动作描述等。 import subprocess import platform import pyautogui import asyncio import base64 import os from enum import StrEnum from pathlib import Path from typing import Literal, TypedDict from uuid import uuid4from anthropic.types.beta import BetaToolComputerUse20241022Paramfrom .base import BaseAnthropicTool, ToolError, ToolResult from .run import runOUTPUT_DIR /tmp/outputsTYPING_DELAY_MS 12 TYPING_GROUP_SIZE 50Action Literal[key,type,mouse_move,left_click,left_click_drag,right_click,middle_click,double_click,screenshot,cursor_position, ]class Resolution(TypedDict):width: intheight: intMAX_SCALING_TARGETS: dict[str, Resolution] {XGA: Resolution(width1024, height768), # 4:3WXGA: Resolution(width1280, height800), # 16:10FWXGA: Resolution(width1366, height768), # ~16:9 }class ScalingSource(StrEnum):COMPUTER computerAPI apiclass ComputerToolOptions(TypedDict):display_height_px: intdisplay_width_px: intdisplay_number: int | Nonedef chunks(s: str, chunk_size: int) - list[str]:return [s[i : i chunk_size] for i in range(0, len(s), chunk_size)]class ComputerTool(BaseAnthropicTool):A tool that allows the agent to interact with the screen, keyboard, and mouse of the current computer.Adapted for Windows using pyautogui.name: Literal[computer] computerapi_type: Literal[computer_20241022] computer_20241022width: intheight: intdisplay_num: int | None_screenshot_delay 2.0_scaling_enabled Truepropertydef options(self) - ComputerToolOptions:width, height self.scale_coordinates(ScalingSource.COMPUTER, self.width, self.height)return {display_width_px: width,display_height_px: height,display_number: self.display_num,}def to_params(self) - BetaToolComputerUse20241022Param:return {name: self.name, type: self.api_type, **self.options}def __init__(self):super().__init__()# Get screen width and height using Windows commandself.width, self.height self.get_screen_size()self.display_num None# Path to cliclickself.cliclick cliclickself.key_conversion {Page_Down: pagedown, Page_Up: pageup, Super_L: win}async def __call__(self,*,action: Action,text: str | None None,coordinate: tuple[int, int] | None None,**kwargs,):if action in (mouse_move, left_click_drag):if coordinate is None:raise ToolError(fcoordinate is required for {action})if text is not None:raise ToolError(ftext is not accepted for {action})if not isinstance(coordinate, (list, tuple)) or len(coordinate) ! 2:raise ToolError(f{coordinate} must be a tuple of length 2)if not all(isinstance(i, int) and i 0 for i in coordinate):raise ToolError(f{coordinate} must be a tuple of non-negative ints)x, y self.scale_coordinates(ScalingSource.API, coordinate[0], coordinate[1])if action mouse_move:pyautogui.moveTo(x, y)return ToolResult(outputfMoved mouse to ({x}, {y}))elif action left_click_drag:current_x, current_y pyautogui.position()pyautogui.dragTo(x, y, duration0.5) # Adjust duration as neededreturn ToolResult(outputfDragged mouse from ({current_x}, {current_y}) to ({x}, {y}))if action in (key, type):if text is None:raise ToolError(ftext is required for {action})if coordinate is not None:raise ToolError(fcoordinate is not accepted for {action})if not isinstance(text, str):raise ToolError(outputf{text} must be a string)if action key:# Handle key combinationskeys text.split()for key in keys:key self.key_conversion.get(key.strip(), key.strip())pyautogui.keyDown(key) # Press down each keyfor key in reversed(keys):key self.key_conversion.get(key.strip(), key.strip())pyautogui.keyUp(key) # Release each key in reverse orderreturn ToolResult(outputfPressed keys: {text})elif action type:pyautogui.typewrite(text, intervalTYPING_DELAY_MS / 1000) # Convert ms to secondsscreenshot_base64 (await self.screenshot()).base64_imagereturn ToolResult(outputtext, base64_imagescreenshot_base64)if action in (left_click,right_click,double_click,middle_click,screenshot,cursor_position,):if text is not None:raise ToolError(ftext is not accepted for {action})if coordinate is not None:raise ToolError(fcoordinate is not accepted for {action})if action screenshot:return await self.screenshot()elif action cursor_position:x, y pyautogui.position()x, y self.scale_coordinates(ScalingSource.COMPUTER, x, y)return ToolResult(outputfX{x},Y{y})else:if action left_click:pyautogui.click()elif action right_click:pyautogui.rightClick()elif action middle_click:pyautogui.middleClick()elif action double_click:pyautogui.doubleClick()return ToolResult(outputfPerformed {action})raise ToolError(fInvalid action: {action})async def screenshot(self):Take a screenshot of the current screen and return a ToolResult with the base64 encoded image.output_dir Path(OUTPUT_DIR)output_dir.mkdir(parentsTrue, exist_okTrue)path output_dir / fscreenshot_{uuid4().hex}.png# Take screenshot using pyautoguiscreenshot pyautogui.screenshot()screenshot.save(str(path))if path.exists():# Return a ToolResult instance instead of a dictionaryreturn ToolResult(base64_imagebase64.b64encode(path.read_bytes()).decode())raise ToolError(fFailed to take screenshot: {path} does not exist.)async def shell(self, command: str, take_screenshotTrue) - ToolResult:Run a shell command and return the output, error, and optionally a screenshot._, stdout, stderr await run(command)base64_image Noneif take_screenshot:# delay to let things settle before taking a screenshotawait asyncio.sleep(self._screenshot_delay)base64_image (await self.screenshot()).base64_imagereturn ToolResult(outputstdout, errorstderr, base64_imagebase64_image)def scale_coordinates(self, source: ScalingSource, x: int, y: int):Scale coordinates to a target maximum resolution.if not self._scaling_enabled:return x, yratio self.width / self.heighttarget_dimension Nonefor dimension in MAX_SCALING_TARGETS.values():# allow some error in the aspect ratio - not ratios are exactly 16:9if abs(dimension[width] / dimension[height] - ratio) 0.02:if dimension[width] self.width:target_dimension dimensionbreakif target_dimension is None:return x, y# should be less than 1x_scaling_factor target_dimension[width] / self.widthy_scaling_factor target_dimension[height] / self.heightif source ScalingSource.API:if x self.width or y self.height:raise ToolError(fCoordinates {x}, {y} are out of bounds)# scale upreturn round(x / x_scaling_factor), round(y / y_scaling_factor)# scale downreturn round(x * x_scaling_factor), round(y * y_scaling_factor)def get_screen_size(self):if platform.system() Windows:# Command to get screen resolution on Windowscmd wmic path Win32_VideoController get CurrentHorizontalResolution,CurrentVerticalResolution /format:valueelif platform.system() Darwin: # macOScmd system_profiler SPDisplaysDataType | grep Resolutionelse: # Linux or other OScmd xrandr | grep * | awk {print $1}try:output subprocess.check_output(cmd, shellTrue).decode()if platform.system() Windows:lines output.strip().split(\n)width height Nonefor line in lines:if line.strip(): # Check for non-empty linekey, value line.split()value value.strip() # Strip whitespace from value# Assign only if value is non-empty and can be converted to intif value and key CurrentHorizontalResolution:width int(value) if value.isdigit() else Noneelif value and key CurrentVerticalResolution:height int(value) if value.isdigit() else None# After the loop, check if we have valid width and heightif width is not None and height is not None:print(fResolution: {width}x{height})else:print(Could not retrieve valid resolution values.)elif platform.system() Darwin:resolution output.split()[0]width, height map(int, resolution.split(x))else:resolution output.strip().split()[0]width, height map(int, resolution.split(x))return width, heightexcept subprocess.CalledProcessError as e:print(fError occurred: {e})return None, None # Return None or some default valuesdef get_mouse_position(self):# TODO: enhance this funcfrom AppKit import NSEventfrom Quartz import CGEventSourceCreate, kCGEventSourceStateCombinedSessionStateloc NSEvent.mouseLocation()# Adjust for different coordinate systemreturn int(loc.x), int(self.height - loc.y)def map_keys(self, text: str):Map text to cliclick key codes if necessary.# For simplicity, return text as is# Implement mapping if special keys are neededreturn text总结 当前对于自己应用难点就是你需要一个类似claude能力极强的模型并且其functioncall能力也要很强然后才可以进行自主开发模型是第一关后面可以用视觉方案增强也好再微调也好都可以更进一步当你的操作系统有N个tools怎么办呢这里实际上也有两种业内方案点赞超100 我补更。
http://www.tj-hxxt.cn/news/143323.html

相关文章:

  • 重庆信息网站推广在线作图软件
  • 广东品牌网站设计哈尔滨市营商环境建设监督局网站
  • 企业网站建站 费用梅州建站找哪家
  • 网站设计工具更好的做网站asp网站用ftp怎么替换图片
  • 网站页面怎么做企业网站cms系统论文
  • 中国企业网站设计案例宝安网页
  • 延吉 网站建设昆明网站建设一条龙服务
  • 中企动力做网站行吗东莞网站系统哪里好
  • 中国石油第一建设公司官网福建seo排名
  • 临沂建设网站公司汉中网站建设公司
  • 好的培训网站模板湖北响应式网站设计制作
  • 消防网站建设的风格合肥网站建设兼职
  • 国外 家具 网站模板下载做网站用哪个软件好
  • 建商城网站需要什么怎样做网站和网站的友情链接
  • 做网站的公司北京有哪些网络推广平台有哪些公司
  • 塘厦建设网站连云港企业做网站
  • 枣阳网站建设_枣阳山水数码wordpress 解析漏洞利用
  • 网站后台管理布局wordpress全站同一个标题
  • 百度卖货平台珠海seo网站建设
  • 成都专业的网站建设公司做效果图的网站有哪些软件
  • 中国中建设计网站wordpress邮件收不到
  • 自己优化网站淄博网站制作升级优化
  • w3c网站开发互联网营销培训课程
  • 重庆建站管理系统价格学校网站建设报价是多少
  • 网站开发公司飞沐电子政务与网站建设方面
  • 网站到期续费通知青岛高端网站制作公司
  • 公司实力 网站宁波网站排名优化公司
  • 网站流量评价有哪几方面如何建企业仢网站
  • 哪个网站可以接图纸做县网站建设检查情况汇报
  • 新手搭建网站教程视频网站群建设工作培训会