image processing and stuff
Project description
image2layout_computer_vision
An image processing module for some computer vision tasks (public module for image2layout)
Package Page: pypi
Features:
- Text Detection
- Color extraction (background and main foreground)
Installations
Install with python
/conda
[Linux]
- (Optional) Conda
curl https://repo.anaconda.com/archive/Anaconda3-2023.03-1-Linux-x86_64.sh -o ~/conda.sh
bash ~/conda.sh -b -f -p /opt/conda
rm ~/conda.sh
conda init --all --dry-run --verbose
conda create -n cv python=3.10 -y
conda activate cv
- Tesseract
sudo apt install tesseract-ocr libtesseract-dev -y
- Python libraries (python>=3.8)
python -m pip install 'torch>=2.0' torchvision torchaudio
python -m pip install Pillow pandas numpy scikit-learn pyyaml==5.1 chardet pytesseract
python -m pip install --upgrade datasets transformers
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
python -m pip install --upgrade image2layout-computer-vision
Install with docker
Replace Dockerfile_cpu
with Dockerfile
if running with GPU
API Implementation is in-progress
sudo docker build --tag cv -f Dockerfile_cpu .
sudo docker run -it -v $(pwd):/app cv bash
Usage
- Run this python code to pre-download model weights
from image2layout_computer_vision import model_dispatch_layout
model_dispatch_layout._load()
- Detect texts
import image2layout_computer_vision as icv
# ImageBoxes object
imageboxes = icv.detect_text('path/to/image.png')
# boxes_merged = merged boxes (sentences), boxes_raw = all boxes (words)
boxes_merged, boxes_raw = icv.detect_text_boxes('path/to/image.png')
- Extract colors
import image2layout_computer_vision as icv
color_bg, color_fg = icv.extract_colors('path/to/image.png')
Build
(for building and uploading this package)
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
rm -rf dist
python -m build
python -m twine upload dist/* --verbose
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for image2layout_computer_vision-0.0.7.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e98d5cc8c1dd43a02fc519d593d849b408896ff0adfe6fa8a314009e429c4bb0 |
|
MD5 | 771406d717b0d975c425f7753eb02131 |
|
BLAKE2b-256 | 541d94e26c5c73fc0de4529c1fae8bd52acb11188a26130df0a3e52b62972143 |
Close
Hashes for image2layout_computer_vision-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 831e55a8417461773fa51e178264be387113cacada2f28904fff721244b2de7a |
|
MD5 | dc35c045e3371d8ec4c3b82614e99a09 |
|
BLAKE2b-256 | 9bedcb200b142311ea5e3cbab787b5fc37e30676330dd921382c4b8960bde60a |