我是靠谱客的博主 风趣大白,这篇文章主要介绍ILSVRC2015 制作 ImageSets 的 txt 文本信息 MEGA数据集,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import os # DET_train.txt prestr = 'train/ILSVRC2015_VID_train_0000/' rdPath = './Data/VID/train/ILSVRC2015_VID_train_0000/' wtPath = './ImageSets/DET_train.txt' dirList = os.listdir(rdPath) with open(wtPath, 'a') as f: for na in dirList: wtstr = ''.join([prestr, na, ' 1n']) f.write(wtstr) # VID_train_15frames.txt frameNum = 15 prestr = 'train/ILSVRC2015_VID_train_0000/' rdPath = './Data/VID/train/ILSVRC2015_VID_train_0000/' wtPath = './ImageSets/VID_train_15frames.txt' dirList = os.listdir(rdPath) with open(wtPath, 'a') as f: for na in dirList: head = ''.join([prestr, na, ' 1 ']) childPath = "".join([rdPath, na, '/']) cnt = len(os.listdir(childPath)) interval = cnt // frameNum start = cnt // 2 - (frameNum // 2) * interval tail = ''.join([' ', str(cnt), 'n']) for j in range(frameNum): frameID = start + j * interval wtstr = ''.join([head, str(frameID), tail]) f.write(wtstr) # VID_train_every10frames.txt everyFrames = 10 prestr = 'train/ILSVRC2015_VID_train_0000/' rdPath = './Data/VID/train/ILSVRC2015_VID_train_0000/' wtPath = './ImageSets/VID_train_every10frames.txt' dirList = os.listdir(rdPath) with open(wtPath, 'a') as f: for na in dirList: head = ''.join([prestr, na, ' 1 ']) childPath = "".join([rdPath, na, '/']) cnt = len(os.listdir(childPath)) interval = everyFrames start = 0 tail = ''.join([' ', str(cnt), 'n']) cycles = cnt // interval cycles = cycles + 1 if cycles * interval < cnt else cycles for j in range(cycles): frameID = start + interval * j wtstr = ''.join([head, str(frameID), tail]) f.write(wtstr) # VID_val_frames.txt start = 1 prestr = 'val/' rdPath = './Data/VID/val/' wtPath = './ImageSets/VID_val_videos.txt' dirList = os.listdir(rdPath) with open(wtPath, 'a') as f: for na in dirList: childPath = "".join([rdPath, na, '/']) cnt = len(os.listdir(childPath)) tail = ''.join([' ', str(cnt), 'n']) for j in range(cnt): head = "".join([prestr, na, ' ', str(start), ' ']) wtstr = ''.join([head, str(j), tail]) f.write(wtstr) start = start + 1 # VID_val_videos.txt start = 1 prestr = 'val/' rdPath = './Data/VID/val/' wtPath = './ImageSets/VID_val_frames.txt' dirList = os.listdir(rdPath) with open(wtPath, 'a') as f: for na in dirList: childPath = "".join([rdPath, na, '/']) cnt = len(os.listdir(childPath)) head = "".join([prestr, na, '/']) for j in range(cnt): temp = "{:0>6d}".format(j) tail = ''.join([' ', str(start), 'n']) wtstr = ''.join([head, temp, tail]) f.write(wtstr) start = start + 1

 

最后

以上就是风趣大白最近收集整理的关于ILSVRC2015 制作 ImageSets 的 txt 文本信息 MEGA数据集的全部内容,更多相关ILSVRC2015内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(97)

评论列表共有 0 条评论

立即
投稿
返回
顶部