Giter Club home page Giter Club logo

wdisp's Introduction

wdisp

An imshow for showing images in a browser.

Provides an imshow function which transfers an image to the included http server for showing in a browser. Multiple images can be uploaded and viewed at the same time. The browser automatically refreshes the view if a new image is uploaded or changed.

Example

# Starts the server in a new thread.
wdisp.run_server_thread()

# im1 and im2 are numpy arrays
wdisp.imshow("image1", im1)
wdisp.imshow("image2", im2, vmin = -1, vmax = 1)

# Wait until user clicks continue in browser
wdisp.wait()

Image overview Image view

Server

The server can be run either with a blocking call, in new thread or in a new process.

wdips.run_server()
wdips.run_server_thread()
wdips.run_server_process()

By default the server listens on port 4300 but this can be changed. Also by default the server runs in daemon mode, i.e. does not keep the process alive.

The last uses the multiprocessing library, hence some attention must be paid with regards to the main module as the new process imports the main module again.

if __name__ == "__main__":
    wdips.run_server_process()

Refer to the documentation of the multiprocessing library for more details about this.

As a last option the server can also be run from the command line.

python -m wdisp

or with specifying the port

python -m wdisp --port 1000

Functions

For showing images the following functions are provided

imshow(name, image, vmin, vmax)
close(name)
close_all()
wait()

vmin and vmax are optional values, for scaling the input values for display.

wdisp's People

Contributors

mburisch avatar

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.