当前位置:网站首页>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 .
边栏推荐
- Which securities company has a low, safe and reliable online account opening commission
- Imitation Jingdong magnifying glass effect (pink teacher version)
- 仿京东放大镜效果(pink老师版)
- Learn the knowledge points of eight part essay ~ ~ 1
- 【JVM调优实战100例】01——JVM的介绍与程序计数器
- ICDE 2023|TKDE Poster Session(CFP)
- R语言dplyr包na_if函数把向量数值中的控制转化为缺失值NA、按照映射规则把指定内容转化为缺失值NA
- 徹底搞懂基於Open3D的點雲處理教程!
- [100 cases of JVM tuning practice] 02 - five cases of virtual machine stack and local method stack tuning
- Slam | how to align timestamps?
猜你喜欢

聊聊电商系统中红包活动设计

Redis (6) -- object and data structure

学生抖音宣传母校被吐槽“招生减章”,网友:哈哈哈哈哈哈
![27: Chapter 3: develop Passport Service: 10: [registration / login] interface: after the registration / login is OK, save the user session information (uid, utoken) to redis and cookies; (one main poi](/img/b9/2066a13b160252114c2881007094f8.png)
27: Chapter 3: develop Passport Service: 10: [registration / login] interface: after the registration / login is OK, save the user session information (uid, utoken) to redis and cookies; (one main poi

Google's official response: we have not given up tensorflow and will develop side by side with Jax in the future

【JVM调优实战100例】03——JVM堆调优四例

故障排查:kubectl报错ValidationError: unknown field \u00a0

The text editor hopes to mark the wrong sentences in red, and the text editor uses markdown

MySQL advanced learning summary 7: MySQL data structure - Comparison of hash index, AVL tree, B tree and b+ tree

Deep learning mathematics foundation
随机推荐
LightGroupButton* sender = static_ cast<LightGroupButton*>(QObject::sender());
CDN acceleration and breaking J anti-theft chain function
9D电影是怎样的?(+维度空间常识)
The student Tiktok publicized that his alma mater was roast about "reducing the seal of enrollment". Netizen: hahahahahahahaha
Meta universe chain game system development (logic development) - chain game system development (detailed analysis)
Progress-进度条
How to delete the border of links in IE? [repeat] - how to remove borders around links in IE? [duplicate]
使用 Cheat Engine 修改 Kingdom Rush 中的金钱、生命、星
Golang并发编程——goroutine、channel、sync
问题包含哪些环节
The R language dplyr package rowwise function and mutate function calculate the maximum value of multiple data columns in each row in the dataframe data, and generate the data column (row maximum) cor
Kubernetes three open interfaces first sight
Responses of different people in technology companies to bugs | daily anecdotes
Mini Golf Course: a good place for leisure and tourism in London
[0701] [论文阅读] Alleviating Data Imbalance Issue with Perturbed Input During Inference
论文导读 | 关于将预训练语言模型作为知识库的分析与批评
Obligatoire pour les débutants, cliquez sur deux boutons pour passer à un contenu différent
How to use PS to extract image color and analyze color matching
SLC、MLC、TLC 和 QLC NAND SSD 之间的区别:哪个更好?
Comprendre complètement le tutoriel de traitement de Point Cloud basé sur open3d!