-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Resize image to fixed size #7925
Comments
I use the function image.fixed_crop to get a new image with a new size.
Besides,you can /tools/im2rec.py to resize image when generating .rec file. |
|
@ZiyueHuang Thanks for the method. That is what I had wanted. But now, I am unable to understand how to use this |
You can use cv2.imresize for convenience. Methods in mx.image use mx.ndarray internally for effiency. You can refer to mx.image.ImageIter in document for some examples of Augmenters.
On 09/18/2017 22:20, Prasad9 wrote:
@ZiyueHuang Thanks for the method. That is what I had wanted. But now, I am unable to understand how to use this Augmenter class. Because, there is no input for image (src) like methods of mx.image.random_crop have.
Even in various subclasses of DataIter class, there seems to be no attribute to assign Augmenter. Please can you show with one example how to do it? It will be really helpful. If you have some documentation with examples or somewhere this has already been demonstrated, which I am not able to find, that will also be helpful.
Thanks again for the all help.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Maybe this can help you: "https://github.com/jiarenyf/mxWrapper/blob/02fd9b0fcd37f7224648efad651a6f83a1f06d78/mxHelper/mxData.py#L93" . |
Thanks @ZiyueHuang and @jiarenyf . Figured it out how to use it with ImageIter. But for the particular usecase I wanted, Augmenter with ImageIter was not going to be useful as different image was having different sizes and I don't believe creating separate ImageIter for each and every image was a good solution. So if you have multiple images with multiple sizes, I believe using cv2.resize directly is a good choice. Closing this issue now. |
I would like to resize image to a fixed size. Currently I am able to find method like mxnet.image.resize_short which resizes image maintaining the aspect ratio but I would like to resize image removing the aspect ratio. Like I wish to resize image from (700, 1000) to (224, 224). Is there any method which does in MXNet?
Thanks in advance for the help.
The text was updated successfully, but these errors were encountered: