Skip to content

Commit e136f1a

Browse files
committed
Started getting config file for our labels
1 parent 238e262 commit e136f1a

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

src/config/config.py

+19-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@
77
import numpy as np
88
from easydict import EasyDict as edict
99

10+
# Import our RAS config to get where the labels are, otherwise we'd
11+
# have to hard-code them in here
12+
import ....config as rasConfig
13+
14+
def getLines(file):
15+
"""
16+
Open a file, return all lines
17+
"""
18+
lines = []
19+
20+
with open(file) as f:
21+
for line in f:
22+
lines.append(line.strip())
23+
24+
return lines
25+
1026
def base_model_config(dataset='PASCAL_VOC'):
1127
assert dataset.upper()=='PASCAL_VOC' or dataset.upper()=='KITTI', \
1228
'Currently only support PASCAL_VOC or KITTI dataset'
@@ -23,7 +39,9 @@ def base_model_config(dataset='PASCAL_VOC'):
2339
'horse', 'motorbike', 'person', 'pottedplant', 'sheep',
2440
'sofa', 'train', 'tvmonitor')
2541
elif cfg.DATASET == 'KITTI':
26-
cfg.CLASS_NAMES = ('car', 'pedestrian', 'cyclist')
42+
#cfg.CLASS_NAMES = ('car', 'pedestrian', 'cyclist')
43+
cfg.CLASS_NAMES = getLines(rasConfig.datasetLabels)
44+
print("Class labels:", cfg.CLASS_NAMES)
2745

2846
# number of categories to classify
2947
cfg.CLASSES = len(cfg.CLASS_NAMES)

0 commit comments

Comments
 (0)