当前位置:网站首页>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 .
边栏推荐
- CDN acceleration and breaking J anti-theft chain function
- Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future
- 第一次去曼谷旅游怎么玩?这份省钱攻略请收好
- 开源物联网平台ThingsBoard的安装
- Kubernetes three open interfaces first sight
- How to set vscode to delete the whole line shortcut key?
- Eliminate the yellow alarm light on IBM p750 small computer [easy to understand]
- R语言使用epiDisplay包的cox.display函数获取cox回归模型汇总统计信息(风险率HR、调整风险率及其置信区间、模型系数的t检验的p值、Wald检验的p值和似然比检验的p值)、汇总统计
- R语言ggplot2可视化:gganimate包创建动态柱状图动画(gif)、使用transition_states函数在动画中沿给定维度逐步显示柱状图
- Websocket of Web real-time communication technology
猜你喜欢

Distance measurement - Jaccard distance

How to clean up discarded PVs and their corresponding folders
![[fluent] dart data type (VaR data type | object data type)](/img/1b/fe2529af5f6663fad1fb7861f14ab5.jpg)
[fluent] dart data type (VaR data type | object data type)

Thoroughly understand the point cloud processing tutorial based on open3d!
![[paper reading] Ca net: leveraging contextual features for lung cancer prediction](/img/ef/bb48ee88d5dc6fe876a498ab53106e.png)
[paper reading] Ca net: leveraging contextual features for lung cancer prediction
![[0701] [论文阅读] Alleviating Data Imbalance Issue with Perturbed Input During Inference](/img/c7/9b7dc4b4bda4ecfe07aec1367fe059.png)
[0701] [论文阅读] Alleviating Data Imbalance Issue with Perturbed Input During Inference
![[100 cases of JVM tuning practice] 01 - introduction of JVM and program counter](/img/c4/3bba96fda92328704c2ddd929dcdf6.png)
[100 cases of JVM tuning practice] 01 - introduction of JVM and program counter

M2DGR:多源多场景 地面机器人SLAM数据集(ICRA 2022 )

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

MySQL advanced learning summary 8: overview of InnoDB data storage structure page, internal structure of page, row format
随机推荐
聊聊电商系统中红包活动设计
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语言ggplot2可视化分面图(facet):gganimate包基于transition_time函数创建动态散点图动画(gif)
QT中的QPropertyAnimation使用和toast案列
Learning summary of MySQL advanced 6: concept and understanding of index, detailed explanation of b+ tree generation process, comparison between MyISAM and InnoDB
sql训练2
CDN acceleration and breaking J anti-theft chain function
ORA-01455: converting column overflows integer datatype
故障排查:kubectl报错ValidationError: unknown field \u00a0
R语言ggplot2可视化:gganimate包创建动态柱状图动画(gif)、使用transition_states函数在动画中沿给定维度逐步显示柱状图
使用CLion编译OGLPG-9th-Edition源码
UML class diagram
options should NOT have additional properties
Gstore weekly gstore source code analysis (4): black and white list configuration analysis of security mechanism
What is cloud primordial? This time, I can finally understand!
The difference between interceptor and filter
距离度量 —— 杰卡德距离(Jaccard Distance)
[test development] takes you to know what software testing is
Meta universe chain game system development (logic development) - chain game system development (detailed analysis)
二进制操作