PyQt5入门——QListWidget实现图片缩略图列表

Qt实现图片列表显示 2、添加一个QPushButton,选择加载文件夹。1、使用QListWidget控件显示图片列表。选择文件夹,显示该文件夹下所有图片。 阅读详情

需求描述

最近在写一个图像标注小工具,其中需要用到一个缩略图列表,来查看文件夹内的图片文件。

这里整理一个基于QListWidget实现的版本,简单可用。

示例效果

在这里插入图片描述

代码示例

QListWidget官方文档:[link]

其中,需要用到的QListWidget信号:

  • itemSelectionChanged:所选项发生变化时发送。

先定义缩略图列表部分,继承自QListWidget。每个QListWidgetItem可以设置QIcon图片和文本。

import os
from qtpy.QtCore import QSize
from qtpy.QtGui import QIcon,QPixmap
from PyQt5.QtWidgets import QListWidget,QListWidgetItem,QListView,QWidget,QApplication,QHBoxLayout,QLabel

class ImageListWidget(QListWidget):
    def __init__(self):
        super(ImageListWidget, self).__init__()
        self.setFlow(QListView.Flow(1))#0: left to right,1: top to bottom
        self.setIconSize(QSize(150,
pyqt之QTableWidget实现的图片列表展示示例demo 【代码】pyqt之QTableWidget实现的图片列表展示示例demo。 阅读详情

相关推荐

基于OpenCV与PyQt5的图像检索系统设计与实现详解

图像检索是计算机视觉中的经典应用,其核心在于如何高效提取图像特征并进行相似度度量。传统方法中,颜色直方图、感知哈希与ORB特征点分别从全局色彩、内容指纹和局部结构三个维度描述图像,通过级联策略可平衡效率与精度。这些技术不依赖深度学习框架,仅用OpenCV即可完成特征提取与匹配,配合PyQt5构建桌面界面,能快速搭建可交互的检索工具。该方案适用于课程设计、小型图像库管理及原型验证等场景,既能直观展示算法原理,又具备工程实践价值。文章以OpenCV和PyQt5为技术栈,系统阐述了特征提取、检索排序、界面开发及性

weixin_34401479的博客 341

基于Python+OpenCV+PyQt5的以图搜图系统课程设计全解析

图像检索是计算机视觉中的基础应用,核心目标是从图像库中找到与查询图像视觉相似的图片。实现这一功能通常需要依次完成图像特征提取、特征向量表示与相似度度量三个关键步骤。其中,颜色直方图因计算简单、对旋转和尺度变化不敏感,成为入门级检索系统的常用特征。开发者可借助Python生态快速搭建完整应用:使用OpenCV进行图像读取、颜色空间转换与直方图计算,利用PyQt5构建桌面交互界面,实现从选择图片到展示排序结果的完整链路。此类项目在课程设计、原型验证和实验演示中均有广泛应用。本文以颜色直方图特征为例,系统讲解了环

weixin_30740295的博客 341

Qt 缩略图列表显示图片

Qt QListWidget 缩略图列表显示图片

Qt图片预览(图形列表)

图片预览 可以放大,缩小图片

pyqt5实现绘制ui,列表窗口,滚动窗口显示图片的方法

今天小编就为大家分享一篇pyqt5实现绘制ui,列表窗口,滚动窗口显示图片的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

迷茫之后:Java研发转型售前——选择大于努力!

写下这段文字的时候,小弟已经从Java开发岗位转型软件售前近20天了........ 2011年9月毕业于某培训机构,学的是java语言。之后来到深圳,进入华为外包开始了我的程序猿生涯....刚入职场,第一份工作总是兴奋情绪占主导地位,加入文思创新在华为的人力外包项目组,然后跟着老员工学习、修复小bug,一步一坑的去熟悉那老掉牙的框架...ejb+struts1.2.........项目组老

xuweiwei0415的专栏 1万+

利用ADS设计射频功率放大器

利用ADS设计射频功率放大器 任务: 用飞思卡尔公司的功率放大器芯片ATF27s006NT1设计射频功放,芯片频率范围可达450MHz-3.6GHz。 功放指标: (1) 工作频率:500MHz (2) 增益:G>20dB (3) 电源:+28V (4) 最大输出功率:2W(33dBm) 设计思路 (1)安装DesignKit模型; (2)直流DC扫描; (3)稳定性分析; (4)偏置电路设计及整...

UVM频率 3万+

2023电赛B题实战解析:基于立创天空星开发板的同轴线缆长度与负载测量系统

本文详细解析了2023年全国大学生电子设计竞赛B题的实战方案,重点介绍了基于立创EDA天空星开发板(STM32F103)的同轴线缆长度与负载测量系统。文章深入剖析了两种核心测量方案,并推荐了更稳定易实现的NE555测电容法,提供了从硬件选型、电路设计到软件编程、参数标定的完整“施工图”,实测精度可达厘米级和皮法级,为电赛复现与高精度测量学习提供了清晰指导。

weixin_36303305的博客 242

Windows下用Python调用科大讯飞语音唤醒SDK的避坑指南(附完整代码)

本文详细介绍了在Windows平台使用Python调用科大讯飞语音唤醒SDK的全流程,包括环境配置、核心代码实现、典型问题解决方案及进阶开发技巧。通过完整的代码示例和避坑指南,帮助开发者快速集成语音唤醒功能,提升开发效率。

u0v1w2x3的博客 409

S32K314 EB配置MCAL全模块讲解【Autosar——1 MCU模块详解】持续更新中

FIRC(fast internal RC Oscillator) :高速内部时钟,固定48MHZ;SIRC(Slow Internal RC Oscillator):低速内部时钟,固定32KHZ;FXOSC(Fast Crystal Oscillator Digital Controller):高速外部晶振(8-40MHZ),根据原理图选型进行配置;SXOSC():外部低速外部时钟,固定输入32.768KHZ;PLL_PHIn_CLK:时钟倍频锁相环时钟范围(640-1280MHZ);

qq_40488886的博客 1792

微信Dat文件转图片(文末含工具下载)

PC端微信dat图片转换为jpg格式

weixin_40704848的博客 8121

华为海思2026届数字IC秋招笔试真题解析与实战技巧(2025最新版)

本文深度解析华为海思2026届数字IC秋招笔试真题,涵盖高频考点如后端设计、低功耗设计、SystemVerilog语法等核心内容。提供时序违例修复、时钟树综合等实战技巧,帮助考生高效备考。特别关注UPF低功耗设计规范等最新考点,助力考生在秋招笔试中脱颖而出。

lg888的博客 1099

96.在 Vue 3 中使用 OpenLayers 探究加载 Point、Polygon 的极限

在前端 GIS(地理信息系统)开发中,OpenLayers 作为一个功能强大的 Web 地图库,广泛用于加载地图、渲染矢量数据(点、线、面)、叠加图层等场景。然而,当涉及到。

小彭的博客 1161

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

深度学习工具包 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'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('DeepLearnToolbox'));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('state',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'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',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 = 'sigm';%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, 'Too big error');```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('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';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)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';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, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% 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'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 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, 'Too big error');```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('state',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, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',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, 'Too big error');%% ex3 neural net with dropoutrand('state',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, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % 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, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % 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, 'Too big error');%% 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('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % 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, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

上一篇: 1个数据可视化的「百搭套路」,从此打开新思路
下一篇: 教你3个python「性能分析」工具,再也不用自己计算函数耗时了
虾米小馄饨
博客等级 码龄12年 1万+粉丝 60原创
评论 11
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址