You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/10/28 18:57:18 UTC
[GitHub] [incubator-mxnet] kotbegemot opened a new issue #16661: C++ Mxnet
and opencv integration
kotbegemot opened a new issue #16661: C++ Mxnet and opencv integration
URL: https://github.com/apache/incubator-mxnet/issues/16661
How to pass a lot of cv:: Mat to MXDataIter ?
``C++
auto val_iter = MXDataIter("ImageRecordIter")
.SetParam("data_shape", Shape(3, image_size, image_size))
.SetParam("batch_size", batch_size)
.SetParam("shuffle", 1)
.SetParam("flat", 1)
.SetParam("ctx", "cpu")
.CreateDataIter();
int count = 0;
Accuracy acc;
val_iter.Reset();
while (val_iter.Next()) {
auto data_batch = val_iter.GetDataBatch();
data_batch.data.CopyTo(&args_map["data"]);
NDArray::WaitAll();
exec->Forward(false);
acc.Update(data_batch.label, exec->outputs[0]);
}
delete exec;
MXNotifyShutdown();
return 0;
``
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services