Open vahvero opened 9 months ago
Thanks for the feature request @vahvero
I think what you're trying to do should be reasonably achievable by:
draw_bounding_boxes()
indiviudally, with the appropriate parameters (note that if there was a visualize_batch()
functionality, it would need to take in all of these parameters as well as the score threshold, making its API much more complex) make_grid()
to put all of those images+bboxes in a single tensor imgLMK if this isn't what you're looking for
@NicolasHug I personally feel that the parameter count would not be an issue here. Torchvision models already take a lot of default keyword parameters, so the function call signature would not be out of place for users. By using reasonable defaults, most of the functionality could be abstracted in a manner not different for model __init__
methods such as FasterRCNN.
I think that this type of function would have tangible benefit for most users. Instead of the mentioned self implemented functionality, which I suspect every every single user has either copied from the example or abstracted themselves to achieve similar behavior to this feature request, the library would offer a standardized function for it.
For me, it seems a very commonly utilized behavior which has not for some reason included into the library despite including some drawing utilities.
Having though this later, I think function
def visualize_batch(
image_batch: Tensor | list[Tensor],
batch_response: list[dict[str, Tensor]],
**visualization_arguments, # these are naturally expanded
) -> list[Tensor]:
would allow user to pass the tensors to whichever visualization library they are utilizing.
🚀 The feature
Currently vision models commonly return dictionary
This is visualized by torchvision by
Motivation, pitch
However, there is no currenly a way to visualize whole batch with a function in utilities, eg. continuing from previous
There is no currenly available method to visualize this batch for user.
I suggest an
utils
functionwhere keyword arguments relate to arguments in current
utils
functions.Alternatives
User could follow utilities example at example which implements matplotlib function
show
. This is non-ideal, as users seems to have need for similar functionality without related boilderplate code.Additional context
I am willing to contribute given green light.