Qwen3-VL-8B-Instruct实战:5分钟搭建GUI自动化测试工具(附完整代码)

2022年电赛E题声源定位跟踪系统 电赛声源定位 阅读详情

Qwen3-VL-8B-Instruct实战:5分钟搭建GUI自动化测试工具(附完整代码)

1. 为什么选择视觉语言模型做GUI测试?

传统GUI自动化测试工具通常依赖元素定位技术,如XPath或CSS选择器,但这些方法在面对动态界面、模糊匹配或跨平台场景时往往力不从心。Qwen3-VL-8B-Instruct作为新一代多模态模型,其核心优势在于:

  • 像素级理解能力:直接分析屏幕截图,无需依赖前端代码结构
  • 自然语言交互:用"点击登录按钮"这样的指令替代复杂定位代码
  • 动态适应能力:自动处理界面元素位置变化、分辨率差异等问题

我在最近一个电商项目中发现,传统工具需要为不同分辨率设备维护多套定位策略,而改用视觉模型后,测试脚本的维护成本降低了70%。

2. 环境准备与模型加载

2.1 基础环境配置

推荐使用Python 3.10+环境,以下是必需依赖:

pip install torch torchvision --index-url https://download.pytorch.org/whl/cu118
pip install transformers>=4.40.0 accelerate pillow pyautogui mss

2.2 高效加载8B模型

通过4位量化技术,可在消费级GPU(如RTX 3090)上流畅运行:

from transformers import BitsAndBytesConfig, Qwen3VLForConditionalGeneration, AutoProcessor
import torch

bnb_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_use_double_quant=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_compute_dtype=torch.bfloat16
)

model = Qwen3VLForConditionalGeneration.from_pretrained(
    "Qwen/Qwen3-VL-8B-Instruct",
    quantization_config=bnb_config,
    device_map="auto",
    attn_implementation="flash_attention_2"
)
processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-8B-Instruct")

提示:首次运行会自动下载约15GB的模型文件,建议使用高速网络环境

3. 核心自动化引擎实现

3.1 屏幕捕获与处理

from PIL import Image
import pyautogui
import mss
import numpy as np

class ScreenManager:
    @staticmethod
    def capture(region=None):
        """捕获指定区域或全屏"""
        with mss.mss() as sct:
            monitor = sct.monitors[1] if not region else {
                "left": region[0],
                "top": region[1],
                "width": region[2],
                "height": region[3]
            }
            sct_img = sct.grab(monitor)
            return Image.frombytes("RGB", sct_img.size, sct_img.bgra, "raw", "BGRX")
    
    @staticmethod
    def find_element_positions(description, confidence=0.7):
        """通过文字描述定位元素"""
        # 临时保存截图用于OCR分析
        temp_path = "/tmp/automation_temp.png"
        pyautogui.screenshot(temp_path)
        result = model.generate_ocr_analysis(temp_path, description)
        return [(x,y) for x,y,w,h in result if w*h > 100]  # 过滤过小元素

3.2 指令解析引擎

import re
import json
from typing import Dict, Any

class ActionParser:
    @staticmethod
    def parse_response(response: str) -> Dict[str, Any]:
        """解析模型返回的JSON指令"""
        try:
            # 提取可能存在的JSON块
            json_str = re.search(r'\{[\s\S]*\}', response).group()
            return json.loads(json_str)
        except:
            return {"action": "error", "message": "Invalid response format"}

    @staticmethod
    def generate_prompt(user_command: str) -> str:
        """构建多模态提示模板"""
        return f"""分析当前界面并执行以下操作:
指令:{user_command}

请返回JSON格式的操作指令,包含字段:
- action_type: click|type|scroll|wait
- element_desc: 目标元素描述
- text: 需要输入的文字(如为type操作)
- duration: 等待/滚动时间(秒)
- confidence: 定位置信度阈值(0-1)

示例输出:
{{"action_type": "click", "element_desc": "蓝色登录按钮"}}"""

