Skip to main content

A pure python library that implements abstraction of data.

Project description

pyrebel

A pure python library that implements abstraction of data.

Installation

From PyPI

python3 -m pip install --upgrade pyrebel

From source

git clone https://github.com/ps-nithin/pyrebel
cd pyrebel
python3 -m pip install .

Running demo programs

Demo programs are found in 'demo/' directory.
cd demo/

1. Image abstraction demo

Usage:
python3 pyrebel_main.py --input <filename.png>

Optional arguments
--abs_threshold <value> Selects the threshold of abstraction. (Defaults to 5)

For example,
python3 pyrebel_main.py --input images/abc.png --abs_threshold 10

The output is written to 'output.png'

2. Edge detection demo

This is a demo of edge detection achieved using data abstraction.
Usage:
python3 pyrebel_main_edge.py --input <filename>

For example,
python3 pyrebel_main_edge.py --input images/wildlife.jpg

The output is written to 'output.png'. Below is a sample input image,


Below is the output image,

3. 2D sketch demo

This is a demo of 2D sketch formation using data abstraction.
Usage:
python3 pyrebel_main_vision.py --input <filename>

Optional arguments for tweaking the result,

  1. --edge_threshold <value> Selects the threshold of edge detection.(Defaults to 5)
  2. --abs_threshold <value> Selects the threshold of output abstraction. (Defaults to 10)
  3. --bound_threshold <value> Selects the threshold of boundary size. (Defaults to 100)

For example,
python3 pyrebel_main_vision.py --input images/lotus.jpg

Below is a sample input image,


Below is the output image,

4. Pattern recognition demo

This is a demo of pattern recognition achieved using data abstraction.

  1. Learning
    Usage: python3 pyrebel_main_learn.py --learn /path/to/image/directory/
    For example running python3 pyrebel_main_learn.py --learn images/train-hand/ learns all the images in the directory and links the filename with the signatures.

  2. Recognition
    Usage: python3 pyrebel_main_learn.py --recognize <filename>
    For example running python3 pyrebel_main_learn.py --recognize images/recognize.png displays the symbols recognized in the file 'images/recognize.png'.

To reset the knowledge base just delete file 'know_base.pkl' in the current working directory. The program expects a single pattern in the input image. Otherwise, a pattern has to be selected by changing variable 'blob_index' accordingly.

Docs here

Read more about abstraction here

Let the data shine!

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

pyrebel-1.1.5.tar.gz (51.3 kB view details)

Uploaded Source

File details

Details for the file pyrebel-1.1.5.tar.gz.

File metadata

  • Download URL: pyrebel-1.1.5.tar.gz
  • Upload date:
  • Size: 51.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for pyrebel-1.1.5.tar.gz
Algorithm Hash digest
SHA256 e9bceb6d5ab0d63240e497eded1a9c8575c6ba5b820fc1a65e978adf249559ca
MD5 b60af81d79855214c298058766e76f84
BLAKE2b-256 28166dca392d8ded575582448348c9ce004b33517c0b69a36979b044cf2ff9a1

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