当前位置:网站首页>Yolov3 trains its own data set to generate train txt
Yolov3 trains its own data set to generate train txt
2022-07-02 19:05:00 【FeboReigns】
from os.path import join
import os
img_dir = "images"
work_dir = os.getcwd()
print (" Current working directory : %s" % work_dir)
txt_file = open(work_dir+'/train.txt', 'w')
img_path = join(work_dir,img_dir)
print (" Picture folder :",img_path)
image_names = os.listdir('./'+ img_dir)
for file_name in image_names:
if file_name.endswith(".jpg"):
txt_file.write(img_path + "/"+ file_name+"\n")
txt_file.close()work_dir This is it py The path of the script , such as E:\workspace\classify
img_dir Is the path of the dataset image , For example, I put all the pictures in ,E:\workspace\classify\images in
I'm going to put work_dir +“images”, Got it. img_dir, If your path is different from, modify it by yourself
Then traverse img_dir All under jpg picture , If you are another picture, you put if file_name.endswith(".jpg") Make a change , Don't judge the suffix , Write the absolute path of each picture in txt in .

Pay attention to the , stay win System generated txt, Can't put linux of use , Because of the backslash .
边栏推荐
- [test development] takes you to know what software testing is
- Installation of thingsboard, an open source IOT platform
- Obligatoire pour les débutants, cliquez sur deux boutons pour passer à un contenu différent
- 2022软件工程期末考试 回忆版
- ORA-01455: converting column overflows integer datatype
- 谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
- 新手必看,点击两个按钮切换至不同的内容
- R language ggplot2 visualization: visualize the line chart and add customized X-axis label information to the line chart using labs function
- Typical application of "stack" - expression evaluation (implemented in C language)
- M2DGR:多源多场景 地面机器人SLAM数据集(ICRA 2022 )
猜你喜欢

Introduction to the paper | application of machine learning in database cardinality estimation

Introduction to the paper | analysis and criticism of using the pre training language model as a knowledge base

论文导读 | 机器学习在数据库基数估计中的应用

Troubleshooting: kubectl reports an error validationerror: unknown field \u00a0

LightGroupButton* sender = static_ cast<LightGroupButton*>(QObject::sender());

Mysql高级篇学习总结6:索引的概念及理解、B+树产生过程详解、MyISAM与InnoDB的对比

思维意识转变是施工企业数字化转型成败的关键

How to copy and paste interlaced in Excel

How to clean up discarded PVs and their corresponding folders

The text editor hopes to mark the wrong sentences in red, and the text editor uses markdown
随机推荐
徹底搞懂基於Open3D的點雲處理教程!
juypter notebook 修改默认打开文件夹以及默认浏览器
[论文阅读] CA-Net: Leveraging Contextual Features for Lung Cancer Prediction
二进制操作
QT中的QPropertyAnimation使用和toast案列
How to write controller layer code gracefully?
R语言ggplot2可视化:可视化折线图、使用labs函数为折线图添加自定义的X轴标签信息
SLAM|如何时间戳对齐?
新手必看,點擊兩個按鈕切換至不同的內容
Competence of product manager
[0701] [论文阅读] Alleviating Data Imbalance Issue with Perturbed Input During Inference
C的内存管理
Eliminate the yellow alarm light on IBM p750 small computer [easy to understand]
Learn the knowledge points of eight part essay ~ ~ 1
Comprendre complètement le tutoriel de traitement de Point Cloud basé sur open3d!
R语言使用epiDisplay包的lrtest函数对多个glm模型(logisti回归)执行似然比检验(Likelihood ratio test)对比两个模型的性能是否有差异、广义线性模型的似然比检
Is it safe to buy funds on Alipay account
R language dplyr package filter function filters dataframe data. If the name of the data column (variable) to be filtered contains quotation marks, you need to use!! SYM syntax processing, otherwise n
[test development] software testing - concept
M2DGR:多源多场景 地面机器人SLAM数据集(ICRA 2022 )