Closed bergwerf closed 6 years ago
I did not work on the Python code, so my analysis is not expert, but here is my read of it:
evaluate
, the images
variable begins life as a list of file paths from the Click framework.dataset_creation.dataset_to_examples_in_tfrecord
as the list_of_image_globs
, which reads the images from disk and writes out stuff to the specified output_directory
. Specifically, the dataset_to_examples_in_tfrecord
function calls convert_to_examples
which writes TFRecord
objects to disk.evaluate
, the path(s) to the written TFRecord
data is assigned to the variable tfexamples_tfrecord_file_pattern
.tfexamples_tfrecord_file_pattern
is passed to data_provider.provide_data
, with the result being assigned into the images
variable again, replacing the file paths with batch_images
, described as "a Tensor
of size [batch_size, patch_width, patch_width, 1]."@samueljyang, please correct me if I am wrong.
I am also curious what happens when the patches do not align
What I observed is that partial patches along the bottom and right edges are not considered.
I am studying this source code (and in particular the underlying libraries) to figure out how to implement a similar plugin. In this plugin it seems the entire image is feeded in as one tensor: https://github.com/fiji/microscope-image-quality/blob/3ac47e8fb8e9dd3de6f7a8dc339ca0aacd390798/src/main/java/sc/fiji/imageFocus/MicroscopeImageFocusQualityClassifier.java#L176. As far as I can tell the model in the original code is constructed for patches (e.g. https://github.com/google/microscopeimagequality/blob/7431730eb939c662655561de99f4c2445f94cb87/microscopeimagequality/miq.py#L97). So far I have been unable to figure out where exactly the conversion from a full image to a stack of patches is done. Perhaps someone who worked on this plugin can point this out? (then I can do the same for my case so I don't have to take care of the patches myself). I am also curious what happens when the patches do not align, from trying this plugin it seems the edge edge were no patches can be fitted is just ignored (rather than shifting and having overlapping patches as a result).