Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: why randomly transform image during test evalution? #15

Closed
jmidwint opened this issue Jun 27, 2018 · 1 comment
Closed

Question: why randomly transform image during test evalution? #15

jmidwint opened this issue Jun 27, 2018 · 1 comment

Comments

@jmidwint
Copy link

Hi,
More of a question, then an issue at the moment, to try to understand ..

I run the evaluation.py with the test set and the best trained model, and am able to reproduce the results as per table 1 in the paper.

However, when running evaluation.py on the test set, this would eventually lead to invoking your next function, which then invokes the _get_batches_of_transformed_samples, which gets test images to build a batch. But it also does a random transformation of each image (see *** below in code snip).

I would think that you would want to do evaluation of performance on the actual images and not on images that are getting randomly transformed. Can you explain why you apply random transform on test set images and why not just do random transform during training?

Thanks.

def _get_batches_of_transformed_samples(self, index_array) :
"""
Public function to fetch next batch.
# Returns
The next batch of images and labels.
"""
.. snip

Build batch of image data

    for i, j in enumerate(index_array):
        fname = self.filenames[j]
        x = img_utils.load_img(os.path.join(self.directory, fname),
                grayscale=grayscale,
                crop_size=self.crop_size,
                target_size=self.target_size)

        x = self.image_data_generator.random_transform(x)    ***** why do this during test evaluation?
        x = self.image_data_generator.standardize(x)
        batch_x[i] = x

..snip

@jmidwint
Copy link
Author

Now answering my own question ... the call to random_transform doesn't do any transformation as the base class ImageDataGenerator was initialized with all the transformation parameters turned off. Doh!

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

No branches or pull requests

1 participant