人眼睁闭状态正负样本标定过程(BAT批处理文件 + python)
来源:互联网 发布:网络平台使用协议 编辑:程序博客网 时间:2024/06/05 08:01
机器学习中进行人眼睁闭状态正负样本标定过程(BAT批处理文件 + python)
此博客内容简单,是为了记录与总结本次解决问题的全过程(全文仅以处理闭眼样本为例),如果能帮助到遇到同样问题的小伙伴,那就再好不过了。
参考资料:
http://stackoverflow.com/questions/11555468/how-should-i-read-a-file-line-by-line-in-python
http://stackoverflow.com/questions/4828885/how-to-direct-output-into-a-txt-file-in-python-in-windows
https://www.lifewire.com/dir-command-4050018
- 将闭眼数据集存储在某一指定文件夹下,并用bulk rename utility 软件对数据集批量命名,如closed_eyes_1.jpg
用BAT批处理文件,将闭眼数据集中的全部图片文件(仅含文件名或包含完整路径的文件名)导入到txt文件中。
`
//仅包含文件名
@echo off
dir “D:\FYP\dataset_B_Eye_Images\closedEyes_train” /a-d /b > C:\Users\Lucy\Desktop\listmyfolder.txt//含完整路径的文件名
@echo off
dir D:\FYP\dataset_B_Eye_Images\closedEyes_train*.jpg /s /b > C:\Users\Lucy\Desktop\closedeyes.txt
`使用python进行txt文件读取,并将新生成的标记后的文件保存为新的txt文件
`/*以下为python脚本test.py,写好后只需在命令行中运行
python test.py > output.txt 即可生成最终带标记的数据集。例如D:\Python27\python.exe test.py > C:\Users\Lucy\Desktop\openedeyes.txt。
注意此command prompt需要在py文件所在处打开。*/with open(‘C:\Users\Lucy\Desktop\closedeyes_train.txt’) as fp:
for line in fp:
lines = line.strip(‘\n’)
print lines
print(‘0’)`
- 人眼睁闭状态正负样本标定过程(BAT批处理文件 + python)
- 批处理文件(.bat文件)
- 【BAT】批处理文件 (持续更新)
- Python 结合bat批处理文件 实现密码保管箱
- bat批处理文件
- bat 批处理文件
- Bat批处理文件
- 批处理文件/.bat
- bat批处理文件
- bat批处理文件
- .bat批处理文件
- bat批处理文件
- bat批处理文件
- 批处理文件bat
- 批处理文件bat
- 正负样本不平衡的解决方法
- 用批处理文件(bat)设置IP地址
- 批处理文件(bat文件)注册dll
- js控制表单数据的提交
- windows系统安装虚拟机,rehl,虚拟机中安装jdk
- C#环境
- 解决z-index不生效
- Emoji简介
- 人眼睁闭状态正负样本标定过程(BAT批处理文件 + python)
- 计算两点间距离(成员函数)
- C# 程序结构
- Ecshop模板开发(二十):商品详情页相关文章显示
- python中元组(tuple)用法总结
- Springboot集成MapperFactory(ma.glasnost.orika.MapperFactory)类属性复制
- RecyclerView的item点击事件
- Skynet服务器框架(一) Linux下的安装和启动
- 关于安装lombook失效的事