Skip to content

Commit

Permalink
Update image-clasification with explicit preprocessing.
Browse files Browse the repository at this point in the history
  • Loading branch information
psyhtest committed Jun 14, 2019
1 parent 51a9f17 commit ecec350
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
19 changes: 12 additions & 7 deletions program/image-classification-armnn-tflite/.cm/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,14 @@
"script_name": "postprocess"
},
"pre_process_via_ck": {
"data_uoa": "b98ee24399ef4c3a",
"module_uoa": "script",
"script_name": "preprocess"
"data_uoa": "b98ee24399ef4c3a",
"module_uoa": "script",
"script_name": "schindler"
},
"run_cmd_main": "$#BIN_FILE#$",
"run_input_files": [
"$<<CK_ENV_TENSORFLOW_MODEL_TFLITE_FILEPATH>>$"
],
"run_output_files": [
"tmp-ck-timer.json"
]
Expand All @@ -97,12 +100,12 @@
"sort": 10,
"tags": "dataset,imagenet,aux"
},
"imagenet-val": {
"images": {
"force_target_as_host": "yes",
"local": "yes",
"name": "ImageNet dataset (val)",
"name": "ImageNet dataset (preprocessed subset)",
"sort": 20,
"tags": "dataset,imagenet,raw,val"
"tags": "dataset,imagenet,preprocessed"
},
"lib-python-numpy": {
"local": "yes",
Expand Down Expand Up @@ -145,9 +148,11 @@
"CK_RECREATE_CACHE": "NO",
"CK_SKIP_IMAGES": 0,
"CK_SUBTRACT_MEAN": "YES",
"CK_RESULTS_DIR": "predictions",
"CK_TMP_IMAGE_SIZE": 0,
"USE_NEON": "NO",
"USE_OPENCL": "NO"
"USE_OPENCL": "NO",
"CK_SILENT_MODE": 0
},
"skip_bin_ext": "yes",
"source_files": [
Expand Down
27 changes: 16 additions & 11 deletions program/image-classification-armnn-tflite/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,24 @@ class Accumulator {

class BenchmarkSettings {
public:
const std::string graph_file = getenv_s("RUN_OPT_GRAPH_FILE");
const std::string images_dir = getenv_s("RUN_OPT_IMAGE_DIR");
const std::string images_file = getenv_s("RUN_OPT_IMAGE_LIST");
const std::string result_dir = getenv_s("RUN_OPT_RESULT_DIR");
const std::string data_layout = getenv_s("RUN_OPT_DATA_LAYOUT");
const int batch_count = getenv_i("RUN_OPT_BATCH_COUNT");
const int batch_size = getenv_i("RUN_OPT_BATCH_SIZE");
const int image_size = getenv_i("RUN_OPT_IMAGE_SIZE");

const std::string images_dir = getenv_s("CK_ENV_DATASET_IMAGENET_PREPROCESSED_DIR");
const std::string images_file = getenv_s("CK_ENV_DATASET_IMAGENET_PREPROCESSED_SUBSET_FOF");
const std::string result_dir = getenv_s("CK_RESULTS_DIR");
const std::string input_layer_name = getenv_s("CK_ENV_TENSORFLOW_MODEL_INPUT_LAYER_NAME");
const std::string output_layer_name = getenv_s("CK_ENV_TENSORFLOW_MODEL_OUTPUT_LAYER_NAME");
const int batch_count = getenv_i("CK_BATCH_COUNT");
const int batch_size = getenv_i("CK_BATCH_SIZE");
const int image_size = getenv_i("CK_ENV_DATASET_IMAGENET_PREPROCESSED_INPUT_SQUARE_SIDE");
const int num_channels = 3;
const int num_classes = 1000;
const bool normalize_img = getenv_i("RUN_OPT_NORMALIZE_DATA") != 0;
const bool subtract_mean = getenv_i("RUN_OPT_SUBTRACT_MEAN") != 0;
const bool full_report = getenv_i("RUN_OPT_SILENT_MODE") == 0;
const bool normalize_img = getenv_s("CK_ENV_TENSORFLOW_MODEL_NORMALIZE_DATA") == "YES";
const bool subtract_mean = getenv_s("CK_ENV_TENSORFLOW_MODEL_SUBTRACT_MEAN") == "YES";
const bool full_report = getenv_i("CK_SILENT_MODE") == 0;

const std::string graph_file = getenv_s("CK_ENV_TENSORFLOW_MODEL_TFLITE_FILEPATH");
const std::string data_layout = getenv_s("ML_MODEL_DATA_LAYOUT");


BenchmarkSettings() {
// Print settings
Expand Down

0 comments on commit ecec350

Please sign in to comment.