Skip to main content

A package to use the OstrisTraining

Project description

Libs-Ostris (TechTrash_OstrisTraining)

This package provides a small Python wrapper around an Ostris training workflow.

The main entrypoint is OstrisTraining.train().

What train() does

  • Download + prepare dataset from a public ZIP URL
    • ZIP root must contain image files + matching caption files (.txt)
    • Example pair: photobelle.png + photobelle.txt
    • Output: files are normalized to image_0.<ext>, image_0.txt, image_1.<ext>, image_1.txt, ...
  • Write config YAML from a string into a deterministic file:
    • {absolute_path_racine}/config-{user_name}.yaml
  • Run training
    • Currently _train_model() is a stub in main.py (replace with real training call)

Install (local dev)

From this folder:

pip install -e .

Usage (recommended)

The best reference is src/ostristraining/example.py.

You can run it directly after installing:

python -m ostristraining.example

Or copy/paste this minimal usage:

from ostristraining.main import OstrisTraining

trainer = OstrisTraining(
    user_name="demo_user",
    absolute_path_ostris="/tmp/ostris_project",
    absolute_path_racine="/tmp/ostris_runs",
)

# Public ZIP URL containing images + captions at the ZIP root.
url_zip_dataset = "https://example.com/dataset.zip"

# YAML config must be a STRING. Newlines + indentation matter in YAML.
config_yaml_content = \"\"\"\
model:
  name: my_model
training:
  steps: 1000
\"\"\"

trained_model_path = trainer.train(
    url_zip_dataset=url_zip_dataset,
    config_yaml_content=config_yaml_content,
)

print(trained_model_path)

Dataset ZIP format (important)

At the root of the ZIP, you must have:

  • images: .png, .jpg, .jpeg, .webp, .bmp, .gif
  • captions: .txt

And each image must have a caption with the same base name:

  • photo001.png + photo001.txt
  • photo002.jpg + photo002.txt

If an image has no matching .txt, it is skipped.

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

techtrash_ostristraining-0.0.6.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

techtrash_ostristraining-0.0.6-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file techtrash_ostristraining-0.0.6.tar.gz.

File metadata

  • Download URL: techtrash_ostristraining-0.0.6.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for techtrash_ostristraining-0.0.6.tar.gz
Algorithm Hash digest
SHA256 547e640f1bffcac5700eb64fca300d44a764d1c01edf9dfaaf8197d72af41918
MD5 bd7aa2a3f047f55f6ae19a405f777aff
BLAKE2b-256 822d2eb096c4360be3852ad5b41a92404ed8a9b6bb76da8e6291ab15c3e2e32d

See more details on using hashes here.

File details

Details for the file techtrash_ostristraining-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for techtrash_ostristraining-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e11f500f5563b0d955c950b847a80d7f414eb65f953b250e0ea26f635916c258
MD5 693b48854f9ddc9656eb34b94c54b757
BLAKE2b-256 978f77b4f974b4a384edec0335266fbf8e794300151d5c16d7308f9cfcde2a83

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