当前位置:网站首页>Image batch processing | necessary skills
Image batch processing | necessary skills
2022-07-28 08:47:00 【51CTO】
WeChat official account :*AI Algorithm and image processing
Follow to learn more about programming tips and quality resources . A question or suggestion , Please leave a message for the official account ;
If you think it helps , welcome Good looking and sharing
Content catalog
Image batch processing brief introduction Specific matters 1) Analyze the storage of files 2) Try to analyze good , Now it's clear , It's time to prepare something Code implementation Output results : At this time, the name and address of the picture have been obtained —— You can start working Result display
Image batch processing brief introduction
Image batch operation or data batch processing is often used in this era of data explosion , Except for special circumstances , Otherwise, we don't want to rely on manpower to complete data processing one by one ( Local steelmaking ?), Therefore, the coolies handed over to us —— The computer .
Clear objectives : Spend time doing something valuable
Ideas :
1. Read files in bulk
2. Batch processing files
3. Batch storage of files
abbreviation ——3P operation ? Vulgar words ...
Specific matters
1) Analyze the storage of files
Take a look at what the storage of files looks like

0 The folder is under 3 Small folder ( More common situation )

In each secondary folder ( for example 1_1 Folder ) There are pictures stored under

Skull pain after watching !

2) Try to analyze
explain : For ease of understanding , I name folders regularly , from 0 Start adding to the next level 1
(1) Read files in bulk Turn into —— Three steps :
A) Navigate to the first level folder (0) Location
B) Read the secondary folder (1_1,1_2,1_3) name
C) Read the pictures under the secondary folder ( Or data ) name
good , Now it's clear , It's time to prepare something
A) Import library
Os —— Interface of operating system functions
Tqdm —— Add a progress bar , Convenient installation , No , Is to check the implementation
cv2 —— Do something with the picture , Read storage and changes
B) Picture preparation
Here are two in each folder
(2) Batch processing pictures
Here you can add various scanning operations you like , As long as it doesn't break the law , Do whatever you want , For the sake of simplicity , I don't do fancy , Grayscale change operation is used in the code
(3) Batch storage of files
Understand the batch reading of files , In fact, batch storage of files is similar
Code implementation
Output results :
100%|██████████| 3/3 [00:00<00:00, 5863.43it/s]
['1_1_1.jpg', '1_1_2.jpg']
['1_2_1.jpg', '1_2_2.jpg']
['1_3_1.jpg', '1_3_2.jpg']
At this time, the name and address of the picture have been obtained —— You can start working
The next work is equivalent to the operation of a single picture , Because we cycle to the bottom ( It may not be very accurate , Probably means I found the picture , What do you want? Now )
The code is for you , The notes are very clear !!!
Result display

Folder name 、 The name of the picture and the picture have changed , explain , I Cao , I actually succeeded in running ....
In order to facilitate everyone to obtain the code , Code has been added to KFC luxury package .what?
No , It's on github The above
https://github.com/SCUTPZW/AI_study/tree/master

边栏推荐
- Gbase 8A MPP and Galaxy Kirin (x86 version) complete deep adaptation
- PHPUnit在Window下如何配置
- leetcode/数组中和为0的三个不同数
- Why is the text box of Google material design not used?
- Distributed system architecture theory and components
- 2022牛客多校第一场解题报告
- 2021-07-02
- ‘全局事件总线’&‘消息订阅与发布’
- CAT1 4g+ Ethernet development board 232 data is sent to the server through 4G module TCP
- Simple use of unity queue
猜你喜欢

SQL injection - pre Foundation

uniapp---- 获取当前位置的经纬度等信息的详细步骤(包含小程序)

Uniapp ---- detailed steps to obtain the longitude and latitude of the current position and other information (including applet)

HCIP---LDP和MPLS技术(详解)

NDK 系列(6):说一下注册 JNI 函数的方式和时机

学术界爆火的类脑智能,啥时候能落地?来听行业大咖怎么说丨量子位·对撞派 x 时识科技...

GBASE亮相联通云巡展(四川站) 以专业赋能云生态

中标捷报!南大通用GBase 8s中标南瑞集团2022年数据库框架项目

Blog Building 9: add search function to Hugo

快速搭建一个网关服务,动态路由、鉴权的流程,看完秒会(含流程图)
随机推荐
Matlab file path
classLoader加载的class的回收
Source code analysis of linkedblockingqueue
Sliding screen switching on uniapp supports video and image rotation, similar to Tiktok effect
Sparksql and flinksql create and link table records
Maximum product of leetcode/ word length
'global event bus' &' message subscription and Publishing '
leetcode/数组中和为0的三个不同数
When will brain like intelligence, which is popular in academia, land? Let's listen to what the industry masters say - qubits, colliders, x-knowledge Technology
Competition: diabetes genetic risk detection challenge (iFLYTEK)
Shell编程规范与变量
Three different numbers with 0 in leetcode/ array
The current value of uniapp's swiper dynamic setting does not take effect solution
博客搭建七:hugo
Top all major platforms, 22 versions of interview core knowledge analysis notes, strong on the list
Half bridge buck circuit - record
Why is the text box of Google material design not used?
leetcode刷题,我推荐B站这个妹子学霸的视频
Simple use of unity queue
An article to understand data warehouse: metadata classification, metadata management