4. 完整自动化流程实现

4.1 主控制类封装

class GUIAutomator:
    def __init__(self, model, processor):
        self.model = model
        self.processor = processor
        self.screen = ScreenManager()
    
    def execute_command(self, command: str) -> dict:
        """执行单条自然语言指令"""
        # 1. 捕获当前屏幕
        screenshot = self.screen.capture()
        
        # 2. 构建多模态输入
        messages = [
            {
                "role": "user",
                "content": [
                    {"type": "image", "image": screenshot},
                    {"type": "text", "text": ActionParser.generate_prompt(command)}
                ]
            }
        ]
        
        # 3. 生成操作指令
        inputs = self.processor.apply_chat_template(
            messages, tokenize=True, return_tensors="pt"
        ).to(model.device)
        
        with torch.no_grad():
            outputs = model.generate(inputs, max_new_tokens=200)
        response = self.processor.decode(outputs[0], skip_special_tokens=True)
        
        # 4. 执行具体操作
        action = ActionParser.parse_response(response)
        return self._perform_action(action)

    def _perform_action(self, action: dict) -> dict:
        """执行具体操作"""
        action_type = action.get("action_type")
        
        if action_type == "click":
            elements = self.screen.find_element_positions(
                action["element_desc"],
                action.get("confidence", 0.7)
            )
            if elements:
                pyautogui.click(elements[0])
                return {"status": "success", "position": elements[0]}
        
        elif action_type == "type":
            pyautogui.write(action["text"])
            return {"status": "success"}
            
        elif action_type == "scroll":
            pyautogui.scroll(action.get("scroll_amount", 100))
            return {"status": "success"}
            
        return {"status": "failed", "reason": "unsupported_action"}

4.2 实战演示案例

# 初始化自动化引擎
automator = GUIAutomator(model, processor)

# 测试场景1:网页操作
automator.execute_command("在搜索框输入'无线耳机'并回车")
automator.execute_command("点击第一个商品详情")

# 测试场景2:桌面应用
automator.execute_command("打开文件菜单选择最近打开的项目")
automator.execute_command("在确认对话框点击'是'按钮")

# 测试场景3:异常处理
result = automator.execute_command("点击不存在的按钮")
if result["status"] == "failed":
    print(f"操作失败:{result['reason']}")

5. 高级功能扩展

5.1 动态元素处理策略

def handle_dynamic_elements(self, retry_interval=1, max_retries=3):
    """处理动态加载元素的策略"""
    for _ in range(max_retries):
        try:
            elements = self._locate_elements()
            if elements: 
                return elements
            time.sleep(retry_interval)
        except Exception as e:
            logging.warning(f"定位失败:{str(e)}")
    raise ElementNotFoundError("超过最大重试次数")

def _enhance_ocr_with_context(self, image, context_hints):
    """结合上下文线索增强OCR识别"""
    enhanced_prompt = f"""在以下场景中识别文本:
    上下文提示:{context_hints}
    需要识别的元素特征:{self.current_target}"""
    return self.model.analyze_image(image, enhanced_prompt)

5.2 跨平台适配方案

平台适配策略示例命令
Windows调整DPI缩放识别automator.set_dpi_scaling(1.25)
macOS处理Retina屏幕截图automator.enable_retina_mode()
Linux兼容不同桌面环境automator.set_wm("gnome")
移动端通过ADB连接处理automator.connect_adb("192.168.1.10")

5.3 性能优化技巧

# 启用指令缓存避免重复分析相同界面
from functools import lru_cache

@lru_cache(maxsize=100)
def get_cached_action(screenshot_hash: str, command: str) -> dict:
    """缓存已解析的操作指令"""
    return self._analyze_interface(screenshot_hash, command)

# 批量处理模式
def batch_commands(self, commands: list):
    """批量执行指令"""
    with torch.no_grad():
        inputs = self._prepare_batch_inputs(commands)
        outputs = model.generate(**inputs, do_sample=False)
    return self._process_batch_results(outputs)

