Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-502] Fixing broken feature_extract cpp example #11114

Merged
merged 13 commits into from
Jun 2, 2018
Prev Previous commit
Next Next commit
update the files
  • Loading branch information
ThomasDelteil committed May 31, 2018
commit 7ae246d86919c5fabc6db765042195cacabb1165
4 changes: 2 additions & 2 deletions cpp-package/example/feature_extract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ This example shows how to extract features with a pretrained model.

Execute `run.sh` to:
- Download a pretrained model
- Download sample pictures (`1.jpg` and `2.jpg`)
- Download sample pictures (`dog.jpg` and `cat.jpg`)
- Compile the files
- Execute the featurization on `1.jpg` and `2.jpg`
- Execute the featurization on `dog.jpg` and `cat.jpg`

Note:
1. The filename of network parameters may vary, line 67 in `feature_extract.cpp` should be updated accordingly.
Expand Down
2 changes: 1 addition & 1 deletion cpp-package/example/feature_extract/feature_extract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class FeatureExtractor {
data.Slice(0, 1) -= mean_img;
data.Slice(1, 2) -= mean_img;
args_map["data"] = data;
/*bind the excutor*/
/*bind the executor*/
executor = net.SimpleBind(global_ctx, args_map, map<string, NDArray>(),
map<string, OpReqType>(), aux_map);
executor->Forward(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ using namespace std;

/*read images and store them the NDArray format that MXNet.cpp can handle*/
void Mat2Array() {
string file_name_list[] = {"./1.jpg", "./2.jpg"};
string file_name_list[] = {"./dog.jpg", "./cat.jpg"};

std::vector<float> array;
for (auto &t : file_name_list) {
Expand Down
6 changes: 3 additions & 3 deletions cpp-package/example/feature_extract/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
# Getting the data
mkdir -p model
wget -nc http://data.dmlc.ml/mxnet/models/imagenet/inception-bn.tar.gz
wget -nc -O 1.jpg https://github.com/dmlc/web-data/blob/master/mxnet/doc/tutorials/python/predict_image/cat.jpg?raw=true
wget -nc -O 2.jpg https://github.com/dmlc/web-data/blob/master/mxnet/doc/tutorials/python/predict_image/dog.jpg?raw=true
wget -nc -O model/mean_224.nd https://github.com/h2oai/deepwater/raw/master/mxnet/src/main/resources/deepwater/backends/mxnet/models/Inception/mean_224.nd
wget -nc -O cat.jpg https://github.com/dmlc/web-data/blob/master/mxnet/doc/tutorials/python/predict_image/cat.jpg?raw=true
wget -nc -O dog.jpg https://github.com/dmlc/web-data/blob/master/mxnet/doc/tutorials/python/predict_image/dog.jpg?raw=true
wget -nc -O model/mean_224.nd https://github.com/dmlc/web-data/raw/master/mxnet/example/feature_extract/mean_224.nd
tar -xvzf inception-bn.tar.gz -C model --skip-old-files

# Building
Expand Down