datachain 0.7.0__tar.gz → 0.7.1__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.7.0/src/datachain.egg-info → datachain-0.7.1}/PKG-INFO +2 -1
- {datachain-0.7.0 → datachain-0.7.1}/examples/computer_vision/openimage-detect.py +9 -15
- datachain-0.7.1/examples/computer_vision/ultralytics-bbox.py +22 -0
- datachain-0.7.1/examples/computer_vision/ultralytics-pose.py +22 -0
- datachain-0.7.1/examples/computer_vision/ultralytics-segment.py +22 -0
- {datachain-0.7.0 → datachain-0.7.1}/pyproject.toml +2 -1
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/__init__.py +1 -2
- datachain-0.7.1/src/datachain/model/__init__.py +6 -0
- datachain-0.7.1/src/datachain/model/bbox.py +102 -0
- datachain-0.7.1/src/datachain/model/pose.py +88 -0
- datachain-0.7.1/src/datachain/model/segment.py +47 -0
- datachain-0.7.1/src/datachain/model/ultralytics/__init__.py +27 -0
- datachain-0.7.1/src/datachain/model/ultralytics/bbox.py +147 -0
- datachain-0.7.1/src/datachain/model/ultralytics/pose.py +113 -0
- datachain-0.7.1/src/datachain/model/ultralytics/segment.py +91 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/toolkit/split.py +6 -2
- {datachain-0.7.0 → datachain-0.7.1/src/datachain.egg-info}/PKG-INFO +2 -1
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain.egg-info/SOURCES.txt +11 -4
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain.egg-info/requires.txt +1 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/conftest.py +20 -20
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_pull.py +1 -1
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_toolkit.py +3 -3
- datachain-0.7.1/tests/unit/lib/test_models.py +142 -0
- datachain-0.7.0/src/datachain/lib/models/__init__.py +0 -5
- datachain-0.7.0/src/datachain/lib/models/bbox.py +0 -45
- datachain-0.7.0/src/datachain/lib/models/pose.py +0 -37
- datachain-0.7.0/src/datachain/lib/models/yolo.py +0 -39
- datachain-0.7.0/tests/unit/lib/test_models.py +0 -50
- {datachain-0.7.0 → datachain-0.7.1}/.cruft.json +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.gitattributes +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/ISSUE_TEMPLATE/empty_issue.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/codecov.yaml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/dependabot.yml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/workflows/benchmarks.yml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/workflows/release.yml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/workflows/tests-studio.yml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/workflows/tests.yml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.github/workflows/update-template.yaml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.gitignore +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/.pre-commit-config.yaml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/CODE_OF_CONDUCT.rst +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/CONTRIBUTING.rst +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/LICENSE +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/README.rst +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/assets/captioned_cartoons.png +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/assets/datachain-white.svg +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/assets/datachain.svg +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/index.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/overrides/main.html +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/references/datachain.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/references/datatype.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/references/file.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/references/index.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/references/sql.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/references/torch.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/docs/references/udf.md +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/computer_vision/iptc_exif_xmp_lib.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/computer_vision/llava2_image_desc_lib.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/get_started/common_sql_functions.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/get_started/json-csv-reader.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/get_started/torch-loader.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/get_started/udfs/parallel.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/get_started/udfs/simple.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/get_started/udfs/stateful.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/llm_and_nlp/claude-query.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/llm_and_nlp/hf-dataset-llm-eval.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/llm_and_nlp/unstructured-embeddings-gen.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/llm_and_nlp/unstructured-summary-map.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/multimodal/clip_inference.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/multimodal/hf_pipeline.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/multimodal/openai_image_desc_lib.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/multimodal/wds.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/examples/multimodal/wds_filtered.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/mkdocs.yml +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/noxfile.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/setup.cfg +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/__main__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/asyn.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/cache.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/catalog/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/catalog/catalog.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/catalog/datasource.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/catalog/loader.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/cli.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/cli_utils.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/client/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/client/azure.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/client/fileslice.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/client/fsspec.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/client/gcs.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/client/hf.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/client/local.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/client/s3.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/config.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/db_engine.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/id_generator.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/job.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/metastore.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/schema.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/serializer.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/sqlite.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/data_storage/warehouse.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/dataset.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/error.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/job.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/arrow.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/clip.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/convert/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/convert/flatten.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/convert/python_to_sql.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/convert/sql_to_python.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/convert/unflatten.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/convert/values_to_tuples.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/data_model.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/dataset_info.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/dc.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/file.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/func/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/func/aggregate.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/func/func.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/hf.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/image.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/listing.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/listing_info.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/meta_formats.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/model_store.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/pytorch.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/settings.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/signal_schema.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/tar.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/text.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/udf.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/udf_signature.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/utils.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/vfile.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/webdataset.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/lib/webdataset_laion.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/listing.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/node.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/nodes_fetcher.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/nodes_thread_pool.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/progress.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/py.typed +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/batch.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/dataset.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/dispatch.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/metrics.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/params.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/queue.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/schema.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/query/session.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/remote/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/remote/studio.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/default/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/default/base.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/functions/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/functions/aggregate.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/functions/array.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/functions/conditional.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/functions/path.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/functions/random.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/functions/string.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/selectable.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/sqlite/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/sqlite/base.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/sqlite/types.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/sqlite/vector.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/types.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/sql/utils.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/studio.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/telemetry.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/toolkit/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/torch/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain/utils.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain.egg-info/dependency_links.txt +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain.egg-info/entry_points.txt +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/src/datachain.egg-info/top_level.txt +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/conftest.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/datasets/.dvc/.gitignore +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/datasets/.dvc/config +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/datasets/.gitignore +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/datasets/laion-tiny.npz.dvc +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/test_datachain.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/test_ls.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/benchmarks/test_version.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/data.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/examples/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/examples/test_examples.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/examples/test_wds_e2e.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/examples/wds_data.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_catalog.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_client.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_datachain.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_dataset_query.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_datasets.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_feature_pickling.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_listing.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_ls.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_meta_formats.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_metrics.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_pytorch.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/func/test_query.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/scripts/feature_class.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/scripts/feature_class_exception.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/scripts/feature_class_parallel.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/scripts/feature_class_parallel_data_model.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/scripts/name_len_slow.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/test_atomicity.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/test_cli_e2e.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/test_cli_studio.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/test_query_e2e.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/test_telemetry.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/conftest.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_arrow.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_clip.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_datachain.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_datachain_bootstrap.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_datachain_merge.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_feature.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_feature_utils.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_file.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_hf.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_image.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_listing_info.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_schema.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_signal_schema.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_sql_to_python.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_text.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_udf_signature.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_utils.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/lib/test_webdataset.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/sqlite/__init__.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/sqlite/test_types.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/sqlite/test_utils.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/test_array.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/test_conditional.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/test_path.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/test_random.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/test_selectable.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/sql/test_string.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_asyn.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_cache.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_catalog.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_catalog_loader.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_cli_parsing.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_client.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_client_s3.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_config.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_data_storage.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_database_engine.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_dataset.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_dispatch.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_fileslice.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_id_generator.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_listing.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_metastore.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_module_exports.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_query.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_query_metrics.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_query_params.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_serializer.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_session.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_utils.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/unit/test_warehouse.py +0 -0
- {datachain-0.7.0 → datachain-0.7.1}/tests/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: datachain
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.1
|
|
4
4
|
Summary: Wrangle unstructured AI data at scale
|
|
5
5
|
Author-email: Dmitry Petrov <support@dvc.org>
|
|
6
6
|
License: Apache-2.0
|
|
@@ -98,6 +98,7 @@ Requires-Dist: unstructured[embed-huggingface,pdf]<0.16.0; extra == "examples"
|
|
|
98
98
|
Requires-Dist: pdfplumber==0.11.4; extra == "examples"
|
|
99
99
|
Requires-Dist: huggingface_hub[hf_transfer]; extra == "examples"
|
|
100
100
|
Requires-Dist: onnx==1.16.1; extra == "examples"
|
|
101
|
+
Requires-Dist: ultralytics==8.3.29; extra == "examples"
|
|
101
102
|
|
|
102
103
|
================
|
|
103
104
|
|logo| DataChain
|
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import json
|
|
2
2
|
|
|
3
3
|
from PIL import Image
|
|
4
|
-
from pydantic import BaseModel
|
|
5
4
|
|
|
6
|
-
from datachain import C, DataChain, File
|
|
5
|
+
from datachain import C, DataChain, File, model
|
|
7
6
|
from datachain.sql.functions import path
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
class BBox(BaseModel):
|
|
11
|
-
x_min: int
|
|
12
|
-
x_max: int
|
|
13
|
-
y_min: int
|
|
14
|
-
y_max: int
|
|
15
|
-
|
|
16
|
-
|
|
17
9
|
def openimage_detect(args):
|
|
18
10
|
if len(args) != 2:
|
|
19
11
|
raise ValueError("Group jpg-json mismatch")
|
|
@@ -30,11 +22,13 @@ def openimage_detect(args):
|
|
|
30
22
|
detections = json.load(stream_json).get("detections", [])
|
|
31
23
|
|
|
32
24
|
for i, detect in enumerate(detections):
|
|
33
|
-
bbox = BBox(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
bbox = model.BBox.from_list(
|
|
26
|
+
[
|
|
27
|
+
detect["XMin"] * img.width,
|
|
28
|
+
detect["XMax"] * img.width,
|
|
29
|
+
detect["YMin"] * img.height,
|
|
30
|
+
detect["YMax"] * img.height,
|
|
31
|
+
]
|
|
38
32
|
)
|
|
39
33
|
|
|
40
34
|
fstream = File(
|
|
@@ -56,7 +50,7 @@ source = "gs://datachain-demo/openimages-v6-test-jsonpairs/"
|
|
|
56
50
|
openimage_detect,
|
|
57
51
|
partition_by=path.file_stem(C("file.path")),
|
|
58
52
|
params=["file"],
|
|
59
|
-
output={"file": File, "bbox": BBox},
|
|
53
|
+
output={"file": File, "bbox": model.BBox},
|
|
60
54
|
)
|
|
61
55
|
.show()
|
|
62
56
|
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from io import BytesIO
|
|
2
|
+
|
|
3
|
+
from PIL import Image
|
|
4
|
+
from ultralytics import YOLO
|
|
5
|
+
|
|
6
|
+
from datachain import C, DataChain, File
|
|
7
|
+
from datachain.model.ultralytics import YoloBBoxes
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def process_bboxes(yolo: YOLO, file: File) -> YoloBBoxes:
|
|
11
|
+
results = yolo(Image.open(BytesIO(file.read())))
|
|
12
|
+
return YoloBBoxes.from_results(results)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
(
|
|
16
|
+
DataChain.from_storage("gs://datachain-demo/openimages-v6-test-jsonpairs/")
|
|
17
|
+
.filter(C("file.path").glob("*.jpg"))
|
|
18
|
+
.limit(20)
|
|
19
|
+
.setup(yolo=lambda: YOLO("yolo11n.pt"))
|
|
20
|
+
.map(boxes=process_bboxes)
|
|
21
|
+
.show()
|
|
22
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from io import BytesIO
|
|
2
|
+
|
|
3
|
+
from PIL import Image
|
|
4
|
+
from ultralytics import YOLO
|
|
5
|
+
|
|
6
|
+
from datachain import C, DataChain, File
|
|
7
|
+
from datachain.model.ultralytics import YoloPoses
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def process_poses(yolo: YOLO, file: File) -> YoloPoses:
|
|
11
|
+
results = yolo(Image.open(BytesIO(file.read())))
|
|
12
|
+
return YoloPoses.from_results(results)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
(
|
|
16
|
+
DataChain.from_storage("gs://datachain-demo/openimages-v6-test-jsonpairs/")
|
|
17
|
+
.filter(C("file.path").glob("*.jpg"))
|
|
18
|
+
.limit(20)
|
|
19
|
+
.setup(yolo=lambda: YOLO("yolo11n-pose.pt"))
|
|
20
|
+
.map(poses=process_poses)
|
|
21
|
+
.show()
|
|
22
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from io import BytesIO
|
|
2
|
+
|
|
3
|
+
from PIL import Image
|
|
4
|
+
from ultralytics import YOLO
|
|
5
|
+
|
|
6
|
+
from datachain import C, DataChain, File
|
|
7
|
+
from datachain.model.ultralytics import YoloSegments
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def process_segments(yolo: YOLO, file: File) -> YoloSegments:
|
|
11
|
+
results = yolo(Image.open(BytesIO(file.read())))
|
|
12
|
+
return YoloSegments.from_results(results)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
(
|
|
16
|
+
DataChain.from_storage("gs://datachain-demo/openimages-v6-test-jsonpairs/")
|
|
17
|
+
.filter(C("file.path").glob("*.jpg"))
|
|
18
|
+
.limit(20)
|
|
19
|
+
.setup(yolo=lambda: YOLO("yolo11n-seg.pt"))
|
|
20
|
+
.map(segments=process_segments)
|
|
21
|
+
.show()
|
|
22
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from datachain.lib import func
|
|
1
|
+
from datachain.lib import func
|
|
2
2
|
from datachain.lib.data_model import DataModel, DataType, is_chain_type
|
|
3
3
|
from datachain.lib.dc import C, Column, DataChain, Sys
|
|
4
4
|
from datachain.lib.file import (
|
|
@@ -38,6 +38,5 @@ __all__ = [
|
|
|
38
38
|
"func",
|
|
39
39
|
"is_chain_type",
|
|
40
40
|
"metrics",
|
|
41
|
-
"models",
|
|
42
41
|
"param",
|
|
43
42
|
]
|
|
@@ -0,0 +1,102 @@
|
|
|
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 box.
|
|
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 must be a list of 4 coordinates."
|
|
25
|
+
assert all(
|
|
26
|
+
isinstance(value, (int, float)) for value in coords
|
|
27
|
+
), "Bounding box coordinates must be floats or integers."
|
|
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 isinstance(coords, dict) and set(coords) == {
|
|
36
|
+
"x1",
|
|
37
|
+
"y1",
|
|
38
|
+
"x2",
|
|
39
|
+
"y2",
|
|
40
|
+
}, "Bounding box must be a dictionary with keys 'x1', 'y1', 'x2' and 'y2'."
|
|
41
|
+
return BBox.from_list(
|
|
42
|
+
[coords["x1"], coords["y1"], coords["x2"], coords["y2"]],
|
|
43
|
+
title=title,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class OBBox(DataModel):
|
|
48
|
+
"""
|
|
49
|
+
A data model for representing oriented bounding boxes.
|
|
50
|
+
|
|
51
|
+
Attributes:
|
|
52
|
+
title (str): The title of the oriented bounding box.
|
|
53
|
+
coords (list[int]): The coordinates of the oriented bounding box.
|
|
54
|
+
|
|
55
|
+
The oriented bounding box is defined by four points:
|
|
56
|
+
- (x1, y1): The first corner of the box.
|
|
57
|
+
- (x2, y2): The second corner of the box.
|
|
58
|
+
- (x3, y3): The third corner of the box.
|
|
59
|
+
- (x4, y4): The fourth corner of the box.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
title: str = Field(default="")
|
|
63
|
+
coords: list[int] = Field(default=None)
|
|
64
|
+
|
|
65
|
+
@staticmethod
|
|
66
|
+
def from_list(coords: list[float], title: str = "") -> "OBBox":
|
|
67
|
+
assert (
|
|
68
|
+
len(coords) == 8
|
|
69
|
+
), "Oriented bounding box must be a list of 8 coordinates."
|
|
70
|
+
assert all(
|
|
71
|
+
isinstance(value, (int, float)) for value in coords
|
|
72
|
+
), "Oriented bounding box coordinates must be floats or integers."
|
|
73
|
+
return OBBox(
|
|
74
|
+
title=title,
|
|
75
|
+
coords=[round(c) for c in coords],
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
@staticmethod
|
|
79
|
+
def from_dict(coords: dict[str, float], title: str = "") -> "OBBox":
|
|
80
|
+
assert isinstance(coords, dict) and set(coords) == {
|
|
81
|
+
"x1",
|
|
82
|
+
"y1",
|
|
83
|
+
"x2",
|
|
84
|
+
"y2",
|
|
85
|
+
"x3",
|
|
86
|
+
"y3",
|
|
87
|
+
"x4",
|
|
88
|
+
"y4",
|
|
89
|
+
}, "Oriented bounding box must be a dictionary with coordinates."
|
|
90
|
+
return OBBox.from_list(
|
|
91
|
+
[
|
|
92
|
+
coords["x1"],
|
|
93
|
+
coords["y1"],
|
|
94
|
+
coords["x2"],
|
|
95
|
+
coords["y2"],
|
|
96
|
+
coords["x3"],
|
|
97
|
+
coords["y3"],
|
|
98
|
+
coords["x4"],
|
|
99
|
+
coords["y4"],
|
|
100
|
+
],
|
|
101
|
+
title=title,
|
|
102
|
+
)
|
|
@@ -0,0 +1,88 @@
|
|
|
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 must be a list of 2 lists: x and y coordinates."
|
|
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 floats or integers."
|
|
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 isinstance(points, dict) and set(points) == {
|
|
39
|
+
"x",
|
|
40
|
+
"y",
|
|
41
|
+
}, "Pose must be a dict with keys 'x' and 'y'."
|
|
42
|
+
return Pose.from_list([points["x"], points["y"]])
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class Pose3D(DataModel):
|
|
46
|
+
"""
|
|
47
|
+
A data model for representing 3D pose keypoints.
|
|
48
|
+
|
|
49
|
+
Attributes:
|
|
50
|
+
x (list[int]): The x-coordinates of the keypoints.
|
|
51
|
+
y (list[int]): The y-coordinates of the keypoints.
|
|
52
|
+
visible (list[float]): The visibility of the keypoints.
|
|
53
|
+
|
|
54
|
+
The keypoints are represented as lists of x, y, and visibility values,
|
|
55
|
+
where each index corresponds to a specific body part.
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
x: list[int] = Field(default=None)
|
|
59
|
+
y: list[int] = Field(default=None)
|
|
60
|
+
visible: list[float] = Field(default=None)
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
def from_list(points: list[list[float]]) -> "Pose3D":
|
|
64
|
+
assert (
|
|
65
|
+
len(points) == 3
|
|
66
|
+
), "Pose3D must be a list of 3 lists: x, y coordinates and visible."
|
|
67
|
+
points_x, points_y, points_v = points
|
|
68
|
+
assert (
|
|
69
|
+
len(points_x) == len(points_y) == len(points_v) == 17
|
|
70
|
+
), "Pose3D x, y coordinates and visible must have the same length of 17."
|
|
71
|
+
assert all(
|
|
72
|
+
isinstance(value, (int, float))
|
|
73
|
+
for value in [*points_x, *points_y, *points_v]
|
|
74
|
+
), "Pose3D coordinates must be floats or integers."
|
|
75
|
+
return Pose3D(
|
|
76
|
+
x=[round(coord) for coord in points_x],
|
|
77
|
+
y=[round(coord) for coord in points_y],
|
|
78
|
+
visible=points_v,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
@staticmethod
|
|
82
|
+
def from_dict(points: dict[str, list[float]]) -> "Pose3D":
|
|
83
|
+
assert isinstance(points, dict) and set(points) == {
|
|
84
|
+
"x",
|
|
85
|
+
"y",
|
|
86
|
+
"visible",
|
|
87
|
+
}, "Pose3D must be a dict with keys 'x', 'y' and 'visible'."
|
|
88
|
+
return Pose3D.from_list([points["x"], points["y"], points["visible"]])
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from pydantic import Field
|
|
2
|
+
|
|
3
|
+
from datachain.lib.data_model import DataModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Segment(DataModel):
|
|
7
|
+
"""
|
|
8
|
+
A data model for representing segment.
|
|
9
|
+
|
|
10
|
+
Attributes:
|
|
11
|
+
title (str): The title of the segment.
|
|
12
|
+
x (list[int]): The x-coordinates of the segment.
|
|
13
|
+
y (list[int]): The y-coordinates of the segment.
|
|
14
|
+
|
|
15
|
+
The segment is represented as lists of x and y coordinates, where each index
|
|
16
|
+
corresponds to a specific point.
|
|
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 = "") -> "Segment":
|
|
25
|
+
assert (
|
|
26
|
+
len(points) == 2
|
|
27
|
+
), "Segment must be a list of 2 lists: x and y coordinates."
|
|
28
|
+
points_x, points_y = points
|
|
29
|
+
assert len(points_x) == len(
|
|
30
|
+
points_y
|
|
31
|
+
), "Segment x and y coordinates must have the same length."
|
|
32
|
+
assert all(
|
|
33
|
+
isinstance(value, (int, float)) for value in [*points_x, *points_y]
|
|
34
|
+
), "Segment coordinates must be floats or integers."
|
|
35
|
+
return Segment(
|
|
36
|
+
title=title,
|
|
37
|
+
x=[round(coord) for coord in points_x],
|
|
38
|
+
y=[round(coord) for coord in points_y],
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
@staticmethod
|
|
42
|
+
def from_dict(points: dict[str, list[float]], title: str = "") -> "Segment":
|
|
43
|
+
assert isinstance(points, dict) and set(points) == {
|
|
44
|
+
"x",
|
|
45
|
+
"y",
|
|
46
|
+
}, "Segment must be a dict with keys 'x' and 'y'."
|
|
47
|
+
return Segment.from_list([points["x"], points["y"]], title=title)
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
from .bbox import YoloBBox, YoloBBoxes, YoloOBBox, YoloOBBoxes
|
|
15
|
+
from .pose import YoloPose, YoloPoses
|
|
16
|
+
from .segment import YoloSegment, YoloSegments
|
|
17
|
+
|
|
18
|
+
__all__ = [
|
|
19
|
+
"YoloBBox",
|
|
20
|
+
"YoloBBoxes",
|
|
21
|
+
"YoloOBBox",
|
|
22
|
+
"YoloOBBoxes",
|
|
23
|
+
"YoloPose",
|
|
24
|
+
"YoloPoses",
|
|
25
|
+
"YoloSegment",
|
|
26
|
+
"YoloSegments",
|
|
27
|
+
]
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from datachain.lib.data_model import DataModel
|
|
6
|
+
from datachain.model.bbox import BBox, OBBox
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from ultralytics.engine.results import Results
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class YoloBBox(DataModel):
|
|
13
|
+
"""
|
|
14
|
+
A class representing a bounding box detected by a YOLO model.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
cls: The class of the detected object.
|
|
18
|
+
name: The name of the detected object.
|
|
19
|
+
confidence: The confidence score of the detection.
|
|
20
|
+
box: The bounding box of the detected object
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
cls: int = Field(default=-1)
|
|
24
|
+
name: str = Field(default="")
|
|
25
|
+
confidence: float = Field(default=0)
|
|
26
|
+
box: BBox
|
|
27
|
+
|
|
28
|
+
@staticmethod
|
|
29
|
+
def from_result(result: "Results") -> "YoloBBox":
|
|
30
|
+
summary = result.summary()
|
|
31
|
+
if not summary:
|
|
32
|
+
return YoloBBox(box=BBox())
|
|
33
|
+
name = summary[0].get("name", "")
|
|
34
|
+
box = (
|
|
35
|
+
BBox.from_dict(summary[0]["box"], title=name)
|
|
36
|
+
if "box" in summary[0]
|
|
37
|
+
else BBox()
|
|
38
|
+
)
|
|
39
|
+
return YoloBBox(
|
|
40
|
+
cls=summary[0]["class"],
|
|
41
|
+
name=name,
|
|
42
|
+
confidence=summary[0]["confidence"],
|
|
43
|
+
box=box,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class YoloBBoxes(DataModel):
|
|
48
|
+
"""
|
|
49
|
+
A class representing a list of bounding boxes detected by a YOLO model.
|
|
50
|
+
|
|
51
|
+
Attributes:
|
|
52
|
+
cls: A list of classes of the detected objects.
|
|
53
|
+
name: A list of names of the detected objects.
|
|
54
|
+
confidence: A list of confidence scores of the detections.
|
|
55
|
+
box: A list of bounding boxes of the detected objects
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
cls: list[int]
|
|
59
|
+
name: list[str]
|
|
60
|
+
confidence: list[float]
|
|
61
|
+
box: list[BBox]
|
|
62
|
+
|
|
63
|
+
@staticmethod
|
|
64
|
+
def from_results(results: list["Results"]) -> "YoloBBoxes":
|
|
65
|
+
cls, names, confidence, box = [], [], [], []
|
|
66
|
+
for r in results:
|
|
67
|
+
for s in r.summary():
|
|
68
|
+
name = s.get("name", "")
|
|
69
|
+
cls.append(s["class"])
|
|
70
|
+
names.append(name)
|
|
71
|
+
confidence.append(s["confidence"])
|
|
72
|
+
box.append(BBox.from_dict(s.get("box", {}), title=name))
|
|
73
|
+
return YoloBBoxes(
|
|
74
|
+
cls=cls,
|
|
75
|
+
name=names,
|
|
76
|
+
confidence=confidence,
|
|
77
|
+
box=box,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class YoloOBBox(DataModel):
|
|
82
|
+
"""
|
|
83
|
+
A class representing an oriented bounding box detected by a YOLO model.
|
|
84
|
+
|
|
85
|
+
Attributes:
|
|
86
|
+
cls: The class of the detected object.
|
|
87
|
+
name: The name of the detected object.
|
|
88
|
+
confidence: The confidence score of the detection.
|
|
89
|
+
box: The oriented bounding box of the detected object.
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
cls: int = Field(default=-1)
|
|
93
|
+
name: str = Field(default="")
|
|
94
|
+
confidence: float = Field(default=0)
|
|
95
|
+
box: OBBox
|
|
96
|
+
|
|
97
|
+
@staticmethod
|
|
98
|
+
def from_result(result: "Results") -> "YoloOBBox":
|
|
99
|
+
summary = result.summary()
|
|
100
|
+
if not summary:
|
|
101
|
+
return YoloOBBox(box=OBBox())
|
|
102
|
+
name = summary[0].get("name", "")
|
|
103
|
+
box = (
|
|
104
|
+
OBBox.from_dict(summary[0]["box"], title=name)
|
|
105
|
+
if "box" in summary[0]
|
|
106
|
+
else OBBox()
|
|
107
|
+
)
|
|
108
|
+
return YoloOBBox(
|
|
109
|
+
cls=summary[0]["class"],
|
|
110
|
+
name=name,
|
|
111
|
+
confidence=summary[0]["confidence"],
|
|
112
|
+
box=box,
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
class YoloOBBoxes(DataModel):
|
|
117
|
+
"""
|
|
118
|
+
A class representing a list of oriented bounding boxes detected by a YOLO model.
|
|
119
|
+
|
|
120
|
+
Attributes:
|
|
121
|
+
cls: A list of classes of the detected objects.
|
|
122
|
+
name: A list of names of the detected objects.
|
|
123
|
+
confidence: A list of confidence scores of the detections.
|
|
124
|
+
box: A list of oriented bounding boxes of the detected objects.
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
cls: list[int]
|
|
128
|
+
name: list[str]
|
|
129
|
+
confidence: list[float]
|
|
130
|
+
box: list[OBBox]
|
|
131
|
+
|
|
132
|
+
@staticmethod
|
|
133
|
+
def from_results(results: list["Results"]) -> "YoloOBBoxes":
|
|
134
|
+
cls, names, confidence, box = [], [], [], []
|
|
135
|
+
for r in results:
|
|
136
|
+
for s in r.summary():
|
|
137
|
+
name = s.get("name", "")
|
|
138
|
+
cls.append(s["class"])
|
|
139
|
+
names.append(name)
|
|
140
|
+
confidence.append(s["confidence"])
|
|
141
|
+
box.append(OBBox.from_dict(s.get("box", {}), title=name))
|
|
142
|
+
return YoloOBBoxes(
|
|
143
|
+
cls=cls,
|
|
144
|
+
name=names,
|
|
145
|
+
confidence=confidence,
|
|
146
|
+
box=box,
|
|
147
|
+
)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING
|
|
2
|
+
|
|
3
|
+
from pydantic import Field
|
|
4
|
+
|
|
5
|
+
from datachain.lib.data_model import DataModel
|
|
6
|
+
from datachain.model.bbox import BBox
|
|
7
|
+
from datachain.model.pose import Pose3D
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ultralytics.engine.results import Results
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class YoloPoseBodyPart:
|
|
14
|
+
"""An enumeration of body parts for YOLO pose keypoints."""
|
|
15
|
+
|
|
16
|
+
nose = 0
|
|
17
|
+
left_eye = 1
|
|
18
|
+
right_eye = 2
|
|
19
|
+
left_ear = 3
|
|
20
|
+
right_ear = 4
|
|
21
|
+
left_shoulder = 5
|
|
22
|
+
right_shoulder = 6
|
|
23
|
+
left_elbow = 7
|
|
24
|
+
right_elbow = 8
|
|
25
|
+
left_wrist = 9
|
|
26
|
+
right_wrist = 10
|
|
27
|
+
left_hip = 11
|
|
28
|
+
right_hip = 12
|
|
29
|
+
left_knee = 13
|
|
30
|
+
right_knee = 14
|
|
31
|
+
left_ankle = 15
|
|
32
|
+
right_ankle = 16
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class YoloPose(DataModel):
|
|
36
|
+
"""
|
|
37
|
+
A data model for YOLO pose keypoints.
|
|
38
|
+
|
|
39
|
+
Attributes:
|
|
40
|
+
cls: The class of the pose.
|
|
41
|
+
name: The name of the pose.
|
|
42
|
+
confidence: The confidence score of the pose.
|
|
43
|
+
box: The bounding box of the pose.
|
|
44
|
+
pose: The 3D pose keypoints.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
cls: int = Field(default=-1)
|
|
48
|
+
name: str = Field(default="")
|
|
49
|
+
confidence: float = Field(default=0)
|
|
50
|
+
box: BBox
|
|
51
|
+
pose: Pose3D
|
|
52
|
+
|
|
53
|
+
@staticmethod
|
|
54
|
+
def from_result(result: "Results") -> "YoloPose":
|
|
55
|
+
summary = result.summary()
|
|
56
|
+
if not summary:
|
|
57
|
+
return YoloPose(box=BBox(), pose=Pose3D())
|
|
58
|
+
name = summary[0].get("name", "")
|
|
59
|
+
box = (
|
|
60
|
+
BBox.from_dict(summary[0]["box"], title=name)
|
|
61
|
+
if "box" in summary[0]
|
|
62
|
+
else BBox()
|
|
63
|
+
)
|
|
64
|
+
pose = (
|
|
65
|
+
Pose3D.from_dict(summary[0]["keypoints"])
|
|
66
|
+
if "keypoints" in summary[0]
|
|
67
|
+
else Pose3D()
|
|
68
|
+
)
|
|
69
|
+
return YoloPose(
|
|
70
|
+
cls=summary[0]["class"],
|
|
71
|
+
name=name,
|
|
72
|
+
confidence=summary[0]["confidence"],
|
|
73
|
+
box=box,
|
|
74
|
+
pose=pose,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class YoloPoses(DataModel):
|
|
79
|
+
"""
|
|
80
|
+
A data model for a list of YOLO pose keypoints.
|
|
81
|
+
|
|
82
|
+
Attributes:
|
|
83
|
+
cls: The classes of the poses.
|
|
84
|
+
name: The names of the poses.
|
|
85
|
+
confidence: The confidence scores of the poses.
|
|
86
|
+
box: The bounding boxes of the poses.
|
|
87
|
+
pose: The 3D pose keypoints of the poses.
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
cls: list[int]
|
|
91
|
+
name: list[str]
|
|
92
|
+
confidence: list[float]
|
|
93
|
+
box: list[BBox]
|
|
94
|
+
pose: list[Pose3D]
|
|
95
|
+
|
|
96
|
+
@staticmethod
|
|
97
|
+
def from_results(results: list["Results"]) -> "YoloPoses":
|
|
98
|
+
cls, names, confidence, box, pose = [], [], [], [], []
|
|
99
|
+
for r in results:
|
|
100
|
+
for s in r.summary():
|
|
101
|
+
name = s.get("name", "")
|
|
102
|
+
cls.append(s["class"])
|
|
103
|
+
names.append(name)
|
|
104
|
+
confidence.append(s["confidence"])
|
|
105
|
+
box.append(BBox.from_dict(s.get("box", {}), title=name))
|
|
106
|
+
pose.append(Pose3D.from_dict(s.get("keypoints", {})))
|
|
107
|
+
return YoloPoses(
|
|
108
|
+
cls=cls,
|
|
109
|
+
name=names,
|
|
110
|
+
confidence=confidence,
|
|
111
|
+
box=box,
|
|
112
|
+
pose=pose,
|
|
113
|
+
)
|