This repository has been archived by the owner. It is now read-only.

Add support for ImageTransform to ObjectDetectionRecordReader #432

Merged
merged 2 commits into from Oct 11, 2017

Conversation

Projects
None yet
2 participants
@saudet
Copy link
Member

saudet commented Sep 25, 2017

WORK IN PROGRESS: DO NOT MERGE.

Related to issue #417

What changes were proposed in this pull request?

Add ImageTransform.query(coordinates) method so that ObjectDetectionRecordReader can use it to transform coordinates.

How was this patch tested?

New unit tests pass.

@saudet saudet requested a review from AlexDBlack Sep 25, 2017

@AlexDBlack
Copy link
Member

AlexDBlack left a comment

LGTM - just minor javadoc + annotations required, then this should be good to go.

* @param gridH Grid/quantization size (along height dimension) - Y axis
* @param gridW Grid/quantization size (along height dimension) - X axis
* @param labelProvider ImageObjectLabelProvider - used to look up which objects are in each image
* @param imageTransform ImageTransform - used to transform image and coordinates

This comment has been minimized.

@AlexDBlack

AlexDBlack Sep 25, 2017

Member

Maybe note the "object is removed if new center is outside of transformed image bounds" thing

double cx = io.getXCenterPixels();
double cy = io.getYCenterPixels();
if (cx < 0 || cx >= oW || cy < 0 || cy >= oH) {
continue;

This comment has been minimized.

@AlexDBlack
@@ -93,5 +93,7 @@ public ImageWritable transform(ImageWritable image, Random random) {
return new ImageWritable(converter.convert(result));
}


public float[] query(float... coordinates) {

This comment has been minimized.

@AlexDBlack

AlexDBlack Sep 25, 2017

Member

Need @Override annotation on all the query methods

@saudet

This comment has been minimized.

Copy link
Member

saudet commented Oct 4, 2017

Thanks for the feedback! If there are no other issues, I'll be merging this. It also fixes #433.

@AlexDBlack AlexDBlack merged commit da20906 into master Oct 11, 2017

@AlexDBlack AlexDBlack deleted the sa_imageinput branch Oct 11, 2017

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