GithubHelp home page GithubHelp logo

john-guo / simply-view-image-for-python-opencv-debugging Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 4.0 1.71 MB

visual studio code extension simply view the image of the image variables when debugging python with opencv

License: MIT License

TypeScript 83.92% JavaScript 16.08%

simply-view-image-for-python-opencv-debugging's People

Contributors

dependabot[bot] avatar john-guo avatar marisancans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

simply-view-image-for-python-opencv-debugging's Issues

0 to 1.0 float images not saved correctly

Hey, I have been searching for something like this extension, great work.
There is a bug when the image is in range 0..1 floats, it is not saved correctly.
There should probably be some checking: if img.dtype = np.float32 or np.float64 then img * 255.0
image

Why I can't use the extension independently?

Hello, thanks for your great extension that help me a lot. However, the extension seems doesn't work correctly.

I have tried 2 image-debugging extensions, this one and another python-image-preview, and strange things happen:

When I only enable this extension, there is no lightbulb when I debug.

image

While I enable both this extension and the python-image-preview, the two extensions work well.

image

So where is the problem?

Extension not working via ssh with x11 forwarding

Hi John! Thanks for this great extension!

I have one problem though, it doesn't seem to we working when I'm connecting via SSH to a server and use X11 Forwarding. I can see the images when I run cv2.imshow() but I don't get the the preview option when hovering on the image variable.

display the image from the debug console?

thanks for this extension this is amazing.
Would it be also possible to make it to be able to display the image when I do it in debug console.
I mean, lets say i have:

import torch as np
img = np.random.rand(100,100,3)

now I just can display the image (img) in the main file. would it be possible that I copy and paste np.random.rand(100,100,3) in the debug console like simple_view(np.random.rand(100,100,3)) and it display the image. simple_view is gonna be a function from your code that you tell us to run to see the image.

Thanks for this extension anyways :)

The extension has stopped working for me

Hello,

The extension was working amazing a couple weeks ago and now it has stopped working.
When I select the image variable, it doesn't show up the light bulb for image view.

VScode version: 1.63 (November)

Can not show the image during debugging the python code.

Hi,

I am debugging the remote python code through wsl, and the plugin can not show the image during debugging the python code.

The logs says:

[2021-01-22 11:53:54.619] [exthost] [error] [johnguo.simply-view-image-for-python-opencv-debugging] provider FAILED
[2021-01-22 11:53:54.627] [exthost] [error] Error: Unable to find thread to evaluate variable reference.
at t.RawDebugSession.handleErrorResponse (file:///C:/Users/SHData/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3369:750)
at file:///C:/Users/SHData/AppData/Local/Programs/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3369:55

image

Pls review.

Thank you !

Add TF 2 support

Hello,

Thank you so much for the great plugin. I think if you advertise it correctly, it will be helping many developers!

I wonder if you could add support for TF2 tensor arrays too. Currently, I have to manually convert tf tensors to numpy tensors with .numpy() to be able to visualize them.

Many thanks

Use of WebviewEditorInset

Hey there. For the last few days I have been experimenting with something called WebView. It essentially allows HTML rendering inside vscode.
There have been many requests over the years for vscode community to allow inline WebView render into editor.
Here is something similar to what we want: microsoft/vscode#41775
VScode has added and merged a code inset feature here: microsoft/vscode#66418
And here is their progress for WebviewEditorInset API: microsoft/vscode#85682

There is however a drawback at this moment:

  1. WebviewEditorInset is a proposed API, meaning that I don't know if this can be used is its not officially into vscode. It is like an experimental feature. But i'm pretty sure they will implement this after half a year or year (yeah, that a lot), but this has been a really requested feature and they also need it for julia lanuguage extension and jupyter notebooks.
  2. Current solution requires to copy a vscode.proposed.d.ts file for this to work
  3. VS Code insiders edition is also required for this

Heres a demo that I have managed to get working:
simplescreenrecorder-2020-06-14
There are a lot of work to be done here, but I think it looks cool.

Also, you mentioned that you have to create a /tmp directory for this, check out what storagePath is in vscode.ExtensionContext in https://code.visualstudio.com/api/references/vscode-api#ExtensionContext
I am using this directory instead of /tmp, it looks like this: /home/maris/.config/Code - Insiders/User/workspaceStorage/RANDOM-HASH/johnguo.simply-view-image-for-python-opencv-debugging/

Is this the direction we can shift instead of opening images into a new pane? We can also try to combine them, or make this as a separate experimental branch.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.