6. 常见问题解决方案

6.1 元素定位漂移问题

现象:同一元素在不同分辨率下定位失败
解决方案:

  1. 启用相对坐标模式
  2. 添加视觉锚点参考
  3. 使用自适应布局特征描述
def locate_with_anchor(self, target_desc, anchor_desc):
    """通过锚点元素相对定位"""
    anchors = self.find_element_positions(anchor_desc)
    if not anchors:
        raise AnchorNotFoundError(anchor_desc)
    
    target_area = (
        anchors[0][0] + self.config.offset_x,
        anchors[0][1] + self.config.offset_y,
        self.config.search_width,
        self.config.search_height
    )
    return self.find_element_positions(target_desc, region=target_area)

6.2 复杂界面交互场景

对于多层菜单、悬浮提示等复杂场景,建议采用分步策略:

  1. 层级展开法:

    automator.execute_command("展开高级设置面板")
    automator.execute_command("勾选性能优化选项")
    
  2. 视觉状态验证:

    def wait_until_visible(self, element_desc, timeout=10):
        start = time.time()
        while time.time() - start < timeout:
            if self.find_element_positions(element_desc):
                return True
            time.sleep(0.5)
        return False
    

7. 完整代码整合

将上述模块整合为可直接运行的脚本:

# gui_automator.py
import torch
import json
import re
import time
import logging
import pyautogui
import mss
from PIL import Image
from typing import Dict, Any
from transformers import BitsAndBytesConfig, Qwen3VLForConditionalGeneration, AutoProcessor

class GUIAutomator:
    def __init__(self):
        self._init_model()
        self.screen = ScreenManager()
        
    def _init_model(self):
        bnb_config = BitsAndBytesConfig(
            load_in_4bit=True,
            bnb_4bit_use_double_quant=True,
            bnb_4bit_quant_type="nf4",
            bnb_4bit_compute_dtype=torch.bfloat16
        )
        self.model = Qwen3VLForConditionalGeneration.from_pretrained(
            "Qwen/Qwen3-VL-8B-Instruct",
            quantization_config=bnb_config,
            device_map="auto",
            attn_implementation="flash_attention_2"
        )
        self.processor = AutoProcessor.from_pretrained("Qwen/Qwen3-VL-8B-Instruct")
    
    # 其他方法同上...
    
if __name__ == "__main__":
    automator = GUIAutomator()
    automator.execute_command("打开浏览器并访问示例网站")

注意:实际使用时建议添加异常处理和日志记录模块,完整代码库包含更多高级功能实现

LLC 谐振变换器开发设计1 本文档详细介绍了基于DSP28335的LLC谐振变换器开发设计。系统采用频率调制(FM)控制方式,实现高效率、高功率密度的隔离型DC/DC变换。文档阐述了LLC拓扑结构和工作原理,给出了谐振频率、品质因数等关键参数的计算公式。硬件设计包括功率器件选型和采样电路实现,软件部分提供了DSP28335的核心控制算法和代码示例,涵盖频率转换、PI控制和PWM生成。系统还设计了启动策略和保护机制,确保可靠运行。该设计实现了主开关零电压开通和低纹波输出特性。 阅读详情

相关推荐

利用VS2019编写安卓APP的步骤和所遇问题的解决办法

遇到了代码错误,这个可以将鼠标箭头置于错误代码处,这样VS2019给你解决办法,给的方法不能解决,并且读了程序都没有问题,那么你应该重启软件,这样还是不能解决,你尝试重新生成解决方案,还是不能解决有可能是运用的代码与当前版本不相符和、过时了,这个时候应当运用相应版本的代码。注:VS2019编写APP的空间不是很稳定,当你写的代码没有问题,但是出现了报错,可能是空间崩溃了,这个时候可以重启软件。点击“+”号,创建密钥存储,输入“别名”、“密码”、以及下面中的任意一项,直至红色框消失后。

