Datasets:
Tasks:
Feature Extraction
Modalities:
Image
Formats:
imagefolder
Languages:
English
Size:
1K - 10K
Tags:
code
License:
Upload 2 files
Browse files- classes.txt +62 -0
- clean_data.py +19 -0
classes.txt
ADDED
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
a
|
2 |
+
b
|
3 |
+
c
|
4 |
+
d
|
5 |
+
e
|
6 |
+
f
|
7 |
+
g
|
8 |
+
h
|
9 |
+
i
|
10 |
+
j
|
11 |
+
k
|
12 |
+
l
|
13 |
+
m
|
14 |
+
n
|
15 |
+
o
|
16 |
+
p
|
17 |
+
q
|
18 |
+
r
|
19 |
+
s
|
20 |
+
t
|
21 |
+
u
|
22 |
+
v
|
23 |
+
w
|
24 |
+
x
|
25 |
+
y
|
26 |
+
z
|
27 |
+
A
|
28 |
+
B
|
29 |
+
C
|
30 |
+
D
|
31 |
+
E
|
32 |
+
F
|
33 |
+
G
|
34 |
+
H
|
35 |
+
I
|
36 |
+
J
|
37 |
+
K
|
38 |
+
L
|
39 |
+
M
|
40 |
+
N
|
41 |
+
O
|
42 |
+
P
|
43 |
+
Q
|
44 |
+
R
|
45 |
+
S
|
46 |
+
T
|
47 |
+
U
|
48 |
+
V
|
49 |
+
W
|
50 |
+
X
|
51 |
+
Y
|
52 |
+
Z
|
53 |
+
0
|
54 |
+
1
|
55 |
+
2
|
56 |
+
3
|
57 |
+
4
|
58 |
+
5
|
59 |
+
6
|
60 |
+
7
|
61 |
+
8
|
62 |
+
9
|
clean_data.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
t = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
|
2 |
+
import os
|
3 |
+
dirs = r'E:\group_5\labels_g3_1'
|
4 |
+
ndirs = r'E:\group_5\labels_3'
|
5 |
+
for filenames in os.listdir(dirs):
|
6 |
+
if filenames.endswith('.txt'):
|
7 |
+
old_file = os.path.join(dirs, filenames)
|
8 |
+
new_file = os.path.join(ndirs, filenames)
|
9 |
+
with open(old_file, 'r') as f:
|
10 |
+
lines = f.readlines()
|
11 |
+
if len(lines) != 6:
|
12 |
+
print(f"File {filenames} does not have exactly 6 lines.")
|
13 |
+
continue
|
14 |
+
idx = [t.index(c) for c in filenames.split('_')[0]]
|
15 |
+
with open(new_file, 'w') as f:
|
16 |
+
for i,line in enumerate(lines):
|
17 |
+
line = line.split(' ')
|
18 |
+
line[0] = str(idx[i])
|
19 |
+
f.write(' '.join(line))
|