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

[R] call im2rec in R #7273

Closed
thirdwing opened this issue Jul 31, 2017 · 8 comments
Closed

[R] call im2rec in R #7273

thirdwing opened this issue Jul 31, 2017 · 8 comments

Comments

@thirdwing
Copy link
Contributor

No description provided.

@thirdwing thirdwing added the R label Jul 31, 2017
@kimtang
Copy link

kimtang commented Aug 6, 2017

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.

@thirdwing
Copy link
Contributor Author

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

@kimtang
Copy link

kimtang commented Aug 8, 2017

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.

@thirdwing
Copy link
Contributor Author

thirdwing commented Aug 8, 2017

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

thirdwing added a commit to thirdwing/mxnet that referenced this issue Aug 8, 2017
thirdwing added a commit to thirdwing/mxnet that referenced this issue Aug 9, 2017
Guneet-Dhillon pushed a commit to Guneet-Dhillon/mxnet that referenced this issue Sep 13, 2017
@areobe
Copy link

areobe commented Sep 26, 2017

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.

@hadjipantelis
Copy link

I agree with @areobe. This killed the R bindings on a system with no OpenCV.

@anirudhacharya
Copy link
Member

@sandeep-krishnamurthy please label - "Feature Request"

@leezu
Copy link
Contributor

leezu commented Jan 13, 2020

Let's track the bugs introduced by #7389 separately. I opened #17282

Currently this feature request of this issue has been implemented, though breaking other use-cases that were previously supported.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants