File | Date | Author | Commit |
---|---|---|---|
.github | 2025-01-31 |
![]() |
[7d5ea8] Create FUNDING.yml |
demo | 3 days ago |
![]() |
[842752] Minor changes |
docs | 2025-03-04 |
![]() |
[99bb8c] Delete docs/temp |
images | 2025-04-09 |
![]() |
[0b2e22] Add files via upload |
src | 2025-08-07 |
![]() |
[40855c] v1.2.0 - Support for multiple patterns. |
LICENSE.txt | 2025-01-06 |
![]() |
[c1f99d] Add files via upload |
README.md | 2025-08-09 |
![]() |
[ba8fff] Update README.md |
pyproject.toml | 2025-08-08 |
![]() |
[3fc515] Minor changes |
A pure python library that implements abstraction of data.
python3 -m pip install --upgrade pyrebel
git clone https://github.com/ps-nithin/pyrebel
cd pyrebel
python3 -m pip install .
Demo programs are found in 'demo/' directory.
cd 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'
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,
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,
This is a demo of abstract painting using data abstraction. The output of edge detection is painted to obtain the desired output.
Usage:
python3 pyrebel_main_paint.py --input <filename>
Optional arguments for tweaking the result,
1. --edge_threshold <value>
Selects the threshold of edge detection. (Defaults to 10).
2. --paint_threshold <value>
Selects the threshold of painting. (Defaults to 5).
3. --block_threshold <value>
Selects the threshold of block size. (Defaults to 20).
For example,
Running python3 pyrebel_main_paint.py --input images/elephant.jpg --edge_threshold 10 --block_threshold 50 --paint_threshold 1
Below is the sample input image,
Below is the output image,
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.
3. 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.
For learning / recognizing multiple patterns, use demo script pyrebel_main_learn_multiple.py
instead of pyrebel_main_learn.py
.