Is it possible to view numpy array as image while debugging in PyCharm?
I tried to enter
PIL.Image.fromarray(my_data, 'RGB').show()
into watches, but got
PIL is not defined
error. This is probably because PIL was not imported in current module.
Any other way appreciated. May be can write my own viewer or something?
Images are an easier way to represent the working model. In Machine Learning, Python uses the image data in the format of Height, Width, Channel format. i.e. Images are converted into Numpy Array in Height, Width, Channel format.
Press the Autoscroll to Trace toggle button on the toolbar. After that, on clicking a node in the Events pane, PyCharm shows its call stack in the Event Stack pane aqnd opens the corresponding trace file in the editor.
I've just created OpenCV Image Viewer Plugin, which displays image while debugging just on click. You can install it to any JetBrains IDE, which support Python (directly or via plugin).
https://plugins.jetbrains.com/plugin/14371-opencv-image-viewer
I was able to import packages with semicolon, and was able to show image with expression like below:
import matplotlib; matplotlib.pyplot.imshow(mydata)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With