srwi / PyCharm-PixelLens

Free PyCharm image viewer plugin for visualizing and debugging NumPy, OpenCV, PyTorch, TensorFlow, JAX, and PIL data.
https://plugins.jetbrains.com/plugin/25039-pixellens
GNU General Public License v3.0
21 stars 0 forks source link

can not view image #34

Open zylo117 opened 2 weeks ago

zylo117 commented 2 weeks ago

An exception occurred in the plugin.

Environment:

Exception details:

null
java.base/sun.nio.ch.PendingFuture.get(PendingFuture.java:195)
com.github.srwi.pixellens.dataTransmitters.SocketDataTransmitter.waitForClientConnection(SocketDataTransmitter.kt:67)
com.github.srwi.pixellens.dataTransmitters.SocketDataTransmitter.getJsonData(SocketDataTransmitter.kt:39)
com.github.srwi.pixellens.imageProviders.ImageProvider.getBatchData(ImageProvider.kt:39)
com.github.srwi.pixellens.imageProviders.ImageProvider.getBatchByExpression(ImageProvider.kt:31)
com.github.srwi.pixellens.actions.ViewAsImageAction$actionPerformed$1.run(ViewAsImageAction.kt:29)
com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:477)
com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:528)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:249)
com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:98)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221)
com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220)
com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:98)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:249)
com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:501)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:466)
com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97)
com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92)
com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:464)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
java.base/java.lang.Thread.run(Thread.java:1583)

Steps to reproduce:

  1. just can't view an [224,224,3] image

Code snippet:

# Python code to reproduce the issue
srwi commented 2 weeks ago

Hi @zylo117, thank you for reporting the problem! It looks like the data transmission is not able to establish the connection. This could have different reasons. Could you please provide a minimal reproducible example so I can hopefully reproduce the problem on my end?

zylo117 commented 2 weeks ago

just put a breakpoint on line 3: print(), then I can't view image on variable img.

import cv2
img = cv2.imread('123.jpg')
print()
crop = [img for img in [img]]
srwi commented 1 week ago

I can't reproduce it here. It's hard to say what exactly could be causing the problem for you. The data transmission from the python debug process to the PyCharm instance happens via a socket network connection. It's using a random port for that. Are there any particularly restrictive settings on your machine that could prevent this socket connection from being established?

zylo117 commented 1 week ago

I can't reproduce it here. It's hard to say what exactly could be causing the problem for you. The data transmission from the python debug process to the PyCharm instance happens via a socket network connection. It's using a random port for that. Are there any particularly restrictive settings on your machine that could prevent this socket connection from being established?

I don't think so, but it could be a pycharm's bug. A while ago, the pycharm Debug Image Viewer plugin stopped working in this code, and your plugin doesn't work either. crop = [img for img in [img]] But if I remove the 4th line of this code, both plugins work. It's really strange. I don't understand how this line of code matters