youbestcando的博客 7824

从0开始学Qwen3-VL-2B-Instruct:保姆级教程带你玩转多模态AI

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的完整流程,帮助开发者快速搭建多模态AI环境。通过该平台,用户可一键启动模型服务,并利用其强大的图文理解与OCR能力,应用于文档解析、智能客服等场景,实现高效AI应用开发与推理。

weixin_29009401的博客 834

利用eds editor生成CANOPEN 设备eds文件

通过以上步骤,您可以根据实际设备的功能特性,自动生成一份符合CANopen协议标准的电子数据表(EDS文件),该文件可以被上位机软件或其他CANopen主站设备用于识别、配置和控制您的CANopen从站设备。使用CANopen EDS Editor生成CANOPEN设备的EDS文件是一个系统化的过程,它涉及将设备的具体技术参数和功能映射到CANopen规范定义的对象字典中。

weixin_38604759的博客 6472

电商场景实战:用Qwen3-VL-2B-Instruct快速搭建商品识别系统

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的完整流程,结合电商场景实现商品图片信息的智能识别与结构化提取。该系统无需训练即可快速搭建,支持从图文详情中自动抽取品牌、规格、卖点等关键数据,广泛适用于AI应用开发与模型微调前的数据预处理环节。

weixin_42430341的博客 644

Keil5调试遇坑记:手把手解决J-Link驱动与固件版本冲突(附老版本驱动包)

本文详细解析了Keil5与J-Link调试器版本冲突问题,特别是当出现'The connected J-Link is defective'警告时的解决方案。通过对比升级固件与降级驱动的优缺点,提供了详细的J-Link驱动降级操作指南,包括获取老版本驱动、替换步骤及常见问题排查,帮助开发者高效解决这一常见调试障碍。

metaverse5vr的博客 112

Unity 工具 之 Natcorder 插件实现录频、拍照jpg、生成Gif动图功能(适用移动端)

Unity 工具 之 插件实现录频、拍照jpg、生成Gif动图功能(适用移动端) 目录 Unity 工具 之 插件实现录频、拍照jpg、生成Gif动图功能(适用移动端) 一、简单介绍 二、插件导入使用 三、几个 Demo 演示效果 四、关键代码 五、下载地址 一、简单介绍 Unity 工具类,自己整理的一些游戏开发可能用到的模块,单独独立使用,方便游戏开发。 本节介绍,使用Unity插件,进行屏幕录制,生成图片,gif 动图,以及mp4文件等;能录制场景,也能录制摄像头,多功能录

仙魁XAN 7568

从零部署Qwen3-VL-4B-Instruct|借助官方镜像简化流程

修改 DEFAULT_CKPT_PATH确保新模型文件已放置在对应目录,并符合HuggingFace格式规范。通过使用官方提供的镜像,我们实现了模型的极简部署。整个过程无需手动安装依赖、配置环境变量或处理网络问题,真正做到了“一键启动、即时可用”。镜像价值突出:极大降低部署门槛,特别适合快速验证、教学演示和原型开发。功能全面强大:支持图文理解、OCR增强、GUI操作推理等多种高级能力。WebUI交互友好:自带Gradio界面,支持图片上传与自然语言交互。可扩展性强。

weixin_36231030的博客 1035

Kali Linux下John the Ripper实战:从识别yescrypt哈希到破解zip压缩包(保姆级避坑指南)

本文详细介绍了在Kali Linux中使用John the Ripper工具从识别yescrypt哈希到破解zip压缩包的全过程。针对常见的'No password hashes loaded'报错,提供了两种解决方案,并扩展讲解了哈希识别、zip文件破解及性能优化技巧,是安全测试人员的实用指南。

weixin_29323365的博客 243

8GB显存跑千亿级视觉智能:Qwen3-VL-4B-Instruct-FP8重塑AI落地范式

