Skip to main content

Utilities to load and use pytorch datasets stored in Minio S3

Project description

torchdatasetutil

Utilities to load and use pytorch datasets stored in Minio S3

Credentials file

"torchdatasetutil" reads s3 and pypi credentails from a credential yaml or json file speciried with the "-credentails" parameter. The structure of the credentials file is as follows:

pipy.org:
- package: torchdatasetutil
  username: __token__
  password: <token value>

s3:
- name: "store"
  type: "trainer"
  address: "<s3 url>"
  access key: "<s3 username>"
  secret key: "<s3 password>"
  tls: <true/false>
  cert verify: <true/false>
  cert path: <null/string>
  sets:
    dataset: {"bucket":"mllib","prefix":"data", "dataset_filter":"" }
    trainingset: {"bucket":"mllib","prefix":"training", "dataset_filter":"" }
    model: {"bucket":"mllib","prefix":"model", "dataset_filter":"" }
    test: {"bucket":"mllib","prefix":"test", "dataset_filter":"" }

Class dictionary file

The dataset store expects a class dictionary that maps from dataset object types to training classes. Below is an example class dictionary mapping the coco dataset classes to a set of new, simplified classes. The class dictionary defines: - background: the background index - ignore: ignore index - classes: number of output classes - objects: array of classing mappings from the current dataset to the training dataset. Objects include: - id: dataset index - name: dataset class name - category: output class - display: true/false if the output class is to be displayed - color: output class color 3 color RGB array The dataset annotations are converted through this class dictionary for training, test, and display.

{
    "background":0,
    "ignore":255,
    "classes":4,
    "objects":[
        {"id":0,    "name":"unlabeled",     "trainId":0 , "category":"void", "display":false, "color": [ 0,  0,  0]},
        {"id":1,    "name":"person",        "trainId":1 , "category":"person", "display":true, "color": [ 0,  255,  0]},
        {"id":2,    "name":"bicycle",       "trainId":2 , "category":"vehicle", "display": true, "color":[ 255,  0,  0]},
        {"id":3,    "name":"car",           "trainId":2 , "category":"vehicle", "display": true, "color":[ 255,  0,  0]},
        {"id":4,    "name":"motorcycle",    "trainId":2 , "category":"vehicle", "display": true, "color":[ 255,  0,  0]},
        {"id":5,    "name":"airplane",      "trainId":2 , "category":"vehicle", "display": true, "color":[ 255,  0,  0]},
        {"id":6,    "name":"bus",           "trainId":2 , "category":"vehicle", "display": true, "color":[ 255,  0,  0]},
        {"id":7,    "name":"train",         "trainId":2 , "category":"vehicle", "display": true, "color":[ 255,  0,  0]},
        {"id":8,    "name":"truck",         "trainId":2 , "category":"vehicle", "display": true, "color":[ 255,  0,  0]},
        {"id":9,    "name":"boat",          "trainId":2 , "category":"vehicle", "display": true, "color":[ 255,  0,  0]},
        ...
    ]
}

Create Library

Create a PyPI account

  • Run deploy -c to create and push this library to PyPI using your PyPI credentials
    deploy -c
    
  • Once this library is successfully created, open your PyPI projects, open your project, select "Setings" -> "Create a token".
  • Add the token to your project credentials

Update library

pip3 install --upgrade torchdatasetutil

Load datasets

py -m torchdatasetutil -getcoco
py -m torchdatasetutil -getsintel

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

torchdatasetutil-0.0.20.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

torchdatasetutil-0.0.20-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file torchdatasetutil-0.0.20.tar.gz.

File metadata

  • Download URL: torchdatasetutil-0.0.20.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.62.2 importlib-metadata/4.8.2 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for torchdatasetutil-0.0.20.tar.gz
Algorithm Hash digest
SHA256 904d1373dcc044d4b9e1a92825df6c5059b3480c1026010408b9aeaf8fdc5f14
MD5 ccd6fe640fda954bee30d33fb10b2a4f
BLAKE2b-256 64ecb44e1169ea67860914b7920c3265d7fbe92922fdc6c2a129af2895a2873d

See more details on using hashes here.

File details

Details for the file torchdatasetutil-0.0.20-py3-none-any.whl.

File metadata

  • Download URL: torchdatasetutil-0.0.20-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.62.2 importlib-metadata/4.8.2 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for torchdatasetutil-0.0.20-py3-none-any.whl
Algorithm Hash digest
SHA256 26bdca4373949d12d03dfb838dcdf750931fa79c294801d36788f48d070978cc
MD5 93f26b8ca6ef972fc37d6f141119108d
BLAKE2b-256 48daefa45a8b9cd3be35d1642ce01864c70c6cb4b07b1de45cd9f10827ebf3d6

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