# pyrebel
A pure python library that implements abstraction of data.<br><br>
<img src="https://github.com/ps-nithin/pyrebel/raw/f5319cf6d9fbc6c678f3a1038af09c5b84fa97ca/images/animation.gif"></img>
# Installation
## From PyPI
```python3 -m pip install --upgrade pyrebel```
## From source
```git clone https://github.com/ps-nithin/pyrebel```<br>
```cd pyrebel```<br>
```python3 -m pip install .```<br>
# Running demo programs
Demo programs are found in 'demo/' directory.<br>
```cd demo/```
## 1. Image abstraction demo
Usage:<br>
```python3 pyrebel_main.py --input <filename.png>```<br><br>
Optional arguments<br>
```--abs_threshold <value>``` Selects the threshold of abstraction. (Defaults to 5)<br><br>
For example,<br>
```python3 pyrebel_main.py --input images/abc.png --abs_threshold 10```<br><br>
The output is written to 'output.png'
## 2. Edge detection demo
This is a demo of edge detection achieved using data abstraction.<br>
Usage:<br>
```python3 pyrebel_main_edge.py --input <filename>```<br><br>
For example,<br>
```python3 pyrebel_main_edge.py --input images/wildlife.jpg```<br><br>
The output is written to 'output.png'.
Below is a sample input image,<br><br>
<img src="https://github.com/ps-nithin/pyrebel/raw/c3ee0182aa5646a834d1e8c1f18c30d5bacd378d/images/small_wildlife.jpg"></img><br>Below is the output image,<br><br><img src="https://github.com/ps-nithin/pyrebel/raw/223e442aa8cdc34972f5c37d7a91240f725b7beb/images/output_wildlife.png"></img>
## 3. 2D sketch demo
This is a demo of 2D sketch formation using data abstraction.<br>
Usage:<br>
```python3 pyrebel_main_vision.py --input <filename>```<br><br>
Optional arguments for tweaking the result,<br>
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)<br><br>
For example,<br>
```python3 pyrebel_main_vision.py --input images/lotus.jpg```<br><br>
Below is a sample input image,<br><br>
<img src="https://github.com/ps-nithin/pyrebel/raw/0ffc49de07c814862d26468ccf95e34a3afba50b/images/small_lotus.jpg"></img><br>Below is the output image,<br><br><img src="https://github.com/ps-nithin/pyrebel/raw/25212f87e81954a884a80386bea1bb46e931cfe6/images/output_lotus.png"></img>
## 4. Abstract painting
This is a demo of abstract painting using data abstraction. The output of edge detection is painted to obtain the desired output.<br>
Usage:<br>
```python3 pyrebel_main_paint.py --input <filename>```<br><br>
Optional arguments for tweaking the result,<br>
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).<br><br>
For example,<br>
Running ```python3 pyrebel_main_paint.py --input images/elephant.jpg --edge_threshold 10 --block_threshold 50 --paint_threshold 1```<br><br>
Below is the sample input image,<br><br>
<img src="https://github.com/ps-nithin/pyrebel/raw/4ad41676cdc3dde417e0bcc1cedad2b597f57fba/images/small_elephant.jpg"></img><br>Below is the output image,<br><br><img src="https://github.com/ps-nithin/pyrebel/raw/0b2e226a716097ad0839bfdd0d097dcad3b09633/images/output_elephant2.png"></img>
## 5. Pattern recognition demo
This is a demo of pattern recognition achieved using data abstraction.<br>
1. Learning<br>
Usage: ```python3 pyrebel_main_learn.py --learn /path/to/image/directory/```<br>
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.<br><br>
3. Recognition<br>
Usage: ```python3 pyrebel_main_learn.py --recognize <filename>```<br>
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 <a href="https://github.com/ps-nithin/pyrebel/blob/main/docs/DOCS.md">here</a>
# Read more about abstraction <a href="https://github.com/ps-nithin/pyrebel/blob/main/docs/intro-r2.pdf">here</a>
# Let the data shine!
Raw data
{
"_id": null,
"home_page": null,
"name": "pyrebel",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Nithin PS <nithin.pulpra@gmail.com>",
"keywords": "data, abstraction, vision, machinelearning, patternrecognition, imagerecognition",
"author": null,
"author_email": "Nithin PS <nithin.pulpra@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/c5/8e/a0b10c2a552013d4cbeee657cd1f23bef3b103138cecbe2b8a8ffeadb43a/pyrebel-1.1.14.tar.gz",
"platform": null,
"description": "# pyrebel\nA pure python library that implements abstraction of data.<br><br>\n<img src=\"https://github.com/ps-nithin/pyrebel/raw/f5319cf6d9fbc6c678f3a1038af09c5b84fa97ca/images/animation.gif\"></img>\n\n# Installation\n## From PyPI\n```python3 -m pip install --upgrade pyrebel```\n## From source\n```git clone https://github.com/ps-nithin/pyrebel```<br>\n```cd pyrebel```<br>\n```python3 -m pip install .```<br>\n\n# Running demo programs\nDemo programs are found in 'demo/' directory.<br>\n```cd demo/```\n\n## 1. Image abstraction demo\nUsage:<br>\n```python3 pyrebel_main.py --input <filename.png>```<br><br>\nOptional arguments<br>\n```--abs_threshold <value>``` Selects the threshold of abstraction. (Defaults to 5)<br><br>\nFor example,<br>\n```python3 pyrebel_main.py --input images/abc.png --abs_threshold 10```<br><br>\nThe output is written to 'output.png'\n\n## 2. Edge detection demo\nThis is a demo of edge detection achieved using data abstraction.<br>\nUsage:<br>\n```python3 pyrebel_main_edge.py --input <filename>```<br><br>\nFor example,<br>\n ```python3 pyrebel_main_edge.py --input images/wildlife.jpg```<br><br>\n The output is written to 'output.png'.\n Below is a sample input image,<br><br>\n <img src=\"https://github.com/ps-nithin/pyrebel/raw/c3ee0182aa5646a834d1e8c1f18c30d5bacd378d/images/small_wildlife.jpg\"></img><br>Below is the output image,<br><br><img src=\"https://github.com/ps-nithin/pyrebel/raw/223e442aa8cdc34972f5c37d7a91240f725b7beb/images/output_wildlife.png\"></img>\n\n## 3. 2D sketch demo\nThis is a demo of 2D sketch formation using data abstraction.<br>\nUsage:<br>\n```python3 pyrebel_main_vision.py --input <filename>```<br><br>\nOptional arguments for tweaking the result,<br>\n 1. ```--edge_threshold <value>``` Selects the threshold of edge detection.(Defaults to 5)\n 2. ```--abs_threshold <value>``` Selects the threshold of output abstraction. (Defaults to 10)\n 3. ```--bound_threshold <value>``` Selects the threshold of boundary size. (Defaults to 100)<br><br>\n\nFor example,<br>\n```python3 pyrebel_main_vision.py --input images/lotus.jpg```<br><br>\nBelow is a sample input image,<br><br>\n<img src=\"https://github.com/ps-nithin/pyrebel/raw/0ffc49de07c814862d26468ccf95e34a3afba50b/images/small_lotus.jpg\"></img><br>Below is the output image,<br><br><img src=\"https://github.com/ps-nithin/pyrebel/raw/25212f87e81954a884a80386bea1bb46e931cfe6/images/output_lotus.png\"></img>\n## 4. Abstract painting \nThis is a demo of abstract painting using data abstraction. The output of edge detection is painted to obtain the desired output.<br>\nUsage:<br>\n```python3 pyrebel_main_paint.py --input <filename>```<br><br>\nOptional arguments for tweaking the result,<br>\n 1. ```--edge_threshold <value>``` Selects the threshold of edge detection. (Defaults to 10).\n 2. ```--paint_threshold <value>``` Selects the threshold of painting. (Defaults to 5).\n 3. ```--block_threshold <value>``` Selects the threshold of block size. (Defaults to 20).<br><br>\nFor example,<br>\nRunning ```python3 pyrebel_main_paint.py --input images/elephant.jpg --edge_threshold 10 --block_threshold 50 --paint_threshold 1```<br><br>\nBelow is the sample input image,<br><br>\n<img src=\"https://github.com/ps-nithin/pyrebel/raw/4ad41676cdc3dde417e0bcc1cedad2b597f57fba/images/small_elephant.jpg\"></img><br>Below is the output image,<br><br><img src=\"https://github.com/ps-nithin/pyrebel/raw/0b2e226a716097ad0839bfdd0d097dcad3b09633/images/output_elephant2.png\"></img>\n\n## 5. Pattern recognition demo\nThis is a demo of pattern recognition achieved using data abstraction.<br>\n1. Learning<br>\n Usage: ```python3 pyrebel_main_learn.py --learn /path/to/image/directory/```<br>\n For example running\n ```python3 pyrebel_main_learn.py --learn images/train-hand/``` learns all the images in the directory and links the filename with the signatures.<br><br>\n3. Recognition<br>\n Usage: ```python3 pyrebel_main_learn.py --recognize <filename>```<br>\n For example running\n ```python3 pyrebel_main_learn.py --recognize images/recognize.png``` displays the symbols recognized in the file 'images/recognize.png'.\n \nTo reset the knowledge base just delete file 'know_base.pkl' in the current working directory.\nThe program expects a single pattern in the input image. Otherwise, a pattern has to be selected by changing variable 'blob_index' accordingly.\n\n# Docs <a href=\"https://github.com/ps-nithin/pyrebel/blob/main/docs/DOCS.md\">here</a>\n# Read more about abstraction <a href=\"https://github.com/ps-nithin/pyrebel/blob/main/docs/intro-r2.pdf\">here</a>\n# Let the data shine!\n",
"bugtrack_url": null,
"license": null,
"summary": "A pure python library that implements abstraction of data.",
"version": "1.1.14",
"project_urls": {
"Homepage": "https://github.com/ps-nithin/pyrebel",
"Repository": "https://github.com/ps-nithin/pyrebel"
},
"split_keywords": [
"data",
" abstraction",
" vision",
" machinelearning",
" patternrecognition",
" imagerecognition"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "c58ea0b10c2a552013d4cbeee657cd1f23bef3b103138cecbe2b8a8ffeadb43a",
"md5": "405ba170e908131e541dfdc3e94de098",
"sha256": "81bb1090e5b673353300674cd5c6f22c4dfc8ea6208efb89c700b0940592703f"
},
"downloads": -1,
"filename": "pyrebel-1.1.14.tar.gz",
"has_sig": false,
"md5_digest": "405ba170e908131e541dfdc3e94de098",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 29254,
"upload_time": "2025-07-26T10:16:35",
"upload_time_iso_8601": "2025-07-26T10:16:35.490289Z",
"url": "https://files.pythonhosted.org/packages/c5/8e/a0b10c2a552013d4cbeee657cd1f23bef3b103138cecbe2b8a8ffeadb43a/pyrebel-1.1.14.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-26 10:16:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ps-nithin",
"github_project": "pyrebel",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyrebel"
}