Name | hirundo JSON |
Version |
0.1.9
JSON |
| download |
home_page | None |
Summary | This package is used to interface with Hirundo's platform. It provides a simple API to optimize your ML datasets. |
upload_time | 2024-12-15 14:24:43 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2024, Hirundo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
dataset
machine learning
data science
data engineering
|
VCS |
|
bugtrack_url |
|
requirements |
annotated-types
anyio
backports-tarfile
certifi
charset-normalizer
click
docutils
exceptiongroup
h11
httpcore
httpx
httpx-sse
idna
importlib-metadata
jaraco-classes
jaraco-context
jaraco-functools
keyring
markdown-it-py
mdurl
more-itertools
nh3
numpy
pandas
pkginfo
pydantic
pydantic-core
pygments
python-dateutil
python-dotenv
pytz
pyyaml
readme-renderer
requests
requests-toolbelt
rfc3986
rich
shellingham
six
sniffio
stamina
tenacity
tqdm
twine
typer
types-pyyaml
types-requests
typing-extensions
tzdata
urllib3
zipp
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Hirundo
This package exposes access to Hirundo APIs for dataset optimization for Machine Learning.
Dataset optimization is currently available for datasets labelled for classification and object detection.
Support dataset storage configs include:
- Google Cloud (GCP) Storage
- Amazon Web Services (AWS) S3
- Git LFS (Large File Storage) repositories (e.g. GitHub or HuggingFace)
Optimizing a classification dataset
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Currently ``hirundo`` requires a CSV file with the following columns (all columns are required):
- ``image_path``: The location of the image within the dataset ``root``
- ``label``: The label of the image, i.e. which the class that was annotated for this image
And outputs a CSV with the same columns and:
- ``suspect_level``: mislabel suspect level
- ``suggested_label``: suggested label
- ``suggested_label_conf``: suggested label confidence
Optimizing an object detection (OD) dataset
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Currently ``hirundo`` requires a CSV file with the following columns (all columns are required):
- ``image_path``: The location of the image within the dataset ``root``
- ``bbox_id``: The index of the bounding box within the dataset. Used to indicate label suspects
- ``label``: The label of the image, i.e. which the class that was annotated for this image
- ``x1``, ``y1``, ``x2``, ``y2``: The bounding box coordinates of the object within the image
And outputs a CSV with the same columns and:
- ``suspect_level``: object mislabel suspect level
- ``suggested_label``: suggested object label
- ``suggested_label_conf``: suggested object label confidence
Note: This Python package must be used alongside a Hirundo server, either the SaaS platform, a custom VPC deployment or an on-premises installation.
## Installation
You can install the codebase with a simple `pip install hirundo` to install the latest version of this package. If you prefer to install from the Git repository and/or need a specific version or branch, you can simply clone the repository, check out the relevant commit and then run `pip install .` to install that version. A full list of dependencies can be found in `requirements.txt`, but these will be installed automatically by either of these commands.
## Usage
Classification example:
```python
from hirundo import (
HirundoCSV,
LabelingType,
OptimizationDataset,
StorageGCP,
StorageConfig,
StorageTypes,
)
gcp_bucket = StorageGCP(
bucket_name="cifar100bucket",
project="Hirundo-global",
credentials_json=json.loads(os.environ["GCP_CREDENTIALS"]),
)
test_dataset = OptimizationDataset(
name="TEST-GCP cifar 100 classification dataset",
labeling_type=LabelingType.SINGLE_LABEL_CLASSIFICATION,
storage_config=StorageConfig(
name="cifar100bucket",
type=StorageTypes.GCP,
gcp=gcp_bucket,
),
data_root_url=gcp_bucket.get_url(path="/pytorch-cifar/data"),
labeling_info=HirundoCSV(
csv_url=gcp_bucket.get_url(path="/pytorch-cifar/data/cifar100.csv"),
),
classes=cifar100_classes,
)
test_dataset.run_optimization()
results = test_dataset.check_run()
print(results)
```
Object detection example:
```python
from hirundo import (
GitRepo,
HirundoCSV,
LabelingType,
OptimizationDataset,
StorageGit,
StorageConfig,
StorageTypes,
)
git_storage = StorageGit(
repo=GitRepo(
name="BDD-100k-validation-dataset",
repository_url="https://git@hf.co/datasets/hirundo-io/bdd100k-validation-only.git",
),
branch="main",
)
test_dataset = OptimizationDataset(
name="TEST-HuggingFace-BDD-100k-validation-OD-validation-dataset",
labeling_type=LabelingType.OBJECT_DETECTION,
storage_config=StorageConfig(
name="BDD-100k-validation-dataset",
type=StorageTypes.GIT,
git=git_storage,
),
data_root_url=git_storage.get_url(path="/BDD100K Val from Hirundo.zip/bdd100k"),
labeling_info=HirundoCSV(
csv_url=git_storage.get_url(
path="/BDD100K Val from Hirundo.zip/bdd100k/bdd100k.csv"
),
),
classes=[
"traffic light",
"traffic sign",
"car",
"pedestrian",
"bus",
"truck",
"rider",
"bicycle",
"motorcycle",
"train",
"other vehicle",
"other person",
"trailer",
],
)
test_dataset.run_optimization()
results = test_dataset.check_run()
print(results)
```
Note: Currently we only support the main CPython release 3.9, 3.10 and 3.11. PyPy support may be introduced in the future.
## Further documentation
To learn more about how to use this library, please visit the [http://docs.hirundo.io/](documentation) or see the Google Colab examples.
Raw data
{
"_id": null,
"home_page": null,
"name": "hirundo",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "dataset, machine learning, data science, data engineering",
"author": null,
"author_email": "Hirundo <dev@hirundo.io>",
"download_url": "https://files.pythonhosted.org/packages/dc/35/68c00467393be661f1f66a11214b771308c7c92446bba04f5b7b5f36d1f8/hirundo-0.1.9.tar.gz",
"platform": null,
"description": "# Hirundo\n\nThis package exposes access to Hirundo APIs for dataset optimization for Machine Learning.\n\nDataset optimization is currently available for datasets labelled for classification and object detection.\n\n\nSupport dataset storage configs include:\n - Google Cloud (GCP) Storage\n - Amazon Web Services (AWS) S3\n - Git LFS (Large File Storage) repositories (e.g. GitHub or HuggingFace)\n\nOptimizing a classification dataset\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCurrently ``hirundo`` requires a CSV file with the following columns (all columns are required):\n - ``image_path``: The location of the image within the dataset ``root``\n - ``label``: The label of the image, i.e. which the class that was annotated for this image\n\nAnd outputs a CSV with the same columns and:\n - ``suspect_level``: mislabel suspect level\n - ``suggested_label``: suggested label\n - ``suggested_label_conf``: suggested label confidence\n\nOptimizing an object detection (OD) dataset\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nCurrently ``hirundo`` requires a CSV file with the following columns (all columns are required):\n - ``image_path``: The location of the image within the dataset ``root``\n - ``bbox_id``: The index of the bounding box within the dataset. Used to indicate label suspects\n - ``label``: The label of the image, i.e. which the class that was annotated for this image\n - ``x1``, ``y1``, ``x2``, ``y2``: The bounding box coordinates of the object within the image\n\nAnd outputs a CSV with the same columns and:\n - ``suspect_level``: object mislabel suspect level\n - ``suggested_label``: suggested object label\n - ``suggested_label_conf``: suggested object label confidence\n\nNote: This Python package must be used alongside a Hirundo server, either the SaaS platform, a custom VPC deployment or an on-premises installation.\n\n\n## Installation\n\nYou can install the codebase with a simple `pip install hirundo` to install the latest version of this package. If you prefer to install from the Git repository and/or need a specific version or branch, you can simply clone the repository, check out the relevant commit and then run `pip install .` to install that version. A full list of dependencies can be found in `requirements.txt`, but these will be installed automatically by either of these commands.\n\n## Usage\n\nClassification example:\n```python\nfrom hirundo import (\n HirundoCSV,\n LabelingType,\n OptimizationDataset,\n StorageGCP,\n StorageConfig,\n StorageTypes,\n)\n\ngcp_bucket = StorageGCP(\n bucket_name=\"cifar100bucket\",\n project=\"Hirundo-global\",\n credentials_json=json.loads(os.environ[\"GCP_CREDENTIALS\"]),\n)\ntest_dataset = OptimizationDataset(\n name=\"TEST-GCP cifar 100 classification dataset\",\n labeling_type=LabelingType.SINGLE_LABEL_CLASSIFICATION,\n storage_config=StorageConfig(\n name=\"cifar100bucket\",\n type=StorageTypes.GCP,\n gcp=gcp_bucket,\n ),\n data_root_url=gcp_bucket.get_url(path=\"/pytorch-cifar/data\"),\n labeling_info=HirundoCSV(\n csv_url=gcp_bucket.get_url(path=\"/pytorch-cifar/data/cifar100.csv\"),\n ),\n classes=cifar100_classes,\n)\n\ntest_dataset.run_optimization()\nresults = test_dataset.check_run()\nprint(results)\n```\n\n\nObject detection example:\n\n```python\nfrom hirundo import (\n GitRepo,\n HirundoCSV,\n LabelingType,\n OptimizationDataset,\n StorageGit,\n StorageConfig,\n StorageTypes,\n)\n\ngit_storage = StorageGit(\n repo=GitRepo(\n name=\"BDD-100k-validation-dataset\",\n repository_url=\"https://git@hf.co/datasets/hirundo-io/bdd100k-validation-only.git\",\n ),\n branch=\"main\",\n)\ntest_dataset = OptimizationDataset(\n name=\"TEST-HuggingFace-BDD-100k-validation-OD-validation-dataset\",\n labeling_type=LabelingType.OBJECT_DETECTION,\n storage_config=StorageConfig(\n name=\"BDD-100k-validation-dataset\",\n type=StorageTypes.GIT,\n git=git_storage,\n ),\n data_root_url=git_storage.get_url(path=\"/BDD100K Val from Hirundo.zip/bdd100k\"),\n labeling_info=HirundoCSV(\n csv_url=git_storage.get_url(\n path=\"/BDD100K Val from Hirundo.zip/bdd100k/bdd100k.csv\"\n ),\n ),\n classes=[\n \"traffic light\",\n \"traffic sign\",\n \"car\",\n \"pedestrian\",\n \"bus\",\n \"truck\",\n \"rider\",\n \"bicycle\",\n \"motorcycle\",\n \"train\",\n \"other vehicle\",\n \"other person\",\n \"trailer\",\n ],\n)\n\ntest_dataset.run_optimization()\nresults = test_dataset.check_run()\nprint(results)\n```\n\nNote: Currently we only support the main CPython release 3.9, 3.10 and 3.11. PyPy support may be introduced in the future.\n\n## Further documentation\n\nTo learn more about how to use this library, please visit the [http://docs.hirundo.io/](documentation) or see the Google Colab examples.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024, Hirundo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "This package is used to interface with Hirundo's platform. It provides a simple API to optimize your ML datasets.",
"version": "0.1.9",
"project_urls": {
"Homepage": "https://github.com/Hirundo-io/hirundo-client"
},
"split_keywords": [
"dataset",
" machine learning",
" data science",
" data engineering"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "611c973d9e70e7afef91484a179cfbc2c64d0475091353250df5d1a4db20863a",
"md5": "80ab8b5c7ad00c8f9f0ff26361e15c91",
"sha256": "34c1619860ade3246cb47c052e604f240abf8940480079505fe6e74e3bd4510b"
},
"downloads": -1,
"filename": "hirundo-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "80ab8b5c7ad00c8f9f0ff26361e15c91",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 24188,
"upload_time": "2024-12-15T14:24:41",
"upload_time_iso_8601": "2024-12-15T14:24:41.157313Z",
"url": "https://files.pythonhosted.org/packages/61/1c/973d9e70e7afef91484a179cfbc2c64d0475091353250df5d1a4db20863a/hirundo-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "dc3568c00467393be661f1f66a11214b771308c7c92446bba04f5b7b5f36d1f8",
"md5": "6d0efdc5b17c8a487bcae1bc4c190ee2",
"sha256": "41ac0767a36a9aa9efd1bde3067da17ddf121017fa10aa85b590541e26f0fa73"
},
"downloads": -1,
"filename": "hirundo-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "6d0efdc5b17c8a487bcae1bc4c190ee2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 23585,
"upload_time": "2024-12-15T14:24:43",
"upload_time_iso_8601": "2024-12-15T14:24:43.930062Z",
"url": "https://files.pythonhosted.org/packages/dc/35/68c00467393be661f1f66a11214b771308c7c92446bba04f5b7b5f36d1f8/hirundo-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-15 14:24:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Hirundo-io",
"github_project": "hirundo-client",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "annotated-types",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "anyio",
"specs": [
[
"==",
"4.4.0"
]
]
},
{
"name": "backports-tarfile",
"specs": [
[
"==",
"1.2.0"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.7.4"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.7"
]
]
},
{
"name": "docutils",
"specs": [
[
"==",
"0.21.2"
]
]
},
{
"name": "exceptiongroup",
"specs": [
[
"==",
"1.2.2"
]
]
},
{
"name": "h11",
"specs": [
[
"==",
"0.14.0"
]
]
},
{
"name": "httpcore",
"specs": [
[
"==",
"1.0.5"
]
]
},
{
"name": "httpx",
"specs": [
[
"==",
"0.27.0"
]
]
},
{
"name": "httpx-sse",
"specs": [
[
"==",
"0.4.0"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.7"
]
]
},
{
"name": "importlib-metadata",
"specs": [
[
"==",
"8.0.0"
]
]
},
{
"name": "jaraco-classes",
"specs": [
[
"==",
"3.4.0"
]
]
},
{
"name": "jaraco-context",
"specs": [
[
"==",
"5.3.0"
]
]
},
{
"name": "jaraco-functools",
"specs": [
[
"==",
"4.0.1"
]
]
},
{
"name": "keyring",
"specs": [
[
"==",
"25.2.1"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"10.3.0"
]
]
},
{
"name": "nh3",
"specs": [
[
"==",
"0.2.18"
]
]
},
{
"name": "numpy",
"specs": [
[
"==",
"2.0.1"
]
]
},
{
"name": "pandas",
"specs": [
[
"==",
"2.2.2"
]
]
},
{
"name": "pkginfo",
"specs": [
[
"==",
"1.10.0"
]
]
},
{
"name": "pydantic",
"specs": [
[
"==",
"2.8.2"
]
]
},
{
"name": "pydantic-core",
"specs": [
[
"==",
"2.20.1"
]
]
},
{
"name": "pygments",
"specs": [
[
"==",
"2.18.0"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.9.0.post0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
"==",
"1.0.1"
]
]
},
{
"name": "pytz",
"specs": [
[
"==",
"2024.1"
]
]
},
{
"name": "pyyaml",
"specs": [
[
"==",
"6.0.1"
]
]
},
{
"name": "readme-renderer",
"specs": [
[
"==",
"44.0"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "requests-toolbelt",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "rfc3986",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.7.1"
]
]
},
{
"name": "shellingham",
"specs": [
[
"==",
"1.5.4"
]
]
},
{
"name": "six",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "sniffio",
"specs": [
[
"==",
"1.3.1"
]
]
},
{
"name": "stamina",
"specs": [
[
"==",
"24.2.0"
]
]
},
{
"name": "tenacity",
"specs": [
[
"==",
"8.5.0"
]
]
},
{
"name": "tqdm",
"specs": [
[
"==",
"4.66.5"
]
]
},
{
"name": "twine",
"specs": [
[
"==",
"5.1.1"
]
]
},
{
"name": "typer",
"specs": [
[
"==",
"0.12.3"
]
]
},
{
"name": "types-pyyaml",
"specs": [
[
"==",
"6.0.12.20240311"
]
]
},
{
"name": "types-requests",
"specs": [
[
"==",
"2.32.0.20240712"
]
]
},
{
"name": "typing-extensions",
"specs": [
[
"==",
"4.12.2"
]
]
},
{
"name": "tzdata",
"specs": [
[
"==",
"2024.1"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.2"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.19.2"
]
]
}
],
"lcname": "hirundo"
}