datachain 0.6.10__tar.gz → 0.6.11__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of datachain might be problematic. Click here for more details.
- {datachain-0.6.10/src/datachain.egg-info → datachain-0.6.11}/PKG-INFO +1 -1
- datachain-0.6.11/src/datachain/lib/models/__init__.py +5 -0
- datachain-0.6.11/src/datachain/lib/models/bbox.py +45 -0
- datachain-0.6.11/src/datachain/lib/models/pose.py +37 -0
- datachain-0.6.11/src/datachain/lib/models/yolo.py +39 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/sqlite/types.py +8 -1
- {datachain-0.6.10 → datachain-0.6.11/src/datachain.egg-info}/PKG-INFO +1 -1
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/SOURCES.txt +2 -5
- datachain-0.6.11/tests/unit/lib/test_models.py +50 -0
- datachain-0.6.11/tests/unit/sql/sqlite/test_types.py +19 -0
- datachain-0.6.10/src/datachain/lib/models/__init__.py +0 -6
- datachain-0.6.10/src/datachain/lib/models/bbox.py +0 -116
- datachain-0.6.10/src/datachain/lib/models/pose.py +0 -108
- datachain-0.6.10/src/datachain/lib/models/segment.py +0 -53
- datachain-0.6.10/src/datachain/lib/models/ultralytics/__init__.py +0 -14
- datachain-0.6.10/src/datachain/lib/models/ultralytics/bbox.py +0 -189
- datachain-0.6.10/src/datachain/lib/models/ultralytics/pose.py +0 -126
- datachain-0.6.10/src/datachain/lib/models/ultralytics/segment.py +0 -121
- datachain-0.6.10/tests/unit/lib/test_models.py +0 -142
- {datachain-0.6.10 → datachain-0.6.11}/.cruft.json +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.gitattributes +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/ISSUE_TEMPLATE/empty_issue.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/codecov.yaml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/dependabot.yml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/benchmarks.yml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/release.yml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/tests-studio.yml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/tests.yml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/update-template.yaml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.gitignore +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/.pre-commit-config.yaml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/CODE_OF_CONDUCT.rst +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/CONTRIBUTING.rst +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/LICENSE +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/README.rst +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/assets/captioned_cartoons.png +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/assets/datachain-white.svg +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/assets/datachain.svg +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/index.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/overrides/main.html +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/references/datachain.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/references/datatype.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/references/file.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/references/index.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/references/sql.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/references/torch.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/docs/references/udf.md +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/computer_vision/iptc_exif_xmp_lib.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/computer_vision/llava2_image_desc_lib.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/computer_vision/openimage-detect.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/common_sql_functions.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/json-csv-reader.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/torch-loader.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/udfs/parallel.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/udfs/simple.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/udfs/stateful.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/llm_and_nlp/claude-query.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/llm_and_nlp/hf-dataset-llm-eval.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/llm_and_nlp/unstructured-embeddings-gen.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/llm_and_nlp/unstructured-summary-map.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/clip_inference.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/hf_pipeline.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/openai_image_desc_lib.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/wds.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/wds_filtered.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/mkdocs.yml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/noxfile.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/pyproject.toml +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/setup.cfg +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/__main__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/asyn.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/cache.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/catalog/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/catalog/catalog.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/catalog/datasource.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/catalog/loader.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/cli.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/cli_utils.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/azure.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/fileslice.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/fsspec.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/gcs.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/hf.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/local.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/s3.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/config.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/db_engine.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/id_generator.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/job.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/metastore.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/schema.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/serializer.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/sqlite.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/warehouse.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/dataset.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/error.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/job.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/arrow.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/clip.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/flatten.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/python_to_sql.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/sql_to_python.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/unflatten.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/values_to_tuples.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/data_model.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/dataset_info.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/dc.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/file.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/func/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/func/aggregate.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/func/func.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/hf.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/image.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/listing.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/listing_info.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/meta_formats.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/model_store.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/pytorch.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/settings.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/signal_schema.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/tar.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/text.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/udf.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/udf_signature.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/utils.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/vfile.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/webdataset.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/webdataset_laion.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/listing.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/node.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/nodes_fetcher.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/nodes_thread_pool.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/progress.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/py.typed +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/batch.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/dataset.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/dispatch.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/metrics.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/params.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/queue.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/schema.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/session.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/remote/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/remote/studio.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/default/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/default/base.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/aggregate.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/array.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/conditional.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/path.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/random.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/string.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/selectable.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/sqlite/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/sqlite/base.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/sqlite/vector.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/types.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/utils.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/studio.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/telemetry.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/toolkit/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/toolkit/split.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/torch/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain/utils.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/dependency_links.txt +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/entry_points.txt +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/requires.txt +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/top_level.txt +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/conftest.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/datasets/.dvc/.gitignore +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/datasets/.dvc/config +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/datasets/.gitignore +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/datasets/laion-tiny.npz.dvc +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/test_datachain.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/test_ls.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/test_version.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/conftest.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/data.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/examples/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/examples/test_examples.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/examples/test_wds_e2e.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/examples/wds_data.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_catalog.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_client.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_datachain.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_dataset_query.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_datasets.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_feature_pickling.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_listing.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_ls.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_meta_formats.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_metrics.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_pull.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_pytorch.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_query.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_toolkit.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/feature_class.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/feature_class_exception.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/feature_class_parallel.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/feature_class_parallel_data_model.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/name_len_slow.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/test_atomicity.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/test_cli_e2e.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/test_cli_studio.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/test_query_e2e.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/test_telemetry.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/conftest.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_arrow.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_clip.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_datachain.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_datachain_bootstrap.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_datachain_merge.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_feature.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_feature_utils.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_file.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_hf.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_image.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_listing_info.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_schema.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_signal_schema.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_sql_to_python.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_text.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_udf_signature.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_utils.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_webdataset.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/sqlite/__init__.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/sqlite/test_utils.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_array.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_conditional.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_path.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_random.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_selectable.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_string.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_asyn.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_cache.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_catalog.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_catalog_loader.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_cli_parsing.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_client.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_client_s3.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_config.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_data_storage.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_database_engine.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_dataset.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_dispatch.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_fileslice.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_id_generator.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_listing.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_metastore.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_module_exports.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_query.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_query_metrics.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_query_params.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_serializer.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_session.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_utils.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_warehouse.py +0 -0
- {datachain-0.6.10 → datachain-0.6.11}/tests/utils.py +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from datachain.lib.data_model import DataModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BBox(DataModel):
|
|
9
|
+
"""
|
|
10
|
+
A data model for representing bounding boxes.
|
|
11
|
+
|
|
12
|
+
Attributes:
|
|
13
|
+
title (str): The title of the bounding box.
|
|
14
|
+
x1 (float): The x-coordinate of the top-left corner of the bounding box.
|
|
15
|
+
y1 (float): The y-coordinate of the top-left corner of the bounding box.
|
|
16
|
+
x2 (float): The x-coordinate of the bottom-right corner of the bounding box.
|
|
17
|
+
y2 (float): The y-coordinate of the bottom-right corner of the bounding box.
|
|
18
|
+
|
|
19
|
+
The bounding box is defined by two points:
|
|
20
|
+
- (x1, y1): The top-left corner of the box.
|
|
21
|
+
- (x2, y2): The bottom-right corner of the box.
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
title: str = Field(default="")
|
|
25
|
+
x1: float = Field(default=0)
|
|
26
|
+
y1: float = Field(default=0)
|
|
27
|
+
x2: float = Field(default=0)
|
|
28
|
+
y2: float = Field(default=0)
|
|
29
|
+
|
|
30
|
+
@staticmethod
|
|
31
|
+
def from_xywh(bbox: list[float], title: Optional[str] = None) -> "BBox":
|
|
32
|
+
"""
|
|
33
|
+
Converts a bounding box in (x, y, width, height) format
|
|
34
|
+
to a BBox data model instance.
|
|
35
|
+
|
|
36
|
+
Args:
|
|
37
|
+
bbox (list[float]): A bounding box, represented as a list
|
|
38
|
+
of four floats [x, y, width, height].
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
BBox2D: An instance of the BBox data model.
|
|
42
|
+
"""
|
|
43
|
+
assert len(bbox) == 4, f"Bounding box must have 4 elements, got f{len(bbox)}"
|
|
44
|
+
x, y, w, h = bbox
|
|
45
|
+
return BBox(title=title or "", x1=x, y1=y, x2=x + w, y2=y + h)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
|
|
3
|
+
from datachain.lib.data_model import DataModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Pose(DataModel):
|
|
7
|
+
"""
|
|
8
|
+
A data model for representing pose keypoints.
|
|
9
|
+
|
|
10
|
+
Attributes:
|
|
11
|
+
x (list[float]): The x-coordinates of the keypoints.
|
|
12
|
+
y (list[float]): The y-coordinates of the keypoints.
|
|
13
|
+
|
|
14
|
+
The keypoints are represented as lists of x and y coordinates, where each index
|
|
15
|
+
corresponds to a specific body part.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
x: list[float] = Field(default=None)
|
|
19
|
+
y: list[float] = Field(default=None)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class Pose3D(DataModel):
|
|
23
|
+
"""
|
|
24
|
+
A data model for representing 3D pose keypoints.
|
|
25
|
+
|
|
26
|
+
Attributes:
|
|
27
|
+
x (list[float]): The x-coordinates of the keypoints.
|
|
28
|
+
y (list[float]): The y-coordinates of the keypoints.
|
|
29
|
+
visible (list[float]): The visibility of the keypoints.
|
|
30
|
+
|
|
31
|
+
The keypoints are represented as lists of x, y, and visibility values,
|
|
32
|
+
where each index corresponds to a specific body part.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
x: list[float] = Field(default=None)
|
|
36
|
+
y: list[float] = Field(default=None)
|
|
37
|
+
visible: list[float] = Field(default=None)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module contains the YOLO models.
|
|
3
|
+
|
|
4
|
+
YOLO stands for "You Only Look Once", a family of object detection models that
|
|
5
|
+
are designed to be fast and accurate. The models are trained to detect objects
|
|
6
|
+
in images by dividing the image into a grid and predicting the bounding boxes
|
|
7
|
+
and class probabilities for each grid cell.
|
|
8
|
+
|
|
9
|
+
More information about YOLO can be found here:
|
|
10
|
+
- https://pjreddie.com/darknet/yolo/
|
|
11
|
+
- https://docs.ultralytics.com/
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class PoseBodyPart:
|
|
16
|
+
"""
|
|
17
|
+
An enumeration of body parts for YOLO pose keypoints.
|
|
18
|
+
|
|
19
|
+
More information about the body parts can be found here:
|
|
20
|
+
https://docs.ultralytics.com/tasks/pose/
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
nose = 0
|
|
24
|
+
left_eye = 1
|
|
25
|
+
right_eye = 2
|
|
26
|
+
left_ear = 3
|
|
27
|
+
right_ear = 4
|
|
28
|
+
left_shoulder = 5
|
|
29
|
+
right_shoulder = 6
|
|
30
|
+
left_elbow = 7
|
|
31
|
+
right_elbow = 8
|
|
32
|
+
left_wrist = 9
|
|
33
|
+
right_wrist = 10
|
|
34
|
+
left_hip = 11
|
|
35
|
+
right_hip = 12
|
|
36
|
+
left_knee = 13
|
|
37
|
+
right_knee = 14
|
|
38
|
+
left_ankle = 15
|
|
39
|
+
right_ankle = 16
|
|
@@ -36,7 +36,14 @@ def convert_array(arr):
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
def adapt_np_array(arr):
|
|
39
|
-
|
|
39
|
+
def _json_serialize(obj):
|
|
40
|
+
if isinstance(obj, np.ndarray):
|
|
41
|
+
return obj.tolist()
|
|
42
|
+
return obj
|
|
43
|
+
|
|
44
|
+
return orjson.dumps(
|
|
45
|
+
arr, option=orjson.OPT_SERIALIZE_NUMPY, default=_json_serialize
|
|
46
|
+
).decode("utf-8")
|
|
40
47
|
|
|
41
48
|
|
|
42
49
|
def adapt_np_generic(val):
|
|
@@ -131,11 +131,7 @@ src/datachain/lib/func/func.py
|
|
|
131
131
|
src/datachain/lib/models/__init__.py
|
|
132
132
|
src/datachain/lib/models/bbox.py
|
|
133
133
|
src/datachain/lib/models/pose.py
|
|
134
|
-
src/datachain/lib/models/
|
|
135
|
-
src/datachain/lib/models/ultralytics/__init__.py
|
|
136
|
-
src/datachain/lib/models/ultralytics/bbox.py
|
|
137
|
-
src/datachain/lib/models/ultralytics/pose.py
|
|
138
|
-
src/datachain/lib/models/ultralytics/segment.py
|
|
134
|
+
src/datachain/lib/models/yolo.py
|
|
139
135
|
src/datachain/query/__init__.py
|
|
140
136
|
src/datachain/query/batch.py
|
|
141
137
|
src/datachain/query/dataset.py
|
|
@@ -263,4 +259,5 @@ tests/unit/sql/test_random.py
|
|
|
263
259
|
tests/unit/sql/test_selectable.py
|
|
264
260
|
tests/unit/sql/test_string.py
|
|
265
261
|
tests/unit/sql/sqlite/__init__.py
|
|
262
|
+
tests/unit/sql/sqlite/test_types.py
|
|
266
263
|
tests/unit/sql/sqlite/test_utils.py
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from datachain.lib import models
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_bbox():
|
|
5
|
+
bbox = models.BBox(title="BBox", x1=0.5, y1=1.5, x2=2.5, y2=3.5)
|
|
6
|
+
assert bbox.model_dump() == {
|
|
7
|
+
"title": "BBox",
|
|
8
|
+
"x1": 0.5,
|
|
9
|
+
"y1": 1.5,
|
|
10
|
+
"x2": 2.5,
|
|
11
|
+
"y2": 3.5,
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def test_bbox_from_xywh():
|
|
16
|
+
bbox = models.BBox.from_xywh([0.5, 1.5, 2.5, 3.5])
|
|
17
|
+
assert bbox.model_dump() == {"title": "", "x1": 0.5, "y1": 1.5, "x2": 3, "y2": 5}
|
|
18
|
+
|
|
19
|
+
bbox = models.BBox.from_xywh([0.5, 1.5, 2.5, 3.5], title="BBox")
|
|
20
|
+
assert bbox.model_dump() == {
|
|
21
|
+
"title": "BBox",
|
|
22
|
+
"x1": 0.5,
|
|
23
|
+
"y1": 1.5,
|
|
24
|
+
"x2": 3,
|
|
25
|
+
"y2": 5,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def test_pose():
|
|
30
|
+
x = [x * 0.5 for x in range(17)]
|
|
31
|
+
y = [y * 1.5 for y in range(17)]
|
|
32
|
+
pose = models.Pose(x=x, y=y)
|
|
33
|
+
assert pose.model_dump() == {"x": x, "y": y}
|
|
34
|
+
assert pose.x[models.yolo.PoseBodyPart.nose] == 0
|
|
35
|
+
assert pose.x[models.yolo.PoseBodyPart.left_eye] == 0.5
|
|
36
|
+
assert pose.x[models.yolo.PoseBodyPart.right_eye] == 1
|
|
37
|
+
assert pose.x[models.yolo.PoseBodyPart.left_ear] == 1.5
|
|
38
|
+
assert pose.x[models.yolo.PoseBodyPart.right_ear] == 2
|
|
39
|
+
assert pose.x[models.yolo.PoseBodyPart.left_shoulder] == 2.5
|
|
40
|
+
assert pose.x[models.yolo.PoseBodyPart.right_shoulder] == 3
|
|
41
|
+
assert pose.x[models.yolo.PoseBodyPart.left_elbow] == 3.5
|
|
42
|
+
assert pose.x[models.yolo.PoseBodyPart.right_elbow] == 4
|
|
43
|
+
assert pose.x[models.yolo.PoseBodyPart.left_wrist] == 4.5
|
|
44
|
+
assert pose.x[models.yolo.PoseBodyPart.right_wrist] == 5
|
|
45
|
+
assert pose.x[models.yolo.PoseBodyPart.left_hip] == 5.5
|
|
46
|
+
assert pose.x[models.yolo.PoseBodyPart.right_hip] == 6
|
|
47
|
+
assert pose.x[models.yolo.PoseBodyPart.left_knee] == 6.5
|
|
48
|
+
assert pose.x[models.yolo.PoseBodyPart.right_knee] == 7
|
|
49
|
+
assert pose.x[models.yolo.PoseBodyPart.left_ankle] == 7.5
|
|
50
|
+
assert pose.x[models.yolo.PoseBodyPart.right_ankle] == 8
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import pytest
|
|
3
|
+
|
|
4
|
+
from datachain.sql.sqlite.types import adapt_np_array
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
@pytest.mark.parametrize(
|
|
8
|
+
"dtype,arr,expected",
|
|
9
|
+
(
|
|
10
|
+
(float, [], "[]"),
|
|
11
|
+
(float, [0.5, 0.6], "[0.5,0.6]"),
|
|
12
|
+
(float, [[0.5, 0.6], [0.7, 0.8]], "[[0.5,0.6],[0.7,0.8]]"),
|
|
13
|
+
(np.dtypes.ObjectDType, [], "[]"),
|
|
14
|
+
(np.dtypes.ObjectDType, [0.5, 0.6], "[0.5,0.6]"),
|
|
15
|
+
(np.dtypes.ObjectDType, [[0.5, 0.6], [0.7, 0.8]], "[[0.5,0.6],[0.7,0.8]]"),
|
|
16
|
+
),
|
|
17
|
+
)
|
|
18
|
+
def test_adapt_np_array(dtype, arr, expected):
|
|
19
|
+
assert adapt_np_array(np.array(arr, dtype=dtype)) == expected
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
|
|
3
|
-
from datachain.lib.data_model import DataModel
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class BBox(DataModel):
|
|
7
|
-
"""
|
|
8
|
-
A data model for representing bounding boxes.
|
|
9
|
-
|
|
10
|
-
Attributes:
|
|
11
|
-
title (str): The title of the bounding box.
|
|
12
|
-
coords (list[int]): The coordinates of the bounding box.
|
|
13
|
-
|
|
14
|
-
The bounding box is defined by two points:
|
|
15
|
-
- (x1, y1): The top-left corner of the box.
|
|
16
|
-
- (x2, y2): The bottom-right corner of the box.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
title: str = Field(default="")
|
|
20
|
-
coords: list[int] = Field(default=None)
|
|
21
|
-
|
|
22
|
-
@staticmethod
|
|
23
|
-
def from_list(coords: list[float], title: str = "") -> "BBox":
|
|
24
|
-
assert len(coords) == 4, "Bounding box coordinates must be a list of 4 floats."
|
|
25
|
-
assert all(
|
|
26
|
-
isinstance(value, (int, float)) for value in coords
|
|
27
|
-
), "Bounding box coordinates must be integers or floats."
|
|
28
|
-
return BBox(
|
|
29
|
-
title=title,
|
|
30
|
-
coords=[round(c) for c in coords],
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
@staticmethod
|
|
34
|
-
def from_dict(coords: dict[str, float], title: str = "") -> "BBox":
|
|
35
|
-
assert (
|
|
36
|
-
len(coords) == 4
|
|
37
|
-
), "Bounding box coordinates must be a dictionary of 4 floats."
|
|
38
|
-
assert set(coords) == {
|
|
39
|
-
"x1",
|
|
40
|
-
"y1",
|
|
41
|
-
"x2",
|
|
42
|
-
"y2",
|
|
43
|
-
}, "Bounding box coordinates must contain keys with coordinates."
|
|
44
|
-
assert all(
|
|
45
|
-
isinstance(value, (int, float)) for value in coords.values()
|
|
46
|
-
), "Bounding box coordinates must be integers or floats."
|
|
47
|
-
return BBox(
|
|
48
|
-
title=title,
|
|
49
|
-
coords=[
|
|
50
|
-
round(coords["x1"]),
|
|
51
|
-
round(coords["y1"]),
|
|
52
|
-
round(coords["x2"]),
|
|
53
|
-
round(coords["y2"]),
|
|
54
|
-
],
|
|
55
|
-
)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
class OBBox(DataModel):
|
|
59
|
-
"""
|
|
60
|
-
A data model for representing oriented bounding boxes.
|
|
61
|
-
|
|
62
|
-
Attributes:
|
|
63
|
-
title (str): The title of the oriented bounding box.
|
|
64
|
-
coords (list[int]): The coordinates of the oriented bounding box.
|
|
65
|
-
|
|
66
|
-
The oriented bounding box is defined by four points:
|
|
67
|
-
- (x1, y1): The first corner of the box.
|
|
68
|
-
- (x2, y2): The second corner of the box.
|
|
69
|
-
- (x3, y3): The third corner of the box.
|
|
70
|
-
- (x4, y4): The fourth corner of the box.
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
title: str = Field(default="")
|
|
74
|
-
coords: list[int] = Field(default=None)
|
|
75
|
-
|
|
76
|
-
@staticmethod
|
|
77
|
-
def from_list(coords: list[float], title: str = "") -> "OBBox":
|
|
78
|
-
assert (
|
|
79
|
-
len(coords) == 8
|
|
80
|
-
), "Oriented bounding box coordinates must be a list of 8 floats."
|
|
81
|
-
assert all(
|
|
82
|
-
isinstance(value, (int, float)) for value in coords
|
|
83
|
-
), "Oriented bounding box coordinates must be integers or floats."
|
|
84
|
-
return OBBox(
|
|
85
|
-
title=title,
|
|
86
|
-
coords=[round(c) for c in coords],
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
@staticmethod
|
|
90
|
-
def from_dict(coords: dict[str, float], title: str = "") -> "OBBox":
|
|
91
|
-
assert set(coords) == {
|
|
92
|
-
"x1",
|
|
93
|
-
"y1",
|
|
94
|
-
"x2",
|
|
95
|
-
"y2",
|
|
96
|
-
"x3",
|
|
97
|
-
"y3",
|
|
98
|
-
"x4",
|
|
99
|
-
"y4",
|
|
100
|
-
}, "Oriented bounding box coordinates must contain keys with coordinates."
|
|
101
|
-
assert all(
|
|
102
|
-
isinstance(value, (int, float)) for value in coords.values()
|
|
103
|
-
), "Oriented bounding box coordinates must be integers or floats."
|
|
104
|
-
return OBBox(
|
|
105
|
-
title=title,
|
|
106
|
-
coords=[
|
|
107
|
-
round(coords["x1"]),
|
|
108
|
-
round(coords["y1"]),
|
|
109
|
-
round(coords["x2"]),
|
|
110
|
-
round(coords["y2"]),
|
|
111
|
-
round(coords["x3"]),
|
|
112
|
-
round(coords["y3"]),
|
|
113
|
-
round(coords["x4"]),
|
|
114
|
-
round(coords["y4"]),
|
|
115
|
-
],
|
|
116
|
-
)
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
|
|
3
|
-
from datachain.lib.data_model import DataModel
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Pose(DataModel):
|
|
7
|
-
"""
|
|
8
|
-
A data model for representing pose keypoints.
|
|
9
|
-
|
|
10
|
-
Attributes:
|
|
11
|
-
x (list[int]): The x-coordinates of the keypoints.
|
|
12
|
-
y (list[int]): The y-coordinates of the keypoints.
|
|
13
|
-
|
|
14
|
-
The keypoints are represented as lists of x and y coordinates, where each index
|
|
15
|
-
corresponds to a specific body part.
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
x: list[int] = Field(default=None)
|
|
19
|
-
y: list[int] = Field(default=None)
|
|
20
|
-
|
|
21
|
-
@staticmethod
|
|
22
|
-
def from_list(points: list[list[float]]) -> "Pose":
|
|
23
|
-
assert len(points) == 2, "Pose coordinates must be a list of 2 lists."
|
|
24
|
-
points_x, points_y = points
|
|
25
|
-
assert (
|
|
26
|
-
len(points_x) == len(points_y) == 17
|
|
27
|
-
), "Pose x and y coordinates must have the same length of 17."
|
|
28
|
-
assert all(
|
|
29
|
-
isinstance(value, (int, float)) for value in [*points_x, *points_y]
|
|
30
|
-
), "Pose coordinates must be integers or floats."
|
|
31
|
-
return Pose(
|
|
32
|
-
x=[round(coord) for coord in points_x],
|
|
33
|
-
y=[round(coord) for coord in points_y],
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
@staticmethod
|
|
37
|
-
def from_dict(points: dict[str, list[float]]) -> "Pose":
|
|
38
|
-
assert set(points) == {
|
|
39
|
-
"x",
|
|
40
|
-
"y",
|
|
41
|
-
}, "Pose coordinates must contain keys 'x' and 'y'."
|
|
42
|
-
points_x, points_y = points["x"], points["y"]
|
|
43
|
-
assert (
|
|
44
|
-
len(points_x) == len(points_y) == 17
|
|
45
|
-
), "Pose x and y coordinates must have the same length of 17."
|
|
46
|
-
assert all(
|
|
47
|
-
isinstance(value, (int, float)) for value in [*points_x, *points_y]
|
|
48
|
-
), "Pose coordinates must be integers or floats."
|
|
49
|
-
return Pose(
|
|
50
|
-
x=[round(coord) for coord in points_x],
|
|
51
|
-
y=[round(coord) for coord in points_y],
|
|
52
|
-
)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
class Pose3D(DataModel):
|
|
56
|
-
"""
|
|
57
|
-
A data model for representing 3D pose keypoints.
|
|
58
|
-
|
|
59
|
-
Attributes:
|
|
60
|
-
x (list[int]): The x-coordinates of the keypoints.
|
|
61
|
-
y (list[int]): The y-coordinates of the keypoints.
|
|
62
|
-
visible (list[float]): The visibility of the keypoints.
|
|
63
|
-
|
|
64
|
-
The keypoints are represented as lists of x, y, and visibility values,
|
|
65
|
-
where each index corresponds to a specific body part.
|
|
66
|
-
"""
|
|
67
|
-
|
|
68
|
-
x: list[int] = Field(default=None)
|
|
69
|
-
y: list[int] = Field(default=None)
|
|
70
|
-
visible: list[float] = Field(default=None)
|
|
71
|
-
|
|
72
|
-
@staticmethod
|
|
73
|
-
def from_list(points: list[list[float]]) -> "Pose3D":
|
|
74
|
-
assert len(points) == 3, "Pose coordinates must be a list of 3 lists."
|
|
75
|
-
points_x, points_y, points_v = points
|
|
76
|
-
assert (
|
|
77
|
-
len(points_x) == len(points_y) == len(points_v) == 17
|
|
78
|
-
), "Pose x, y, and visibility coordinates must have the same length of 17."
|
|
79
|
-
assert all(
|
|
80
|
-
isinstance(value, (int, float))
|
|
81
|
-
for value in [*points_x, *points_y, *points_v]
|
|
82
|
-
), "Pose coordinates must be integers or floats."
|
|
83
|
-
return Pose3D(
|
|
84
|
-
x=[round(coord) for coord in points_x],
|
|
85
|
-
y=[round(coord) for coord in points_y],
|
|
86
|
-
visible=points_v,
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
@staticmethod
|
|
90
|
-
def from_dict(points: dict[str, list[float]]) -> "Pose3D":
|
|
91
|
-
assert set(points) == {
|
|
92
|
-
"x",
|
|
93
|
-
"y",
|
|
94
|
-
"visible",
|
|
95
|
-
}, "Pose coordinates must contain keys 'x', 'y', and 'visible'."
|
|
96
|
-
points_x, points_y, points_v = points["x"], points["y"], points["visible"]
|
|
97
|
-
assert (
|
|
98
|
-
len(points_x) == len(points_y) == len(points_v) == 17
|
|
99
|
-
), "Pose x, y, and visibility coordinates must have the same length of 17."
|
|
100
|
-
assert all(
|
|
101
|
-
isinstance(value, (int, float))
|
|
102
|
-
for value in [*points_x, *points_y, *points_v]
|
|
103
|
-
), "Pose coordinates must be integers or floats."
|
|
104
|
-
return Pose3D(
|
|
105
|
-
x=[round(coord) for coord in points_x],
|
|
106
|
-
y=[round(coord) for coord in points_y],
|
|
107
|
-
visible=points_v,
|
|
108
|
-
)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
from pydantic import Field
|
|
2
|
-
|
|
3
|
-
from datachain.lib.data_model import DataModel
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class Segments(DataModel):
|
|
7
|
-
"""
|
|
8
|
-
A data model for representing segments.
|
|
9
|
-
|
|
10
|
-
Attributes:
|
|
11
|
-
title (str): The title of the segments.
|
|
12
|
-
x (list[int]): The x-coordinates of the segments.
|
|
13
|
-
y (list[int]): The y-coordinates of the segments.
|
|
14
|
-
|
|
15
|
-
The segments are represented as lists of x and y coordinates, where each index
|
|
16
|
-
corresponds to a specific segment.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
title: str = Field(default="")
|
|
20
|
-
x: list[int] = Field(default=None)
|
|
21
|
-
y: list[int] = Field(default=None)
|
|
22
|
-
|
|
23
|
-
@staticmethod
|
|
24
|
-
def from_list(points: list[list[float]], title: str = "") -> "Segments":
|
|
25
|
-
assert len(points) == 2, "Segments coordinates must be a list of 2 lists."
|
|
26
|
-
points_x, points_y = points
|
|
27
|
-
assert len(points_x) == len(
|
|
28
|
-
points_y
|
|
29
|
-
), "Segments x and y coordinates must have the same length."
|
|
30
|
-
assert all(
|
|
31
|
-
isinstance(value, (int, float)) for value in [*points_x, *points_y]
|
|
32
|
-
), "Segments coordinates must be integers or floats."
|
|
33
|
-
return Segments(
|
|
34
|
-
title=title,
|
|
35
|
-
x=[round(coord) for coord in points_x],
|
|
36
|
-
y=[round(coord) for coord in points_y],
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
@staticmethod
|
|
40
|
-
def from_dict(points: dict[str, list[float]], title: str = "") -> "Segments":
|
|
41
|
-
assert set(points) == {
|
|
42
|
-
"x",
|
|
43
|
-
"y",
|
|
44
|
-
}, "Segments coordinates must contain keys 'x' and 'y'."
|
|
45
|
-
points_x, points_y = points["x"], points["y"]
|
|
46
|
-
assert all(
|
|
47
|
-
isinstance(value, (int, float)) for value in [*points_x, *points_y]
|
|
48
|
-
), "Segments coordinates must be integers or floats."
|
|
49
|
-
return Segments(
|
|
50
|
-
title=title,
|
|
51
|
-
x=[round(coord) for coord in points_x],
|
|
52
|
-
y=[round(coord) for coord in points_y],
|
|
53
|
-
)
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
from .bbox import YoloBBox, YoloBBoxes, YoloOBBox, YoloOBBoxes
|
|
2
|
-
from .pose import YoloPose, YoloPoses
|
|
3
|
-
from .segment import YoloSegment, YoloSegments
|
|
4
|
-
|
|
5
|
-
__all__ = [
|
|
6
|
-
"YoloBBox",
|
|
7
|
-
"YoloBBoxes",
|
|
8
|
-
"YoloOBBox",
|
|
9
|
-
"YoloOBBoxes",
|
|
10
|
-
"YoloPose",
|
|
11
|
-
"YoloPoses",
|
|
12
|
-
"YoloSegment",
|
|
13
|
-
"YoloSegments",
|
|
14
|
-
]
|