当前位置:网站首页>Data set preparation and arrangement
Data set preparation and arrangement
2022-06-30 03:01:00 【Master Hao】
coding: utf-8
In[3]:
import os
# For copying files
import shutil
Create a new folder to store the sorted pictures
for i in range(17):
# 17 Categories NEW 17 A folder 0-16
os.mkdir(‘D:/17flowers’+’/’+‘flower’+str(i))
Cycle through the pictures of all the flowers
#os.listdir() Method to return a list of the names of the files or folders contained in the specified folder .
for i,path in enumerate(os.listdir(‘D:/17flowers/jpg/’)):
# Define the full path of the flower picture
image_path = ‘D:/17flowers/jpg/’ + path
# Copy to the corresponding category , Each category 80 A picture
#copyfile(src, dst): take src Copy the contents of the file to dst file
shutil.copyfile(image_path, ‘D:/17flowers’+’/’+‘flower’+str(i//80)+’/’+path)
边栏推荐
- 外汇交易平台哪个好?有监管的资金就安全吗?
- 如何在 JupyterLab 中把 ipykernel 切换到不同的 conda 虚拟环境?
- What is the metauniverse: where are we, where are we going
- 2.8 【 weight of complete binary tree 】
- Linear algebra Chapter 4 Summary of knowledge points of linear equations (Jeff's self perception)
- How to prevent duplicate submission under concurrent requests
- SQLite use
- Call collections Sort() method, compare two person objects (by age ratio first, and by name ratio for the same age), and pass lambda expression as a parameter.
- WPF Initialized事件在.cs中绑定不被触发的原因
- Mysql 带上库名称跨库操作可能出现的问题
猜你喜欢
如何在 JupyterLab 中把 ipykernel 切换到不同的 conda 虚拟环境?
简单自定义MVC优化
自定义JvxeTable的按钮及备注下$set的用法
What is the concept of string in PHP
How to modify and add fields when MySQL table data is large
Wechat applet page Jump and parameter transfer
How to set password complexity and timeout exit function in Oracle
How to switch ipykernel to a different CONDA virtual environment in jupyterlab?
Study diary: February 15, 2022
prompt learning 一个空格引发的血案
随机推荐
The MariaDB database was found 12 hours late
华为面试题: 高矮个子排队
Redis+AOP怎么自定义注解实现限流
zabbix 触发器详解
Xunwei NXP itop-imx6 development platform
Distributed file system fastdfs
迅为恩智浦iTOP-IMX6开发平台
 与空格的区别
Implementation of Sanzi chess with C language
个人PC安装软件
简单自定义MVC优化
Use compose to realize the effect of selecting movie seats by panning tickets
Summary of knowledge points about eigenvalues and eigenvectors of matrices in Chapter 5 of Linear Algebra (Jeff's self perception)
在php中字符串的概念是什么
Federal learning: dividing non IID samples by Dirichlet distribution
Hands on in-depth learning notes (XV) 4.1 Multilayer perceptron
Azure developer news flash list of events of developers in June
oracle怎么设置密码复杂度及超时退出的功能
F1C100S自制开发板调试过程
Use of Arthas