cytomining / cytomining/DeepProfiler

DeepProfiler produces incorrect crops if provided with images of different sizes

Open
#355 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
129
Forks
52
Avg merge
5h 20m
Merged PRs (30d)
2

Description

In profiling mode, if provided with images of different sizes than the specified in the config (in `config["dataset"]["images"][{"width", "height"}]`), DP will silently generate incorrect crops.

I think the issue comes from [`get_cropping_regions()`](https://github.com/cytomining/DeepProfiler/blob/master/deepprofiler/imaging/boxes.py#L121-L122), where the config-specified image size is used to normalise the bounding indices. Note that there's no exception raised when the input image mismatches the specified shape.

I also think the [docs](https://cytomining.github.io/DeepProfiler-handbook/docs/03-images.html) are slightly confusing, as it's mentioned:

> The size of images is, in principle, flexible and DeepProfiler can work with different resolutions and image dimensions.

Please correct me if I'm wrong, but I think this is the only reason making DeepProfiler incompatible with images of variable size (for profiling) and could easily be solved by reading the image dimensions dynamically. I opened a PR to implement just that - https://github.com/cytomining/DeepProfiler/pull/354.

It'd be great if you could also update the docs to clarify how DeepProfiler handles images of variable size in training vs. profile mode.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.