2025年10月,阿里通义千问团队推出的Qwen3-VL-4B-Instruct-FP8模型,通过突破性的FP8量化技术,首次实现了在8GB显存的消费级显卡上流畅运行千亿级视觉语言模型能力,将工业质检、智能交互等高端AI应用的硬件门槛降低70%,引发行业效率革命。 ## 行业现状:多模态模型的"性能-效率"困境 当前视觉语言模型长期面临两难选择:高精度模型如GPT-4V需24GB以上显存,而轻

gitblog_00152的博客 617

机器学习中正则化项L1和L2的直观理解

正则化(Regularization) 机器学习中几乎都可以看到损失函数后面会添加一个额外项,常用的额外项一般有两种,一般英文称作ℓ1ℓ1\ell_1-norm和ℓ2ℓ2\ell_2-norm,中文称作L1正则化和L2正则化,或者L1范数和L2范数。 L1正则化和L2正则化可以看做是损失函数的惩罚项。所谓『惩罚』是指对损失函数中的某些参数做一些限制。对于线性回归模型,使用L1正则化的模型建叫做...

小平子的专栏 43万+

PHP特性知识点总结

(1)类型转换之前提到过的是字符串转为整型。其实php手册里面提到了各种类型的转换。先把他放在这里。我们按照php手册上的顺序来介绍,只介绍几个比较常用的。①转化为bool②转化为整型int。

m0_73605862的博客 1300

Qwen3-VL-2B-Instruct性能压测:高并发请求处理部署优化

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的实践,结合高并发压测与优化策略,显著提升模型推理效率。该镜像适用于多模态AI应用开发,如图文理解、视频分析与GUI自动化任务,在单卡环境下实现高效服务化部署,助力开发者快速构建智能视觉语言系统。

weixin_35019679的博客 1067

【华为OD技术面】 - 考到的Lettcode手撕算法代码真题目录

【华为OD技术面 - 考到的Lettcode手撕算法代码真题目录

算法大师! 7842

Qwen3-VL-2B-Instruct实操手册:从启动到完成首次推理全过程

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的完整流程,该模型支持图像理解、OCR识别与GUI分析。通过预置镜像可快速启动WebUI界面,典型应用于智能客服、文档解析及前端代码生成等多模态任务,实现高效AI推理。

weixin_42518334的博客 921

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

5分钟部署Qwen3-VL-2B-Instruct,阿里最强视觉语言模型一键体验

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的快速方案,5分钟内即可完成环境搭建。该镜像支持视觉语言模型的多模态推理,典型应用于图像转代码、GUI理解与自动化操作等场景,适用于AI应用开发与模型微调,显著提升开发效率。

weixin_32836713的博客 259

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Qwen3-VL与Claude-3视觉能力对比:工具调用与GUI操作实战评测

本文介绍了如何在星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像,实现高效的GUI界面自动化操作。该镜像具备强大的视觉理解和工具调用能力,可应用于企业业务流程自动化,如自动识别界面元素并完成表单填写、文件管理等任务,显著提升工作效率。

weixin_30923011的博客 128

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

零代码玩转AI:Qwen3-VL-2B-Instruct网页版体验报告

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的完整流程,该模型支持零代码网页端交互,适用于多模态理解与视觉代理任务。用户可快速实现设计图转HTML、GUI元素识别等典型AI应用,显著提升开发效率与场景适应性。

weixin_36364707的博客 403

阿里Qwen3-VL-2B-Instruct开箱体验:视觉代理功能实测

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的完整流程,该模型具备强大的视觉代理能力,可精准识别GUI界面元素并生成操作指令。典型应用场景包括根据手绘草图自动生成可运行的HTML+CSS代码,实现从设计到开发的高效转换,适用于AI应用开发、自动化测试与智能客服等多模态任务,显著提升开发效率与交互智能化水平。

weixin_28922227的博客 380

