object-detection-crowdai数据处理
2017-06-08 16:24
197 查看
import os file=os.listdir('/home/xingyuzhou/object-detection-crowdai') file.sort(key= lambda x:int(x[:-4])) for f in file: print f
得到的a是一个列表,里面的元素就是文件夹下每个文件的名字;但是它并不是按我们在文件夹中看到的文件的顺序排列的,而是一种不固定的顺序。
假如我们的文件夹中是后缀名为.jpg的图片,并且按照数字大小来命名,那么我们可以使用列表的sort()方法来对其进行排序,但是它是按string的排序方法排序的。
如果我们想要让它按数字大小来排序,那么我们可以使用sort()的key参数,key参数是一个函数,
如果想按字母排序: file.sort(key = str.lower)
相关文章推荐
- TensorFlow Object Detection API 介绍
- doppia object_detection代码配置
- windows下Tensorflow Object Detection API报错:object_detection/protos/*.proto: No such file or directory
- 图像检测1-R-CNN-Rich featurehierarchies for accurate object detection and semantic segmentation
- Rich feature hierarchies for accurate object detection and semantic segmentation
- 目标检测--Feature Pyramid Networks for Object Detection
- You Only Look Once: Unified, Real-Time Object Detection
- Factors in Finetuning Deep Model for Object Detection with Long-tail Distribution解读
- 初窥Tensorflow Object Detection API 源码之(1.1) Resnet
- 【CV论文阅读】:Rich feature hierarchies for accurate object detection and semantic segmentation
- 初窥Tensorflow Object Detection API 源码之(2.6)matcher
- 基于深度学习的目标检测(object detection)—— rcnn、fast-rcnn、faster-rcnn
- TensorFlow object detection api------ssd_mobilenet使用
- 3D Object Proposals for Accurate Object Class Detection
- Histogram of Oriented Gradients and Object Detection
- PS:mproving Object Detection With Deep Convolutional Networks via Bayesian Optimization..___CVPR2015
- 2001 Rapid object detection using a boosted cascade of simple features(Paul Viola et al)读后感
- Faster RCNN: Towards RealTime Object Detection with Region Proposal Networks+Visualizing and Underst
- 深度学习目标检测(object detection)系列(五) R-FCN
- 【深度学习:目标检测】RCNN学习笔记(2):Rich feature hierarchies for accurate object detection and semantic segmentat