The python code to batch modify the image resolution and fill the redundant area of the image

This code is for beginners to use, we refer to a lot of code on the Internet, thank the predecessors for their contributions.

The goal of this code is to modify the resolution of all the pictures to 128*128. While modifying the images, it will not elongate them, but supplement the deformed part by filling pure white(any color can be fill by change RGB), which is conducive to the training of GAN.

The code is python, can be copied later debugging use.

Thanks for xinggui.

The last part 【cut_images(‘F:/date/JPG128enhance/’, ‘new’, 128, 128)】is the target folder you want to enhance.

And 128 represents the image resolution that needs to be modified. For example, 128, 128 represents a picture with a resolution of 128*128, if you need other picture resolutions, you can modify it yourself.
The way for beginners to use is to copy this code into vscode, modify the address of the target directory, save it as a .py file, and then click the small triangle in the upper right corner to run the code.

基于python的图像批量修改分辨率且周边填充空白的代码

小白写的,小白用,也是参考了网上的很多代码,感谢大佬们的贡献。

这个代码的目标是,把所有图片全部分辨率修改为128*128,在修改的同时并不会拉长图像,而是通过填充纯白色的方式来补充变形部分,有利于GAN的训练。

代码是python的,当时和星轨桑一起研究的,但是如何发挥工作已经忘记了,可以复制以后自行调试使用。

其中最后一段【cut_images(‘F:/date/JPG128enhance/’, ‘new’, 128, 128)】是需要修改的目标文件夹,依照自己所需要转换的文件夹来使用,而128代表着需要修改的图片分辨率,举例子128,128代表着128*128分辨率的图片,如果需要其他图片分辨率就自己修改好了,小白的使用方法就是把这段代码复制到vscode里,修改好目标目录的地址,另存为一个.py的文件,然后点击右上角的小三角运行代码即可。

与chatGPT聊聊VR虚拟现实、AR增强现实和MT混合现实未来的发展

与chatGPT聊聊VR虚拟现实、AR增强现实和MT混合现实未来的发展
与chatGPT聊聊VR虚拟现实、AR增强现实和MT混合现实未来的发展

当前大火的chatGPT,大语言模型通过巨量的数据和互联的检索引擎,可以实现远超人类的对信息的总结归纳与演绎。今天我们来问问chatgpt,看看人工智能如何去看待当前虚拟现实混合现实之类的行业现状及未来的发展。

提问:什么是虚拟现实、增强现实、混合现实?

chatGPT:虚拟现实(VR)、增强现实(AR)、混合现实(MR)是新一代信息技术的重要前沿方向,它们都可以通过虚拟对象来增强人类的感知和交互能力,但是它们之间也有一些区别:

虚拟现实(VR)是一种完全接管你的视野并营造出一个完全不存在的纯虚拟环境,你需要戴上特殊的头盔或眼镜来体验。
增强现实(AR)是一种向现实物理环境中添加虚拟内容的技术,你可以通过手机、平板或智能眼镜等设备来看到虚拟内容与真实场景的叠加。
混合现实(MR)是一种特殊的增强现实,其技术和应用介于AR和VR之间,混合现实通过虚拟对象增强现实世界,虚拟对象的目的就是将它们真正放置在该世界中,并且可以与真实环境产生交互。

可以继续就上一个问题进行提问,chatGPT还会对感兴趣的技术内容继续深入解答:

【PYQT】How to modify the Label text and attributes in PYQT Design by clicking the button

The purpose of this article is to use pyQt Design to create a graphical Python GUI. When a button is clicked, the text content of a TextLabel changes  

Use VS CODE as the compiler, and install PYQT Integration plug-in for graphical.  UI compiles, converts.ui into.py, and any other compiler compiles pyQt in the same way