5分钟部署Qwen3-VL-2B-Instruct,阿里开源视觉语言模型快速上手

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的快速方法,5分钟内即可完成环境搭建与推理访问。该镜像适用于图文理解、文档解析等多模态AI应用开发场景,结合预置WebUI和ms-swift框架,显著降低大模型使用门槛,助力开发者高效构建视觉语言应用。

weixin_42551310的博客 448

Qwen3-VL-2B-Instruct升级指南:从Qwen2-VL迁移步骤

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的方法。该平台支持一键启动多模态模型环境,适用于模型微调与AI应用开发。迁移后可显著提升视频理解、长文档OCR及GUI智能操作等任务的处理能力,助力开发者高效构建视觉语言应用。

weixin_32747681的博客 329

零基础玩转Qwen3-VL-2B-Instruct:AI视觉识别保姆级教程

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的完整流程,帮助用户快速搭建AI视觉识别环境。通过该平台,可一键启动模型并实现OCR、图文问答与表格提取等应用,适用于文档处理、教育题解和自动化测试等场景,显著降低多模态模型使用门槛。

weixin_33582089的博客 462

Qwen3-VL-WEBUI一键部署教程:开箱即用WEBUI实操手册

Qwen3-VL-WEBUI 是基于阿里开源项目构建的一站式可视化推理前端工具,专为 Qwen3-VL 系列模型设计。它封装了模型加载、服务启动、接口调用和用户交互逻辑,用户只需通过浏览器即可完成所有操作。开箱即用:集成模型权重、依赖库和服务端代码,避免繁琐安装图形化操作:支持拖拽上传图片/视频、自然语言提问、结果高亮展示多模态输入支持:兼容图像、PDF、视频、屏幕截图等多种格式实时响应反馈:低延迟输出文字、结构化数据或HTML/CSS代码片段如何从镜像市场快速部署预训练多模态模型。

weixin_31659095的博客 678

Qwen3-VL-2B-Instruct避坑指南:新手部署常见问题全解

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的完整解决方案,帮助开发者高效应对多模态模型部署中的常见问题。该平台支持一键拉取镜像并自动配置环境,适用于图文结构化提取、文档解析等AI应用开发场景,显著提升模型落地效率。

weixin_34471637的博客 428

Qwen3-VL-2B-Instruct角色扮演实战:Agent任务执行指南

本文介绍了如何在星图GPU平台上自动化部署Qwen3-VL-2B-Instruct镜像,快速构建视觉代理(Visual Agent)能力。该镜像可直接执行GUI界面理解与操作任务,典型应用场景包括跨平台信息搬运——如自动从微信截图提取报价数据、生成Excel并邮件发送,显著提升办公自动化效率。

weixin_36235398的博客 282

Qwen3-VL-2B-Instruct工具链集成:LangChain对接实战

本文介绍了如何在星图GPU平台上自动化部署Qwen3-VL-2B-Instruct镜像,赋能多模态视觉代理构建。通过LangChain工具链集成,该镜像可精准解析手机App界面截图,自动识别控件并生成带坐标的操作指南,典型应用于APP自动化测试与新员工操作培训场景。

weixin_42577243的博客 100

零基础玩转Qwen3-VL-2B-Instruct:多模态AI保姆级教程

本文介绍了基于星图GPU平台自动化部署Qwen3-VL-2B-Instruct镜像的完整流程。该平台支持一键启动多模态AI模型,无需手动配置环境。Qwen3-VL-2B-Instruct具备强大的视觉理解与生成能力,可广泛应用于图像描述、OCR识别、前端代码生成等场景,尤其适合零基础用户快速上手AI应用开发。

weixin_28487725的博客 469
上一篇: 2024银行科技岗笔试通关秘籍:从零基础到高分攻略(附最新资料下载)
下一篇: 嵌入式GDB远程调试实战:从环境搭建到高效调试技巧
sql99
博客等级 码龄19年 171粉丝 1905原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址