-
Notifications
You must be signed in to change notification settings - Fork 1
/
combineAlltext.py
72 lines (56 loc) · 2.34 KB
/
combineAlltext.py
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
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 20 21:47:21 2019
@author: C.Seifert18
"""
'''
combine 3 files...fuck this computer up...
'''
import os
import pdb
outpath='C:\\Users\\c.seifert18\\Desktop\\trainMTCNN_stuff\\MTCNN-Tensorflow-master\\Ara2013-Canon\\'
araPath='C:\\Users\\c.seifert18\\Desktop\\trainMTCNN_stuff\\MTCNN-Tensorflow-master\\Ara2013-Canon\\ara2013_TFmtcnn_bb.txt'
leaf100Path='C:\\Users\\c.seifert18\\Desktop\\trainMTCNN_stuff\\100-leaves-plant-species\\100-leaves-plant-species\\100species_bbx.txt'
plantVillagePath='C:\\Users\\c.seifert18\\Desktop\\trainMTCNN_stuff\\100-leaves-plant-species\\100-leaves-plant-species\\plantVillageTrain_bbx.txt'
Allplants=outpath+'allPlants_bb.txt'
with open(Allplants,'w') as newFile:
with open (araPath,'r') as araFiles:
allText = araFiles.readlines()
for i in allText:
i=i.strip().split(' ')
ara_win = outpath+'train\\'+i[0][154:]+" "#[p.strip().split(' ')[0] for p in allText if 'C:' not in p]
newFile.writelines(ara_win)
#pdb.set_trace()
for k in i[1:]:
newFile.writelines(k+" ")
newFile.writelines("\n")
newFile.writelines("\n")
#newFile.writelines("\n")
with open(leaf100Path, 'r') as binLeaf:
all100 = binLeaf.readlines()
for line in all100:
# if '\n' or '' in line:
# newFile.writelines('\n')
# continue
line = line.strip().split()
thisDir = line[0]
newFile.writelines(thisDir+' ')
print(thisDir)
for k in line[1:]:
newFile.writelines(k+" ")
newFile.writelines("\n")
#
# with open(plantVillagePath, 'r') as villageLeaf:
# allvillage = villageLeaf.readlines()
# for i in allvillage:
# i = i.strip().split()
# dirr=i[0]
# newFile.writelines(dirr+" ")
# for k in i[1:]:
# newFile.writelines(k+' ')
# newFile.writelines("\n")
#village = [p.strip().split(' ')[0] for p in allvillage]
binLeaf.close()
binLeaf.close()
araFiles.close()
newFile.close()