当前位置:网站首页>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 .
边栏推荐
- SQL training 2
- Learn the knowledge points of eight part essay ~ ~ 1
- 2022编译原理期末考试 回忆版
- Troubleshooting: kubectl reports an error validationerror: unknown field \u00a0
- STM32G0 USB DFU 升级校验出错-2
- [100 cases of JVM tuning practice] 02 - five cases of virtual machine stack and local method stack tuning
- R语言使用epiDisplay包的lsNoFunction函数列出当前空间中的所有对象、除了用户自定义的函数对象
- 谷歌官方回应:我们没有放弃TensorFlow,未来与JAX并肩发展
- Installation of thingsboard, an open source IOT platform
- 【每日一题】第一天
猜你喜欢
[daily question] first day
思维意识转变是施工企业数字化转型成败的关键
【JVM调优实战100例】01——JVM的介绍与程序计数器
juypter notebook 修改默认打开文件夹以及默认浏览器
[test development] software testing - concept
Tips for material UV masking
新手必看,點擊兩個按鈕切換至不同的內容
Stratégie touristique d'été de Singapour: un jour pour visiter l'île de San taosha à Singapour
Mysql高级篇学习总结8:InnoDB数据存储结构页的概述、页的内部结构、行格式
Exness in-depth good article: dynamic series - Case Analysis of gold liquidity (V)
随机推荐
[论文阅读] CA-Net: Leveraging Contextual Features for Lung Cancer Prediction
Eliminate the yellow alarm light on IBM p750 small computer [easy to understand]
ORA-01455: converting column overflows integer datatype
How to use PS to extract image color and analyze color matching
R语言使用epiDisplay包的lrtest函数对多个glm模型(logisti回归)执行似然比检验(Likelihood ratio test)对比两个模型的性能是否有差异、广义线性模型的似然比检
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
R语言dplyr包na_if函数把向量数值中的控制转化为缺失值NA、按照映射规则把指定内容转化为缺失值NA
Masa framework - DDD design (1)
9D电影是怎样的?(+维度空间常识)
R语言ggplot2可视化:可视化折线图、使用labs函数为折线图添加自定义的X轴标签信息
The difference between SLC, MLC, TLC and QLC NAND SSD: which is better?
拦截器与过滤器的区别
SLC、MLC、TLC 和 QLC NAND SSD 之间的区别:哪个更好?
二进制操作
What are the links of the problem
[0701] [paper reading] allowing data imbalance issue with perforated input during influence
第一次去曼谷旅游怎么玩?这份省钱攻略请收好
Three ways of function parameter transfer in C language
Use MNIST in tensorflow 2_ 784 data set for handwritten digit recognition
2022软件工程期末考试 回忆版