
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Implements Sinapsis templates to perform optical character recognition on images
🐍 Installation • 📦 Packages • 🚀 Features • 📚 Usage example • 🌐 Webapp • 📙 Documentation • 🔍 License
Sinapsis OCR provides powerful and flexible implementations for extracting text from images using different OCR engines. It enables users to easily configure and run OCR tasks with minimal setup.
This mono repo consists of different packages for OCR:
sinapsis-doctr
sinapsis-easyocr
Install using your package manager of choice. We encourage the use of uv
Example with uv
:
uv pip install sinapsis-doctr --extra-index-url https://pypi.sinapsis.tech
or with raw pip
:
pip install sinapsis-doctr --extra-index-url https://pypi.sinapsis.tech
Change the name of the package for the one you want to install.
[!IMPORTANT] Templates in each package may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:
with uv
:
uv pip install sinapsis-doctr[all] --extra-index-url https://pypi.sinapsis.tech
or with raw pip
:
pip install sinapsis-doctr[all] --extra-index-url https://pypi.sinapsis.tech
[!TIP] You can also install all the packages within this project:
uv pip install sinapsis-ocr[all] --extra-index-url https://pypi.sinapsis.tech
Sinapsis DocTR
Sinapsis EasyOCR
[!TIP] Use CLI command
sinapsis info --all-template-names
to show a list with all the available Template names installed with Sinapsis OCR.
[!TIP] Use CLI command
sinapsis info --example-template-config TEMPLATE_NAME
to produce an example Agent config for the Template specified in TEMPLATE_NAME.
For example, for DocTROCRPrediction use sinapsis info --example-template-config DocTROCRPrediction
to produce an example config.
agent:
name: doctr_prediction
description: agent to run inference with DocTR, performs on images read, recognition and save
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: FolderImageDatasetCV2
class_name: FolderImageDatasetCV2
template_input: InputTemplate
attributes:
data_dir: dataset/input
- template_name: DocTROCRPrediction
class_name: DocTROCRPrediction
template_input: FolderImageDatasetCV2
attributes:
recognized_characters_as_labels: True
- template_name: BBoxDrawer
class_name: BBoxDrawer
template_input: DocTROCRPrediction
attributes:
draw_confidence: True
draw_extra_labels: True
- template_name: ImageSaver
class_name: ImageSaver
template_input: BBoxDrawer
attributes:
save_dir: output
root_dir: dataset
agent:
name: easyocr_inference
description: agent to run inference with EasyOCR, performs on images read, recognition and save
templates:
- template_name: InputTemplate
class_name: InputTemplate
attributes: {}
- template_name: FolderImageDatasetCV2
class_name: FolderImageDatasetCV2
template_input: InputTemplate
attributes:
data_dir: dataset/input
- template_name: EasyOCR
class_name: EasyOCR
template_input: FolderImageDatasetCV2
attributes: {}
- template_name: BBoxDrawer
class_name: BBoxDrawer
template_input: EasyOCR
attributes:
draw_confidence: True
draw_extra_labels: True
- template_name: ImageSaver
class_name: ImageSaver
template_input: BBoxDrawer
attributes:
save_dir: output
root_dir: dataset
To run, simply use:
sinapsis run name_of_the_config.yml
The webapp provides a simple interface to extract text from images using OCR. Upload your image, and the app will process it and display the detected text with bounding boxes.
[!IMPORTANT] To run the app you first need to clone this repository:
git clone https://github.com/Sinapsis-ai/sinapsis-ocr.git
cd sinapsis-ocr
[!NOTE] If you'd like to enable external app sharing in Gradio,
export GRADIO_SHARE_APP=True
[!TIP] The agent configuration can be updated using the AGENT_CONFIG_PATH environment var. For default uses the config for easy ocr but this can be chaged with:
AGENT_CONFIG_PATH=/app/packages/sinapsis_doctr/src/sinapsis_doctr/configs/doctr_demo.yaml
IMPORTANT This docker image depends on the sinapsis:base image. Please refer to the official sinapsis instructions to Build with Docker.
docker compose -f docker/compose.yaml build
docker compose -f docker/compose_app.yaml up
docker logs -f sinapsis-ocr-app
NOTE: The url can be different, check the output of logs
Running on local URL: http://127.0.0.1:7860
docker compose -f docker/compose_app.yaml down
To run the webapp using the uv
package manager, please:
uv sync --frozen
uv pip install sinapsis-ocr[all] --extra-index-url https://pypi.sinapsis.tech
uv run webapps/gradio_ocr.py
Running on local URL: http://127.0.0.1:7860
NOTE: The url can be different, check the output of the terminal
Control + C
on the terminalDocumentation for this and other sinapsis packages is available on the sinapsis website
Tutorials for different projects within sinapsis are available at sinapsis tutorials page
This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.
For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.
FAQs
Implements Sinapsis templates to perform optical character recognition on images
We found that sinapsis-ocr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.