Skip to main content

Templates to read data in different formats

Project description



Sinapsis Data Readers

Package to read data in different formats and assign them to a specific type of Packet

🐍 Installation🚀 Features📚 Usage example📙 Documentation🔍 License

🐍 Installation

Install using your package manager of choice. We encourage the use of uv

Example with uv:

  uv pip install sinapsis-data-readers --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-data-readers --extra-index-url https://pypi.sinapsis.tech

[!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-data-readers[all] --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

  pip install sinapsis-data-readers[all] --extra-index-url https://pypi.sinapsis.tech

[!NOTE] Some templates also need system dependencies (e.g., ffmpeg). The installation depends on your OS. For Linux:

apt-get install -y ffmpeg

🚀 Features

  • Sinapsis Data Readers
    • Audio Readers
      Read audio files from several formats using Pydub, Soundfile, among others.
    • Dataset Readers
      Read and manipulate tabular datasets from the scikit libraries, among others.
    • Image Readers
      Read and manipulate images from COCO, paths in CSVs, whole folders, etc.
    • Text Readers
      Read text data from a simple string and other sources.
    • Video Readers
      Read videoframes using CV2, Dali, FFMPEG, Torch, among others.

[!TIP] Use CLI command sinapsis info --all-template-names to show a list with all the available Template names installed with Sinapsis Data Tools.

[!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 FolderImageDatasetCV2 use sinapsis info --example-template-config ImageSaver to produce the following example config:

agent:
  name: my_test_agent
  description: Agent to read images from a folder using OpenCV
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: FolderImageDatasetCV2
  class_name: FolderImageDatasetCV2
  template_input: InputTemplate
  attributes:
    data_dir: '/path/to/sinapsis/cache/dir'
    pattern: '**/*'
    batch_size: 1
    shuffle_data: false
    samples_to_load: -1
    load_on_init: false
    label_path_index: -2
    is_ground_truth: false

📚 Usage example

Example agent config You can copy and paste the following config and run it using the sinapsis cli, changing the data_dir attribute in the FolderImageDatasetCV2 and the root_dir attribute in the ImageSaver template
agent:
  name: my_test_agent
  description: agent to save image locally
templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}
- template_name: FolderImageDatasetCV2
  class_name: FolderImageDatasetCV2
  attributes:
    data_dir: /path/to/image
    pattern: '**/*'
    batch_size: 1
    load_on_init: true
    label_path_index: 0
    is_ground_truth: false

To run, simply use:

sinapsis run name_of_the_config.yml

📙 Documentation

Documentation for this and other sinapsis packages is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sinapsis_data_readers-0.1.24.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sinapsis_data_readers-0.1.24-py3-none-any.whl (61.8 kB view details)

Uploaded Python 3

File details

Details for the file sinapsis_data_readers-0.1.24.tar.gz.

File metadata

File hashes

Hashes for sinapsis_data_readers-0.1.24.tar.gz
Algorithm Hash digest
SHA256 a887e4f655bc10d582b6e4ee7135dae8f8e6792eaeec78556dd8f46df90b67a1
MD5 f8519b29e3de27a78de81b5d11ba3a9c
BLAKE2b-256 2bb5c9a66c5dd31d147a6d99b94bdc7be7a0a196a8416549bf1c87e6beffba9c

See more details on using hashes here.

File details

Details for the file sinapsis_data_readers-0.1.24-py3-none-any.whl.

File metadata

File hashes

Hashes for sinapsis_data_readers-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 4864a8c22e548e223fc3df41f4da5fe2198a9256fc2dbc93d5cbeb3e677e6135
MD5 098bd6092a9595ea801a7d5f35aee3ca
BLAKE2b-256 35d9a76ec3b2b44c5e33e12713954b00b744d8112792f2b4dc183cd11d11ea78

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page