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.

Files changed (274) hide show
  1. {datachain-0.6.10/src/datachain.egg-info → datachain-0.6.11}/PKG-INFO +1 -1
  2. datachain-0.6.11/src/datachain/lib/models/__init__.py +5 -0
  3. datachain-0.6.11/src/datachain/lib/models/bbox.py +45 -0
  4. datachain-0.6.11/src/datachain/lib/models/pose.py +37 -0
  5. datachain-0.6.11/src/datachain/lib/models/yolo.py +39 -0
  6. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/sqlite/types.py +8 -1
  7. {datachain-0.6.10 → datachain-0.6.11/src/datachain.egg-info}/PKG-INFO +1 -1
  8. {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/SOURCES.txt +2 -5
  9. datachain-0.6.11/tests/unit/lib/test_models.py +50 -0
  10. datachain-0.6.11/tests/unit/sql/sqlite/test_types.py +19 -0
  11. datachain-0.6.10/src/datachain/lib/models/__init__.py +0 -6
  12. datachain-0.6.10/src/datachain/lib/models/bbox.py +0 -116
  13. datachain-0.6.10/src/datachain/lib/models/pose.py +0 -108
  14. datachain-0.6.10/src/datachain/lib/models/segment.py +0 -53
  15. datachain-0.6.10/src/datachain/lib/models/ultralytics/__init__.py +0 -14
  16. datachain-0.6.10/src/datachain/lib/models/ultralytics/bbox.py +0 -189
  17. datachain-0.6.10/src/datachain/lib/models/ultralytics/pose.py +0 -126
  18. datachain-0.6.10/src/datachain/lib/models/ultralytics/segment.py +0 -121
  19. datachain-0.6.10/tests/unit/lib/test_models.py +0 -142
  20. {datachain-0.6.10 → datachain-0.6.11}/.cruft.json +0 -0
  21. {datachain-0.6.10 → datachain-0.6.11}/.gitattributes +0 -0
  22. {datachain-0.6.10 → datachain-0.6.11}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
  23. {datachain-0.6.10 → datachain-0.6.11}/.github/ISSUE_TEMPLATE/empty_issue.md +0 -0
  24. {datachain-0.6.10 → datachain-0.6.11}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
  25. {datachain-0.6.10 → datachain-0.6.11}/.github/codecov.yaml +0 -0
  26. {datachain-0.6.10 → datachain-0.6.11}/.github/dependabot.yml +0 -0
  27. {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/benchmarks.yml +0 -0
  28. {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/release.yml +0 -0
  29. {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/tests-studio.yml +0 -0
  30. {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/tests.yml +0 -0
  31. {datachain-0.6.10 → datachain-0.6.11}/.github/workflows/update-template.yaml +0 -0
  32. {datachain-0.6.10 → datachain-0.6.11}/.gitignore +0 -0
  33. {datachain-0.6.10 → datachain-0.6.11}/.pre-commit-config.yaml +0 -0
  34. {datachain-0.6.10 → datachain-0.6.11}/CODE_OF_CONDUCT.rst +0 -0
  35. {datachain-0.6.10 → datachain-0.6.11}/CONTRIBUTING.rst +0 -0
  36. {datachain-0.6.10 → datachain-0.6.11}/LICENSE +0 -0
  37. {datachain-0.6.10 → datachain-0.6.11}/README.rst +0 -0
  38. {datachain-0.6.10 → datachain-0.6.11}/docs/assets/captioned_cartoons.png +0 -0
  39. {datachain-0.6.10 → datachain-0.6.11}/docs/assets/datachain-white.svg +0 -0
  40. {datachain-0.6.10 → datachain-0.6.11}/docs/assets/datachain.svg +0 -0
  41. {datachain-0.6.10 → datachain-0.6.11}/docs/index.md +0 -0
  42. {datachain-0.6.10 → datachain-0.6.11}/docs/overrides/main.html +0 -0
  43. {datachain-0.6.10 → datachain-0.6.11}/docs/references/datachain.md +0 -0
  44. {datachain-0.6.10 → datachain-0.6.11}/docs/references/datatype.md +0 -0
  45. {datachain-0.6.10 → datachain-0.6.11}/docs/references/file.md +0 -0
  46. {datachain-0.6.10 → datachain-0.6.11}/docs/references/index.md +0 -0
  47. {datachain-0.6.10 → datachain-0.6.11}/docs/references/sql.md +0 -0
  48. {datachain-0.6.10 → datachain-0.6.11}/docs/references/torch.md +0 -0
  49. {datachain-0.6.10 → datachain-0.6.11}/docs/references/udf.md +0 -0
  50. {datachain-0.6.10 → datachain-0.6.11}/examples/computer_vision/iptc_exif_xmp_lib.py +0 -0
  51. {datachain-0.6.10 → datachain-0.6.11}/examples/computer_vision/llava2_image_desc_lib.py +0 -0
  52. {datachain-0.6.10 → datachain-0.6.11}/examples/computer_vision/openimage-detect.py +0 -0
  53. {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/common_sql_functions.py +0 -0
  54. {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/json-csv-reader.py +0 -0
  55. {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/torch-loader.py +0 -0
  56. {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/udfs/parallel.py +0 -0
  57. {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/udfs/simple.py +0 -0
  58. {datachain-0.6.10 → datachain-0.6.11}/examples/get_started/udfs/stateful.py +0 -0
  59. {datachain-0.6.10 → datachain-0.6.11}/examples/llm_and_nlp/claude-query.py +0 -0
  60. {datachain-0.6.10 → datachain-0.6.11}/examples/llm_and_nlp/hf-dataset-llm-eval.py +0 -0
  61. {datachain-0.6.10 → datachain-0.6.11}/examples/llm_and_nlp/unstructured-embeddings-gen.py +0 -0
  62. {datachain-0.6.10 → datachain-0.6.11}/examples/llm_and_nlp/unstructured-summary-map.py +0 -0
  63. {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/clip_inference.py +0 -0
  64. {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/hf_pipeline.py +0 -0
  65. {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/openai_image_desc_lib.py +0 -0
  66. {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/wds.py +0 -0
  67. {datachain-0.6.10 → datachain-0.6.11}/examples/multimodal/wds_filtered.py +0 -0
  68. {datachain-0.6.10 → datachain-0.6.11}/mkdocs.yml +0 -0
  69. {datachain-0.6.10 → datachain-0.6.11}/noxfile.py +0 -0
  70. {datachain-0.6.10 → datachain-0.6.11}/pyproject.toml +0 -0
  71. {datachain-0.6.10 → datachain-0.6.11}/setup.cfg +0 -0
  72. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/__init__.py +0 -0
  73. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/__main__.py +0 -0
  74. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/asyn.py +0 -0
  75. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/cache.py +0 -0
  76. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/catalog/__init__.py +0 -0
  77. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/catalog/catalog.py +0 -0
  78. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/catalog/datasource.py +0 -0
  79. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/catalog/loader.py +0 -0
  80. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/cli.py +0 -0
  81. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/cli_utils.py +0 -0
  82. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/__init__.py +0 -0
  83. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/azure.py +0 -0
  84. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/fileslice.py +0 -0
  85. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/fsspec.py +0 -0
  86. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/gcs.py +0 -0
  87. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/hf.py +0 -0
  88. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/local.py +0 -0
  89. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/client/s3.py +0 -0
  90. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/config.py +0 -0
  91. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/__init__.py +0 -0
  92. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/db_engine.py +0 -0
  93. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/id_generator.py +0 -0
  94. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/job.py +0 -0
  95. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/metastore.py +0 -0
  96. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/schema.py +0 -0
  97. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/serializer.py +0 -0
  98. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/sqlite.py +0 -0
  99. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/data_storage/warehouse.py +0 -0
  100. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/dataset.py +0 -0
  101. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/error.py +0 -0
  102. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/job.py +0 -0
  103. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/__init__.py +0 -0
  104. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/arrow.py +0 -0
  105. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/clip.py +0 -0
  106. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/__init__.py +0 -0
  107. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/flatten.py +0 -0
  108. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/python_to_sql.py +0 -0
  109. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/sql_to_python.py +0 -0
  110. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/unflatten.py +0 -0
  111. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/convert/values_to_tuples.py +0 -0
  112. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/data_model.py +0 -0
  113. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/dataset_info.py +0 -0
  114. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/dc.py +0 -0
  115. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/file.py +0 -0
  116. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/func/__init__.py +0 -0
  117. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/func/aggregate.py +0 -0
  118. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/func/func.py +0 -0
  119. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/hf.py +0 -0
  120. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/image.py +0 -0
  121. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/listing.py +0 -0
  122. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/listing_info.py +0 -0
  123. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/meta_formats.py +0 -0
  124. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/model_store.py +0 -0
  125. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/pytorch.py +0 -0
  126. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/settings.py +0 -0
  127. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/signal_schema.py +0 -0
  128. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/tar.py +0 -0
  129. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/text.py +0 -0
  130. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/udf.py +0 -0
  131. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/udf_signature.py +0 -0
  132. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/utils.py +0 -0
  133. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/vfile.py +0 -0
  134. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/webdataset.py +0 -0
  135. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/lib/webdataset_laion.py +0 -0
  136. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/listing.py +0 -0
  137. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/node.py +0 -0
  138. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/nodes_fetcher.py +0 -0
  139. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/nodes_thread_pool.py +0 -0
  140. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/progress.py +0 -0
  141. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/py.typed +0 -0
  142. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/__init__.py +0 -0
  143. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/batch.py +0 -0
  144. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/dataset.py +0 -0
  145. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/dispatch.py +0 -0
  146. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/metrics.py +0 -0
  147. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/params.py +0 -0
  148. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/queue.py +0 -0
  149. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/schema.py +0 -0
  150. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/query/session.py +0 -0
  151. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/remote/__init__.py +0 -0
  152. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/remote/studio.py +0 -0
  153. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/__init__.py +0 -0
  154. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/default/__init__.py +0 -0
  155. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/default/base.py +0 -0
  156. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/__init__.py +0 -0
  157. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/aggregate.py +0 -0
  158. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/array.py +0 -0
  159. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/conditional.py +0 -0
  160. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/path.py +0 -0
  161. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/random.py +0 -0
  162. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/functions/string.py +0 -0
  163. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/selectable.py +0 -0
  164. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/sqlite/__init__.py +0 -0
  165. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/sqlite/base.py +0 -0
  166. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/sqlite/vector.py +0 -0
  167. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/types.py +0 -0
  168. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/sql/utils.py +0 -0
  169. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/studio.py +0 -0
  170. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/telemetry.py +0 -0
  171. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/toolkit/__init__.py +0 -0
  172. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/toolkit/split.py +0 -0
  173. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/torch/__init__.py +0 -0
  174. {datachain-0.6.10 → datachain-0.6.11}/src/datachain/utils.py +0 -0
  175. {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/dependency_links.txt +0 -0
  176. {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/entry_points.txt +0 -0
  177. {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/requires.txt +0 -0
  178. {datachain-0.6.10 → datachain-0.6.11}/src/datachain.egg-info/top_level.txt +0 -0
  179. {datachain-0.6.10 → datachain-0.6.11}/tests/__init__.py +0 -0
  180. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/__init__.py +0 -0
  181. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/conftest.py +0 -0
  182. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/datasets/.dvc/.gitignore +0 -0
  183. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/datasets/.dvc/config +0 -0
  184. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/datasets/.gitignore +0 -0
  185. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/datasets/laion-tiny.npz.dvc +0 -0
  186. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/test_datachain.py +0 -0
  187. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/test_ls.py +0 -0
  188. {datachain-0.6.10 → datachain-0.6.11}/tests/benchmarks/test_version.py +0 -0
  189. {datachain-0.6.10 → datachain-0.6.11}/tests/conftest.py +0 -0
  190. {datachain-0.6.10 → datachain-0.6.11}/tests/data.py +0 -0
  191. {datachain-0.6.10 → datachain-0.6.11}/tests/examples/__init__.py +0 -0
  192. {datachain-0.6.10 → datachain-0.6.11}/tests/examples/test_examples.py +0 -0
  193. {datachain-0.6.10 → datachain-0.6.11}/tests/examples/test_wds_e2e.py +0 -0
  194. {datachain-0.6.10 → datachain-0.6.11}/tests/examples/wds_data.py +0 -0
  195. {datachain-0.6.10 → datachain-0.6.11}/tests/func/__init__.py +0 -0
  196. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_catalog.py +0 -0
  197. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_client.py +0 -0
  198. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_datachain.py +0 -0
  199. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_dataset_query.py +0 -0
  200. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_datasets.py +0 -0
  201. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_feature_pickling.py +0 -0
  202. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_listing.py +0 -0
  203. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_ls.py +0 -0
  204. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_meta_formats.py +0 -0
  205. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_metrics.py +0 -0
  206. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_pull.py +0 -0
  207. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_pytorch.py +0 -0
  208. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_query.py +0 -0
  209. {datachain-0.6.10 → datachain-0.6.11}/tests/func/test_toolkit.py +0 -0
  210. {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/feature_class.py +0 -0
  211. {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/feature_class_exception.py +0 -0
  212. {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/feature_class_parallel.py +0 -0
  213. {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/feature_class_parallel_data_model.py +0 -0
  214. {datachain-0.6.10 → datachain-0.6.11}/tests/scripts/name_len_slow.py +0 -0
  215. {datachain-0.6.10 → datachain-0.6.11}/tests/test_atomicity.py +0 -0
  216. {datachain-0.6.10 → datachain-0.6.11}/tests/test_cli_e2e.py +0 -0
  217. {datachain-0.6.10 → datachain-0.6.11}/tests/test_cli_studio.py +0 -0
  218. {datachain-0.6.10 → datachain-0.6.11}/tests/test_query_e2e.py +0 -0
  219. {datachain-0.6.10 → datachain-0.6.11}/tests/test_telemetry.py +0 -0
  220. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/__init__.py +0 -0
  221. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/__init__.py +0 -0
  222. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/conftest.py +0 -0
  223. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_arrow.py +0 -0
  224. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_clip.py +0 -0
  225. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_datachain.py +0 -0
  226. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_datachain_bootstrap.py +0 -0
  227. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_datachain_merge.py +0 -0
  228. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_feature.py +0 -0
  229. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_feature_utils.py +0 -0
  230. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_file.py +0 -0
  231. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_hf.py +0 -0
  232. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_image.py +0 -0
  233. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_listing_info.py +0 -0
  234. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_schema.py +0 -0
  235. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_signal_schema.py +0 -0
  236. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_sql_to_python.py +0 -0
  237. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_text.py +0 -0
  238. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_udf_signature.py +0 -0
  239. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_utils.py +0 -0
  240. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/lib/test_webdataset.py +0 -0
  241. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/__init__.py +0 -0
  242. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/sqlite/__init__.py +0 -0
  243. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/sqlite/test_utils.py +0 -0
  244. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_array.py +0 -0
  245. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_conditional.py +0 -0
  246. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_path.py +0 -0
  247. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_random.py +0 -0
  248. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_selectable.py +0 -0
  249. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/sql/test_string.py +0 -0
  250. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_asyn.py +0 -0
  251. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_cache.py +0 -0
  252. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_catalog.py +0 -0
  253. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_catalog_loader.py +0 -0
  254. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_cli_parsing.py +0 -0
  255. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_client.py +0 -0
  256. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_client_s3.py +0 -0
  257. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_config.py +0 -0
  258. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_data_storage.py +0 -0
  259. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_database_engine.py +0 -0
  260. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_dataset.py +0 -0
  261. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_dispatch.py +0 -0
  262. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_fileslice.py +0 -0
  263. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_id_generator.py +0 -0
  264. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_listing.py +0 -0
  265. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_metastore.py +0 -0
  266. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_module_exports.py +0 -0
  267. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_query.py +0 -0
  268. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_query_metrics.py +0 -0
  269. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_query_params.py +0 -0
  270. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_serializer.py +0 -0
  271. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_session.py +0 -0
  272. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_utils.py +0 -0
  273. {datachain-0.6.10 → datachain-0.6.11}/tests/unit/test_warehouse.py +0 -0
  274. {datachain-0.6.10 → datachain-0.6.11}/tests/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datachain
3
- Version: 0.6.10
3
+ Version: 0.6.11
4
4
  Summary: Wrangle unstructured AI data at scale
5
5
  Author-email: Dmitry Petrov <support@dvc.org>
6
6
  License: Apache-2.0
@@ -0,0 +1,5 @@
1
+ from . import yolo
2
+ from .bbox import BBox
3
+ from .pose import Pose, Pose3D
4
+
5
+ __all__ = ["BBox", "Pose", "Pose3D", "yolo"]
@@ -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
- return orjson.dumps(arr, option=orjson.OPT_SERIALIZE_NUMPY).decode("utf-8")
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):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: datachain
3
- Version: 0.6.10
3
+ Version: 0.6.11
4
4
  Summary: Wrangle unstructured AI data at scale
5
5
  Author-email: Dmitry Petrov <support@dvc.org>
6
6
  License: Apache-2.0
@@ -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/segment.py
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,6 +0,0 @@
1
- from . import ultralytics
2
- from .bbox import BBox, OBBox
3
- from .pose import Pose, Pose3D
4
- from .segment import Segments
5
-
6
- __all__ = ["BBox", "OBBox", "Pose", "Pose3D", "Segments", "ultralytics"]
@@ -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
- ]