Skip to main content

Splitter

How to install or update the lib

# The .h5 models are installed along with the pip installation. 
    # There's no need to hardcode their path anywhere.
pip install git+https://gitlab.com/gpam/victor/SERVICES/splitter.git
# Or
pip install victor-services-splitter 

How to uninstall the lib

pip uninstall victor-services-splitter

How to generate predictions

from splitter.model import ModelSplitter

# Setup the threading of the TensorFlow model operations
# (...)

model_splitter = ModelSplitter("path/to/model/page/image/features",
                               "path/to/model/page/classification")

# Create the image list. See the supported image types section
image_list = [...]


prediction_list = model_splitter.predict_pdf_pages(
    image_list
    )
# [1, 0, 0, 1, 1, 1, 0]

grouped_prediction_list = model_splitter.predict_pdf_pages(
    image_list,
    has_to_group_predictions=True
    )
# [[1, 0, 0], [1], [1], [1, 0]]

precise_prediction_list = model_splitter.predict_pdf_pages(
    image_list,
    prediction_decimals=3
    )
# [1.0, 0.312, 0.0, 0.963, 0.534, 0.744, 0.23]

Setup the threading of the TensorFlow model operations.

Read more at the TensorFlow docs about threading.

import tensorflow as tf

# a value of 0 means the system picks an appropriate number.
tf.config.threading.set_intra_op_parallelism_threads(
    num_threads=0
    )

# a value of 0 means the system picks an appropriate number.
tf.config.threading.set_inter_op_parallelism_threads(
    num_threads=0
    )

Supported image types

- Pillow
- Base64
- Bytes
- Image path ending with '.jpg', '.png' or '.jpeg'

Metadata

Release files for victor-services-splitter 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for victor-services-splitter 0.1.1
File Size Uploaded
victor-services-splitter-0.1.1.tar.gz 3.7 kB Details

Release files / victor-services-splitter-0.1.1.tar.gz

Download URL victor-services-splitter-0.1.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a5bfb2c0c831a383bb5c2f6b55d520235ba0b55340428f0b977d6a2201ecfdbf
BLAKE2b-256 checksum
How to use checksums
3ca30be143c769eaeb49afe876a7f38f06b4ec6c5d28e8c397f7046e216b8c7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page