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 2018/10/27 23:15:41 UTC

[GitHub] lanking520 opened a new pull request #12995: [MXNET-1180] Scala Image API

lanking520 opened a new pull request #12995: [MXNET-1180] Scala Image API
URL: https://github.com/apache/incubator-mxnet/pull/12995
 
 
   ## Description ##
   Start a migration of this https://mxnet.incubator.apache.org/api/python/image/image.html to Scala world. Tested locally on my Mac and it's been much simpler to load the image to NDArray. It allows Scala and all other JVM language to call OpenCV package, here is the current exposed functions:
   
   Here is the exposed OpenCV function:
   - `imdecode`: Decode a byte array image into NDArray. Really helpful to allow memory loading for fast inference.
   - `imread`: Read image from a file and convert it into NDArray
   - `imresize`: Resize an image
   - `imCopyMakeBorder`: It used to draw the border for the image. (To be honest, I am not sure why MXNet enable this feature) @szha if you know Gluon use this somewhere.
   
   In order to make these functions more java-friendly, I created some extended functions for that:
   - `imDecode`: Take input as a `Byte []`
   - `imDecodeURL`: Take input as URL and do socket buffer reading. (Thanks @frankfliu to help me understand the context behind it)
   - `fixedCrop`: Crop the NDArray image to a fixed size
   - `toImage`: convert and NDArray to image (yes, I am not try to sell my image :) @gigasquid)
   
   These functions can be called from Imperative invoke and can be generated. The reason I haven't generate those is because the generated function is not very user-friendly and I need to change some comments field to make something clear.
   @nswamy @yzhliu 
   
   ## Checklist ##
   ### Essentials ###
   Please feel free to remove inapplicable items for your PR.
   - [ ] The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant [JIRA issue](https://issues.apache.org/jira/projects/MXNET/issues) created (except PRs with tiny changes)
   - [ ] Changes are complete (i.e. I finished coding on this PR)
   - [ ] All changes have test coverage:
   - Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
   - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
   - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
   - [ ] Code is well-documented: 
   - For user-facing API changes, API doc string has been updated. 
   - For new C++ functions in header files, their functionalities and arguments are documented. 
   - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
   - Check the API doc at http://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
   - [ ] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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