Skip to content

Commit

Permalink
Fix: NCNN input issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinB committed Dec 14, 2018
1 parent f254c71 commit 111269a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/imginputfileconn.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,10 @@ namespace dd
#include "backends/dlib/dlibinputconns.h"
#endif

#ifdef USE_NCNN
#include "backends/ncnn/ncnninputconns.h"
#endif

#ifdef USE_CAFFE2
#include "backends/caffe2/caffe2inputconns.h"
#endif
Expand Down
26 changes: 26 additions & 0 deletions src/jsonapi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,32 @@ namespace dd
}

#endif // USE_CAFFE2

#ifdef USE_NCNN
else if (mllib == "ncnn")
{
NCNNModel ncnnmodel(ad_model);
if (type == "supervised")
{
if (input == "image")
add_service(sname, std::move(MLService<NCNNLib,ImgNCNNInputFileConn,SupervisedOutput,NCNNModel>(sname,ncnnmodel,description)), ad);
else return dd_input_connector_not_found_1004();
if (JsonAPI::store_json_blob(ncnnmodel._repo, jstr))
_logger->error("couldn't write {} file in model repository {}", JsonAPI::_json_blob_fname, ncnnmodel._repo);
// store model configuration json blob
if (store_config && JsonAPI::store_json_config_blob(ncnnmodel._repo, jstr)) {
_logger->error("couldn't write {} file in model repository {}",
JsonAPI::_json_config_blob_fname, ncnnmodel._repo);
}
}
else
{
// unknown type
return dd_service_bad_request_1006();
}
}
#endif // USE_NCNN

#ifdef USE_TF
else if (mllib == "tensorflow" || mllib == "tf")
{
Expand Down

0 comments on commit 111269a

Please sign in to comment.