Skip to content

Commit bbec567

Browse files
committed
har_trees: Fix labels being cut off
Bad rstrip
1 parent 8c2d62c commit bbec567

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

examples/har_trees/har_data2labelstudio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def load_har_record(path,
3434
df['time'] = t
3535
df = df.set_index('time')
3636

37-
classname = f.split('_')[1].rstrip(suffix)
37+
classname = os.path.splitext(f)[0].split('_')[1]
3838

3939
# Remove :, special character on Windows
4040
filename = f.replace(':', '')

examples/har_trees/har_labelstudio2dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import pandas
66

77

8+
from har_data2labelstudio import load_har_record
89

9-
from read_data import load_har_record
1010

1111
def extract_filename(url):
1212

examples/har_trees/har_quicklabel.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,11 @@ def main():
4545
# Lookup data
4646
recordings = load_har_record(data_path)
4747

48-
print(recordings.columns)
49-
50-
print(recordings.head(5))
51-
5248
# Create packed dataframe
5349
dfs = []
5450
for filename, row in recordings.iterrows():
5551
classname = row.classname
56-
filename = filename.rstrip('.npy')
52+
filename = filename
5753
#print(filename, classname)
5854

5955
d = row.data
@@ -66,7 +62,6 @@ def main():
6662
#p = 'data/processed/pamap2.parquet'
6763

6864
out = pandas.concat(dfs, ignore_index=True)
69-
print(out)
7065
out.to_parquet(out_path)
7166

7267
#return
@@ -75,7 +70,7 @@ def main():
7570
print(df.columns)
7671
print(df.activity.value_counts())
7772
print(df.file.value_counts())
78-
print(df.head())
73+
print(df.head(5))
7974

8075

8176
if __name__ == '__main__':

0 commit comments

Comments
 (0)