提交 216fe237 编写于 作者: K kechxu 提交者: HongyiSun

tools/prediction: make scripts run after recorg

上级 e8f2dd86
......@@ -36,4 +36,4 @@ if __name__ == "__main__":
file.split('.')[0] == 'datalearn':
label_path = args.labels_dirpath
CombineFeaturesAndLabels(full_file_path, label_path + \
'/junction_labels.npy', 'junction_label')
'/junction_label.npy', 'junction_label')
......@@ -99,7 +99,7 @@ def CombineFeaturesAndLabels(feature_path, label_path, dict_name='future_status'
continue
labels = dict_labels[key]
list_curr = features_for_learning + labels
else if dict_name == 'future_status':
elif dict_name == 'future_status':
if len(dict_labels[key]) < future_status_label_dim:
continue
labels = dict_labels[key][:30]
......@@ -110,7 +110,7 @@ def CombineFeaturesAndLabels(feature_path, label_path, dict_name='future_status'
output_np_array = np.array(output_np_array)
np.save(feature_path + 'features+' + dict_name + '.npy', output_np_array)
np.save(feature_path + '.features+' + dict_name + '.npy', output_np_array)
'''
Merge all files of features+labels into a single one
......
......@@ -24,4 +24,6 @@ if __name__ == "__main__":
parser.add_argument('dirpath', type=str, help='Path of terminal folder.')
args = parser.parse_args()
MergeDicts(args.dirpath)
MergeDicts(args.dirpath, dict_name='future_status')
MergeDicts(args.dirpath, dict_name='junction_label')
MergeDicts(args.dirpath, dict_name='cruise_label')
......@@ -21,8 +21,8 @@
#
# The input feature.X.bin will generate furture_status.label, cruise.label, junction.label
SRC_FILE=$1
LBL_FILE=$2
SRC_DIR=$1
LBL_DIR=$2
SCENARIO=$3
set -e
......@@ -31,7 +31,7 @@ source /apollo/scripts/apollo_base.sh
source /apollo/cyber/setup.bash
if [ ${SCENARIO} == "junction" ]; then
python /apollo/modules/tools/prediction/data_pipelines/data_preprocessing/combine_features_and_labels_for_junction.py ${SRC_FILE} ${LBL_FILE}
python /apollo/modules/tools/prediction/data_pipelines/data_preprocessing/combine_features_and_labels_for_junction.py ${SRC_DIR} ${LBL_DIR}
else
python /apollo/modules/tools/prediction/data_pipelines/data_preprocessing/combine_features_and_labels.py ${SRC_FILE} ${LBL_FILE}
python /apollo/modules/tools/prediction/data_pipelines/data_preprocessing/combine_features_and_labels.py ${SRC_DIR} ${LBL_DIR}
fi
......@@ -28,4 +28,4 @@ set -e
source /apollo/scripts/apollo_base.sh
source /apollo/cyber/setup.bash
python modules/tools/prediction/mlp_train/generate_labels.py ${SRC_FILE}
python modules/tools/prediction/data_pipelines/data_preprocessing/generate_labels.py ${SRC_FILE}
#!/usr/bin/env bash
###############################################################################
# Copyright 2019 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################
INPUT_FILE=$1
OUTPUT_FILE=$2
FEATURE_TYPE=$3
set -e
source /apollo/scripts/apollo_base.sh
source /apollo/cyber/setup.bash
FLAGFILE=/apollo/modules/prediction/conf/offline_prediction.conf
/apollo/bazel-bin/modules/prediction/feature_proto_file_to_model_features \
--flagfile=${FLAGFILE} \
--offline_feature_proto_file_name=${INPUT_FILE} \
--output_filename=${OUTPUT_FILE} \
--extract_feature_type=${FEATURE_TYPE}
......@@ -28,4 +28,4 @@ set -e
source /apollo/scripts/apollo_base.sh
source /apollo/cyber/setup.bash
python modules/tools/prediction/learning_algorithms/data_preprocessing/merge_label_dicts.py ${SRC_FILE}
python modules/tools/prediction/data_pipelines/data_preprocessing/merge_label_dicts.py ${SRC_FILE}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册