[R] call im2rec in R
This is indeed needed. Currently we can create the rec files using python but to be able to stay completely in R is an advantage. All we need is a To-Do list to outline the work to be done to be able to create the rec files from R.
I think this shouldn't be too hard. I always used the C++ version of im2rec from https://github.com/apache/incubator-mxnet/blob/master/tools/im2rec.cc
Yes, it should not be that difficult but im2rec depends on opencv and this is not available in R. Can someone please confirm? As far as I can see we need to export the functions MXRecordIOWriterCreate,MXRecordIOReaderReadRecord,MXRecordIOWriterWriteRecord and MXRecordIOReaderFree to R. And this is done in mxnetR is by registering these functions using something like MXNET_REGISTER_IO_ITER. See ~\src\io\iter_image_recordio_2.cc (line 599).
If we are able to adapt this then it should be fairly simple to write the im2rec function in R.
First, OpenCV is optional. It is not available in the pre-built pkg. However, you can add OpenCV support when compiling from source.
Second, I don't think we need to implement im2rec in R, since we have a C++ implementation. We just need to call it from R. This is almost done in https://github.com/thirdwing/mxnet/tree/iss7273
This breaks compiling the R package even if USE_OPENCV=0 is used in config.mk. Since using OpenCV is optional, I think the R package and imports should respect the settings in config.mk.
I agree with @areobe. This killed the R bindings on a system with no OpenCV.
@sandeep-krishnamurthy please label - "Feature Request"
Let's track the bugs introduced by #7389 separately. I opened https://github.com/apache/incubator-mxnet/issues/17282
Currently this feature request of this issue has been implemented, though breaking other use-cases that were previously supported.