Skip to main content

"A web wrapper for opencv that supports displaying via web browsers."

Project description

Webcv

Webcv is a simple wrapper that can implements displaying images, text, and tables via web browsers.

This project is based on quart that requires python 3.7+. For older version of Python, please use webcv-gevent instead.

Installation

pip install webcv

Sample Usage

import sys

import numpy as np
from webcv import webcv


webcv.head_show("h1", "Test image show")

image = np.random.randint(0, 256, (256, 256, 3), dtype=np.uint8)

webcv.imshow("image", image)
webcv.imshow("resize using webcv", webcv.resize(image, (512, 512)))

# response in 30 seconds
webcv.waitKey(30000)

webcv.head_show("h1", "Test table show")
webcv.table_show("versions", [
    ["python", "opencv", "webcv"],
    [f"version {'.'.join(str(v) for v in sys.version_info)}", cv.__version__, webcv.__version__],
    ])

webcv.waitKey()

By running the code above, your terminal will display something like:

#####################################################################
#                                                                   #
#   The server is running at: http://my-server-ip:4732              #
#                                                                   #
#####################################################################
 * Serving Quart app 'webcv'
 * Environment: production
 * Please use an ASGI server (e.g. Hypercorn) directly in production
 * Debug mode: False
 * Running on http://0.0.0.0:4732 (CTRL + C to quit)

Copy paste the address into your browser to view (you may need ssh forward if you are using a remote server):

screenshot

Acknowledgement

The project was inspired by a Megvii tool.

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

webcv-1.0.3.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

webcv-1.0.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file webcv-1.0.3.tar.gz.

File metadata

  • Download URL: webcv-1.0.3.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for webcv-1.0.3.tar.gz
Algorithm Hash digest
SHA256 5c0f8d9c81cdec5257db29830a68d11e154d5d03ef396d0b75c4c5d0757cdab3
MD5 91262bc8b3f00b2ad9c4c068e58d570f
BLAKE2b-256 684d25b85f8f4b0297ed43a664d39a7a05f5a82547db723f64946876d9515774

See more details on using hashes here.

File details

Details for the file webcv-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: webcv-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6

File hashes

Hashes for webcv-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f02f98003e1729e1f94f7b642b2a7fd6b9940b9beb4b88f656a8ecd98b2a0e69
MD5 c821cab0f99238c81798290445135cfb
BLAKE2b-256 c1daffa92f83c23f2251c6e541af32655eca49370645a6c4da08aaf927f56267

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page