pixeltable 0.2.17__tar.gz → 0.2.19__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 pixeltable might be problematic. Click here for more details.

Files changed (151) hide show
  1. pixeltable-0.2.19/LICENSE +201 -0
  2. {pixeltable-0.2.17 → pixeltable-0.2.19}/PKG-INFO +84 -24
  3. {pixeltable-0.2.17 → pixeltable-0.2.19}/README.md +80 -19
  4. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/__init__.py +1 -1
  5. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/__version__.py +2 -2
  6. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/catalog.py +8 -7
  7. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/column.py +11 -8
  8. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/insertable_table.py +1 -1
  9. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/path_dict.py +8 -6
  10. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/table.py +20 -14
  11. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/table_version.py +92 -55
  12. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/table_version_path.py +7 -9
  13. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/view.py +3 -2
  14. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/dataframe.py +2 -2
  15. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/env.py +205 -86
  16. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exceptions.py +5 -1
  17. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/aggregation_node.py +2 -1
  18. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/component_iteration_node.py +2 -2
  19. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/sql_node.py +11 -8
  20. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/__init__.py +2 -2
  21. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/arithmetic_expr.py +4 -4
  22. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/array_slice.py +2 -1
  23. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/column_property_ref.py +9 -7
  24. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/column_ref.py +2 -1
  25. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/comparison.py +10 -7
  26. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/compound_predicate.py +3 -2
  27. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/data_row.py +19 -4
  28. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/expr.py +51 -41
  29. pixeltable-0.2.19/pixeltable/exprs/expr_set.py +62 -0
  30. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/function_call.py +62 -40
  31. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/in_predicate.py +3 -2
  32. pixeltable-0.2.19/pixeltable/exprs/inline_expr.py +200 -0
  33. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/is_null.py +3 -2
  34. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/json_mapper.py +5 -4
  35. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/json_path.py +7 -1
  36. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/literal.py +34 -7
  37. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/method_ref.py +3 -3
  38. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/object_ref.py +6 -5
  39. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/row_builder.py +25 -17
  40. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/rowid_ref.py +2 -1
  41. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/similarity_expr.py +2 -1
  42. pixeltable-0.2.19/pixeltable/exprs/sql_element_cache.py +30 -0
  43. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/type_cast.py +3 -3
  44. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/variable.py +2 -1
  45. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/ext/functions/whisperx.py +6 -4
  46. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/ext/functions/yolox.py +11 -9
  47. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/aggregate_function.py +1 -0
  48. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/function.py +28 -4
  49. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/__init__.py +4 -2
  50. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/anthropic.py +15 -5
  51. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/fireworks.py +1 -1
  52. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/globals.py +6 -1
  53. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/huggingface.py +91 -14
  54. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/image.py +20 -5
  55. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/json.py +5 -5
  56. pixeltable-0.2.19/pixeltable/functions/mistralai.py +188 -0
  57. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/openai.py +6 -10
  58. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/string.py +3 -2
  59. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/timestamp.py +95 -7
  60. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/together.py +18 -11
  61. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/video.py +2 -2
  62. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/vision.py +69 -37
  63. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/whisper.py +4 -1
  64. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/globals.py +5 -1
  65. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/io/hf_datasets.py +17 -15
  66. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/io/pandas.py +0 -2
  67. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/io/parquet.py +15 -14
  68. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/iterators/document.py +16 -15
  69. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/__init__.py +1 -1
  70. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/convert_18.py +1 -1
  71. pixeltable-0.2.19/pixeltable/metadata/converters/convert_19.py +46 -0
  72. pixeltable-0.2.19/pixeltable/metadata/converters/convert_20.py +56 -0
  73. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/util.py +29 -4
  74. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/notes.py +2 -0
  75. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/schema.py +5 -4
  76. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/plan.py +100 -78
  77. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/store.py +5 -1
  78. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/tool/create_test_db_dump.py +18 -6
  79. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/type_system.py +15 -15
  80. pixeltable-0.2.19/pixeltable/utils/documents.py +72 -0
  81. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/formatter.py +2 -2
  82. {pixeltable-0.2.17 → pixeltable-0.2.19}/pyproject.toml +13 -13
  83. pixeltable-0.2.17/LICENSE +0 -18
  84. pixeltable-0.2.17/pixeltable/exprs/expr_set.py +0 -39
  85. pixeltable-0.2.17/pixeltable/exprs/inline_array.py +0 -116
  86. pixeltable-0.2.17/pixeltable/exprs/inline_dict.py +0 -103
  87. pixeltable-0.2.17/pixeltable/utils/documents.py +0 -69
  88. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/__init__.py +0 -0
  89. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/dir.py +0 -0
  90. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/globals.py +0 -0
  91. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/named_function.py +0 -0
  92. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/path.py +0 -0
  93. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/catalog/schema_object.py +0 -0
  94. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/__init__.py +0 -0
  95. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/cache_prefetch_node.py +0 -0
  96. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/data_row_batch.py +0 -0
  97. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/exec_context.py +0 -0
  98. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/exec_node.py +0 -0
  99. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/expr_eval_node.py +0 -0
  100. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/in_memory_data_node.py +0 -0
  101. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/media_validation_node.py +0 -0
  102. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exec/row_update_node.py +0 -0
  103. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/exprs/globals.py +0 -0
  104. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/ext/__init__.py +0 -0
  105. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/ext/functions/__init__.py +0 -0
  106. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/__init__.py +0 -0
  107. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/callable_function.py +0 -0
  108. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/expr_template_function.py +0 -0
  109. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/function_registry.py +0 -0
  110. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/globals.py +0 -0
  111. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/query_template_function.py +0 -0
  112. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/signature.py +0 -0
  113. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/func/udf.py +0 -0
  114. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/audio.py +0 -0
  115. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/functions/util.py +0 -0
  116. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/index/__init__.py +0 -0
  117. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/index/base.py +0 -0
  118. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/index/btree.py +0 -0
  119. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/index/embedding_index.py +0 -0
  120. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/io/__init__.py +0 -0
  121. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/io/external_store.py +0 -0
  122. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/io/globals.py +0 -0
  123. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/io/label_studio.py +0 -0
  124. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/iterators/__init__.py +0 -0
  125. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/iterators/base.py +0 -0
  126. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/iterators/string.py +0 -0
  127. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/iterators/video.py +0 -0
  128. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/convert_10.py +0 -0
  129. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/convert_12.py +0 -0
  130. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/convert_13.py +0 -0
  131. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/convert_14.py +0 -0
  132. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/convert_15.py +0 -0
  133. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/convert_16.py +0 -0
  134. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/metadata/converters/convert_17.py +0 -0
  135. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/tool/create_test_video.py +0 -0
  136. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/tool/doc_plugins/griffe.py +0 -0
  137. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/tool/doc_plugins/mkdocstrings.py +0 -0
  138. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/tool/doc_plugins/templates/material/udf.html.jinja +0 -0
  139. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/tool/embed_udf.py +0 -0
  140. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/__init__.py +0 -0
  141. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/arrow.py +0 -0
  142. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/coco.py +0 -0
  143. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/code.py +0 -0
  144. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/filecache.py +0 -0
  145. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/help.py +0 -0
  146. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/http_server.py +0 -0
  147. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/media_store.py +0 -0
  148. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/pytorch.py +0 -0
  149. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/s3.py +0 -0
  150. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/sql.py +0 -0
  151. {pixeltable-0.2.17 → pixeltable-0.2.19}/pixeltable/utils/transactional_directory.py +0 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pixeltable
3
- Version: 0.2.17
3
+ Version: 0.2.19
4
4
  Summary: Pixeltable: The Multimodal AI Data Plane
5
5
  Author: Pixeltable, Inc.
6
6
  Author-email: contact@pixeltable.com
@@ -16,9 +16,8 @@ Requires-Dist: cloudpickle (>=2.2.1,<3.0.0)
16
16
  Requires-Dist: ftfy (>=6.2.0,<7.0.0)
17
17
  Requires-Dist: jinja2 (>=3.1.3,<4.0.0)
18
18
  Requires-Dist: jmespath (>=1.0.1,<2.0.0)
19
- Requires-Dist: mistune (>=3.0.2,<4.0.0)
20
19
  Requires-Dist: more-itertools (>=10.2,<11.0)
21
- Requires-Dist: numpy (>=1.25)
20
+ Requires-Dist: numpy (>=1.25,<2.0)
22
21
  Requires-Dist: opencv-python-headless (>=4.7.0.68,<5.0.0.0)
23
22
  Requires-Dist: pandas (>=2.0,<3.0)
24
23
  Requires-Dist: pgvector (>=0.2.1,<0.3.0)
@@ -26,45 +25,41 @@ Requires-Dist: pillow (>=9.3.0)
26
25
  Requires-Dist: pixeltable-pgserver (==0.2.7)
27
26
  Requires-Dist: psutil (>=5.9.5,<6.0.0)
28
27
  Requires-Dist: psycopg[binary] (==3.1.18)
28
+ Requires-Dist: puremagic (>=1.20)
29
29
  Requires-Dist: pymupdf (>=1.24.1,<2.0.0)
30
30
  Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
31
31
  Requires-Dist: requests (>=2.31.0,<3.0.0)
32
- Requires-Dist: setuptools (==69.1.1)
33
- Requires-Dist: sqlalchemy[mypy] (>=2.0.23,<3.0.0)
32
+ Requires-Dist: sqlalchemy (>=2.0.23,<3.0.0)
34
33
  Requires-Dist: tenacity (>=8.2,<9.0)
35
34
  Requires-Dist: tqdm (>=4.64)
36
35
  Description-Content-Type: text/markdown
37
36
 
38
37
  <div align="center">
39
- <img src="https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/release/pixeltable-banner.png" alt="Pixeltable" width="45%" />
40
-
41
- # Unifying Data, Models, and Orchestration for AI Products
38
+ <img src="https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/source/data/pixeltable-logo-large.png" alt="Pixeltable" width="50%" />
39
+ <br></br>
42
40
 
43
41
  [![License](https://img.shields.io/badge/License-Apache%202.0-darkblue.svg)](https://opensource.org/licenses/Apache-2.0)
44
42
  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pixeltable?logo=python&logoColor=white)
45
- [![Platform Support](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-8A2BE2)]()
46
- [![pytest status](https://github.com/pixeltable/pixeltable/actions/workflows/pytest.yml/badge.svg)](https://github.com/pixeltable/pixeltable/actions)
43
+ ![Platform Support](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-8A2BE2)
44
+ <br>
45
+ [![tests status](https://github.com/pixeltable/pixeltable/actions/workflows/pytest.yml/badge.svg)](https://github.com/pixeltable/pixeltable/actions/workflows/pytest.yml)
46
+ [![tests status](https://github.com/pixeltable/pixeltable/actions/workflows/nightly.yml/badge.svg)](https://github.com/pixeltable/pixeltable/actions/workflows/nightly.yml)
47
47
  [![PyPI Package](https://img.shields.io/pypi/v/pixeltable?color=darkorange)](https://pypi.org/project/pixeltable/)
48
48
 
49
49
  [Installation](https://pixeltable.github.io/pixeltable/getting-started/) | [Documentation](https://pixeltable.readme.io/) | [API Reference](https://pixeltable.github.io/pixeltable/) | [Code Samples](https://pixeltable.readme.io/recipes) | [Examples](https://github.com/pixeltable/pixeltable/tree/release/docs/release/tutorials)
50
50
  </div>
51
51
 
52
- Pixeltable is a Python library that lets ML Engineers and Data Scientists focus on exploration, modeling, and app development without dealing with the customary data plumbing.
53
-
54
- ### What problems does Pixeltable solve?
55
-
56
- Today’s solutions for AI app development require extensive custom coding and infrastructure plumbing. Tracking lineage and versions between and across data transformations, models, and deployment is cumbersome.
52
+ Pixeltable is a Python library providing a declarative interface for multimodal data (text, images, audio, video). It features built-in versioning, lineage tracking, and incremental updates, enabling users to store, transform, index, and iterate on data for their ML workflows. Data transformations, model inference, and custom logic are embedded as computed columns.
57
53
 
58
54
  ## 💾 Installation
59
55
 
60
56
  ```python
61
57
  pip install pixeltable
62
58
  ```
63
- > [!IMPORTANT]
64
- > Pixeltable is persistent. Unlike in-memory Python libraries such as Pandas, Pixeltable is a database. When working locally or against an hosted version of Pixeltable, use [get_table](https://pixeltable.github.io/pixeltable/api/pixeltable/#pixeltable.get_table) at any time to retrieve an existing table.
59
+ **Pixeltable is persistent. Unlike in-memory Python libraries such as Pandas, Pixeltable is a database.**
65
60
 
66
61
  ## 💡 Getting Started
67
- Learn how to create tables, populate them with data, and enhance them with built-in or user-defined transformations and AI operations.
62
+ Learn how to create tables, populate them with data, and enhance them with built-in or user-defined transformations.
68
63
 
69
64
  | Topic | Notebook | Topic | Notebook |
70
65
  |:----------|:-----------------|:-------------------------|:---------------------------------:|
@@ -91,9 +86,32 @@ v.insert({'video': prefix + p} for p in paths)
91
86
  ```
92
87
  Learn how to [work with data in Pixeltable](https://pixeltable.readme.io/docs/working-with-external-files).
93
88
 
94
- ### Add an object detection model to your workflow
89
+ ### Object detection in images using DETR model
95
90
  ```python
96
- table['detections'] = huggingface.detr_for_object_detection(table.input_image, model_id='facebook/detr-resnet-50')
91
+ import pixeltable as pxt
92
+ from pixeltable.functions import huggingface
93
+
94
+ # Create a table to store data persistently
95
+ t = pxt.create_table('image', {'image': pxt.ImageType()})
96
+
97
+ # Insert some images
98
+ prefix = 'https://upload.wikimedia.org/wikipedia/commons'
99
+ paths = [
100
+ '/1/15/Cat_August_2010-4.jpg',
101
+ '/e/e1/Example_of_a_Dog.jpg',
102
+ '/thumb/b/bf/Bird_Diversity_2013.png/300px-Bird_Diversity_2013.png'
103
+ ]
104
+ t.insert({'image': prefix + p} for p in paths)
105
+
106
+ # Add a computed column for image classification
107
+ t['classification'] = huggingface.detr_for_object_detection(
108
+ (t.image), model_id='facebook/detr-resnet-50'
109
+ )
110
+
111
+ # Retrieve the rows where cats have been identified
112
+ t.select(animal = t.image,
113
+ classification = t.classification.label_text[0]) \
114
+ .where(t.classification.label_text[0]=='cat').head()
97
115
  ```
98
116
  Learn about computed columns and object detection: [Comparing object detection models](https://pixeltable.readme.io/docs/object-detection-in-videos).
99
117
 
@@ -109,9 +127,9 @@ def draw_boxes(img: PIL.Image.Image, boxes: list[list[float]]) -> PIL.Image.Imag
109
127
  ```
110
128
  Learn more about user-defined functions: [UDFs in Pixeltable](https://pixeltable.readme.io/docs/user-defined-functions-udfs).
111
129
 
112
- ### Automate data operations with views
130
+ ### Automate data operations with views, e.g., split documents into chunks
113
131
  ```python
114
- # In this example, the view is defined by iteration over the chunks of a DocumentSplitter.
132
+ # In this example, the view is defined by iteration over the chunks of a DocumentSplitter
115
133
  chunks_table = pxt.create_view(
116
134
  'rag_demo.chunks',
117
135
  documents_table,
@@ -124,7 +142,7 @@ Learn how to leverage views to build your [RAG workflow](https://pixeltable.read
124
142
 
125
143
  ### Evaluate model performance
126
144
  ```python
127
- # The computation of the mAP metric can simply become a query over the evaluation output, aggregated with the mean_ap() function.
145
+ # The computation of the mAP metric can become a query over the evaluation output
128
146
  frames_view.select(mean_ap(frames_view.eval_yolox_tiny), mean_ap(frames_view.eval_yolox_m)).show()
129
147
  ```
130
148
  Learn how to leverage Pixeltable for [Model analytics](https://pixeltable.readme.io/docs/object-detection-in-videos).
@@ -136,7 +154,7 @@ chat_table = pxt.create_table('together_demo.chat', {'input': pxt.StringType()})
136
154
  # The chat-completions API expects JSON-formatted input:
137
155
  messages = [{'role': 'user', 'content': chat_table.input}]
138
156
 
139
- # This example shows how additional parameters from the Together API can be used in Pixeltable to customize the model behavior.
157
+ # This example shows how additional parameters from the Together API can be used in Pixeltable
140
158
  chat_table['output'] = chat_completions(
141
159
  messages=messages,
142
160
  model='mistralai/Mixtral-8x7B-Instruct-v0.1',
@@ -160,12 +178,54 @@ chat_table.select(chat_table.input, chat_table.response).head()
160
178
  ```
161
179
  Learn how to interact with inference services such as [Together AI](https://pixeltable.readme.io/docs/together-ai) in Pixeltable.
162
180
 
181
+ ### Text and image similarity search on video frames with embedding indexes
182
+ ```python
183
+ import pixeltable as pxt
184
+ from pixeltable.functions.huggingface import clip_image, clip_text
185
+ from pixeltable.iterators import FrameIterator
186
+ import PIL.Image
187
+
188
+ video_table = pxt.create_table('videos', {'video': pxt.VideoType()})
189
+
190
+ video_table.insert([{'video': '/video.mp4'}])
191
+
192
+ frames_view = pxt.create_view(
193
+ 'frames', video_table, iterator=FrameIterator.create(video=video_table.video))
194
+
195
+ @pxt.expr_udf
196
+ def embed_image(img: PIL.Image.Image):
197
+ return clip_image(img, model_id='openai/clip-vit-base-patch32')
198
+
199
+ @pxt.expr_udf
200
+ def str_embed(s: str):
201
+ return clip_text(s, model_id='openai/clip-vit-base-patch32')
202
+
203
+ # Create an index on the 'frame' column that allows text and image search
204
+ frames_view.add_embedding_index('frame', string_embed=str_embed, image_embed=embed_image)
205
+
206
+ # Now we will retrieve images based on a sample image
207
+ sample_image = '/image.jpeg'
208
+ sim = frames_view.frame.similarity(sample_image)
209
+ frames_view.order_by(sim, asc=False).limit(5).select(frames_view.frame, sim=sim).collect()
210
+
211
+ # Now we will retrieve images based on a string
212
+ sample_text = 'red truck'
213
+ sim = frames_view.frame.similarity(sample_text)
214
+ frames_view.order_by(sim, asc=False).limit(5).select(frames_view.frame, sim=sim).collect()
215
+
216
+ ```
217
+ Learn how to work with [Embedding and Vector Indexes](https://docs.pixeltable.com/docs/embedding-vector-indexes).
218
+
163
219
  ## ❓ FAQ
164
220
 
165
221
  ### What is Pixeltable?
166
222
 
167
223
  Pixeltable unifies data storage, versioning, and indexing with orchestration and model versioning under a declarative table interface, with transformations, model inference, and custom logic represented as computed columns.
168
224
 
225
+ ### What problems does Pixeltable solve?
226
+
227
+ Today's solutions for AI app development require extensive custom coding and infrastructure plumbing. Tracking lineage and versions between and across data transformations, models, and deployments is cumbersome. Pixeltable lets ML Engineers and Data Scientists focus on exploration, modeling, and app development without dealing with the customary data plumbing.
228
+
169
229
  ### What does Pixeltable provide me with? Pixeltable provides:
170
230
 
171
231
  - Data storage and versioning
@@ -1,33 +1,29 @@
1
1
  <div align="center">
2
- <img src="https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/release/pixeltable-banner.png" alt="Pixeltable" width="45%" />
3
-
4
- # Unifying Data, Models, and Orchestration for AI Products
2
+ <img src="https://raw.githubusercontent.com/pixeltable/pixeltable/main/docs/source/data/pixeltable-logo-large.png" alt="Pixeltable" width="50%" />
3
+ <br></br>
5
4
 
6
5
  [![License](https://img.shields.io/badge/License-Apache%202.0-darkblue.svg)](https://opensource.org/licenses/Apache-2.0)
7
6
  ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pixeltable?logo=python&logoColor=white)
8
- [![Platform Support](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-8A2BE2)]()
9
- [![pytest status](https://github.com/pixeltable/pixeltable/actions/workflows/pytest.yml/badge.svg)](https://github.com/pixeltable/pixeltable/actions)
7
+ ![Platform Support](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-8A2BE2)
8
+ <br>
9
+ [![tests status](https://github.com/pixeltable/pixeltable/actions/workflows/pytest.yml/badge.svg)](https://github.com/pixeltable/pixeltable/actions/workflows/pytest.yml)
10
+ [![tests status](https://github.com/pixeltable/pixeltable/actions/workflows/nightly.yml/badge.svg)](https://github.com/pixeltable/pixeltable/actions/workflows/nightly.yml)
10
11
  [![PyPI Package](https://img.shields.io/pypi/v/pixeltable?color=darkorange)](https://pypi.org/project/pixeltable/)
11
12
 
12
13
  [Installation](https://pixeltable.github.io/pixeltable/getting-started/) | [Documentation](https://pixeltable.readme.io/) | [API Reference](https://pixeltable.github.io/pixeltable/) | [Code Samples](https://pixeltable.readme.io/recipes) | [Examples](https://github.com/pixeltable/pixeltable/tree/release/docs/release/tutorials)
13
14
  </div>
14
15
 
15
- Pixeltable is a Python library that lets ML Engineers and Data Scientists focus on exploration, modeling, and app development without dealing with the customary data plumbing.
16
-
17
- ### What problems does Pixeltable solve?
18
-
19
- Today’s solutions for AI app development require extensive custom coding and infrastructure plumbing. Tracking lineage and versions between and across data transformations, models, and deployment is cumbersome.
16
+ Pixeltable is a Python library providing a declarative interface for multimodal data (text, images, audio, video). It features built-in versioning, lineage tracking, and incremental updates, enabling users to store, transform, index, and iterate on data for their ML workflows. Data transformations, model inference, and custom logic are embedded as computed columns.
20
17
 
21
18
  ## 💾 Installation
22
19
 
23
20
  ```python
24
21
  pip install pixeltable
25
22
  ```
26
- > [!IMPORTANT]
27
- > Pixeltable is persistent. Unlike in-memory Python libraries such as Pandas, Pixeltable is a database. When working locally or against an hosted version of Pixeltable, use [get_table](https://pixeltable.github.io/pixeltable/api/pixeltable/#pixeltable.get_table) at any time to retrieve an existing table.
23
+ **Pixeltable is persistent. Unlike in-memory Python libraries such as Pandas, Pixeltable is a database.**
28
24
 
29
25
  ## 💡 Getting Started
30
- Learn how to create tables, populate them with data, and enhance them with built-in or user-defined transformations and AI operations.
26
+ Learn how to create tables, populate them with data, and enhance them with built-in or user-defined transformations.
31
27
 
32
28
  | Topic | Notebook | Topic | Notebook |
33
29
  |:----------|:-----------------|:-------------------------|:---------------------------------:|
@@ -54,9 +50,32 @@ v.insert({'video': prefix + p} for p in paths)
54
50
  ```
55
51
  Learn how to [work with data in Pixeltable](https://pixeltable.readme.io/docs/working-with-external-files).
56
52
 
57
- ### Add an object detection model to your workflow
53
+ ### Object detection in images using DETR model
58
54
  ```python
59
- table['detections'] = huggingface.detr_for_object_detection(table.input_image, model_id='facebook/detr-resnet-50')
55
+ import pixeltable as pxt
56
+ from pixeltable.functions import huggingface
57
+
58
+ # Create a table to store data persistently
59
+ t = pxt.create_table('image', {'image': pxt.ImageType()})
60
+
61
+ # Insert some images
62
+ prefix = 'https://upload.wikimedia.org/wikipedia/commons'
63
+ paths = [
64
+ '/1/15/Cat_August_2010-4.jpg',
65
+ '/e/e1/Example_of_a_Dog.jpg',
66
+ '/thumb/b/bf/Bird_Diversity_2013.png/300px-Bird_Diversity_2013.png'
67
+ ]
68
+ t.insert({'image': prefix + p} for p in paths)
69
+
70
+ # Add a computed column for image classification
71
+ t['classification'] = huggingface.detr_for_object_detection(
72
+ (t.image), model_id='facebook/detr-resnet-50'
73
+ )
74
+
75
+ # Retrieve the rows where cats have been identified
76
+ t.select(animal = t.image,
77
+ classification = t.classification.label_text[0]) \
78
+ .where(t.classification.label_text[0]=='cat').head()
60
79
  ```
61
80
  Learn about computed columns and object detection: [Comparing object detection models](https://pixeltable.readme.io/docs/object-detection-in-videos).
62
81
 
@@ -72,9 +91,9 @@ def draw_boxes(img: PIL.Image.Image, boxes: list[list[float]]) -> PIL.Image.Imag
72
91
  ```
73
92
  Learn more about user-defined functions: [UDFs in Pixeltable](https://pixeltable.readme.io/docs/user-defined-functions-udfs).
74
93
 
75
- ### Automate data operations with views
94
+ ### Automate data operations with views, e.g., split documents into chunks
76
95
  ```python
77
- # In this example, the view is defined by iteration over the chunks of a DocumentSplitter.
96
+ # In this example, the view is defined by iteration over the chunks of a DocumentSplitter
78
97
  chunks_table = pxt.create_view(
79
98
  'rag_demo.chunks',
80
99
  documents_table,
@@ -87,7 +106,7 @@ Learn how to leverage views to build your [RAG workflow](https://pixeltable.read
87
106
 
88
107
  ### Evaluate model performance
89
108
  ```python
90
- # The computation of the mAP metric can simply become a query over the evaluation output, aggregated with the mean_ap() function.
109
+ # The computation of the mAP metric can become a query over the evaluation output
91
110
  frames_view.select(mean_ap(frames_view.eval_yolox_tiny), mean_ap(frames_view.eval_yolox_m)).show()
92
111
  ```
93
112
  Learn how to leverage Pixeltable for [Model analytics](https://pixeltable.readme.io/docs/object-detection-in-videos).
@@ -99,7 +118,7 @@ chat_table = pxt.create_table('together_demo.chat', {'input': pxt.StringType()})
99
118
  # The chat-completions API expects JSON-formatted input:
100
119
  messages = [{'role': 'user', 'content': chat_table.input}]
101
120
 
102
- # This example shows how additional parameters from the Together API can be used in Pixeltable to customize the model behavior.
121
+ # This example shows how additional parameters from the Together API can be used in Pixeltable
103
122
  chat_table['output'] = chat_completions(
104
123
  messages=messages,
105
124
  model='mistralai/Mixtral-8x7B-Instruct-v0.1',
@@ -123,12 +142,54 @@ chat_table.select(chat_table.input, chat_table.response).head()
123
142
  ```
124
143
  Learn how to interact with inference services such as [Together AI](https://pixeltable.readme.io/docs/together-ai) in Pixeltable.
125
144
 
145
+ ### Text and image similarity search on video frames with embedding indexes
146
+ ```python
147
+ import pixeltable as pxt
148
+ from pixeltable.functions.huggingface import clip_image, clip_text
149
+ from pixeltable.iterators import FrameIterator
150
+ import PIL.Image
151
+
152
+ video_table = pxt.create_table('videos', {'video': pxt.VideoType()})
153
+
154
+ video_table.insert([{'video': '/video.mp4'}])
155
+
156
+ frames_view = pxt.create_view(
157
+ 'frames', video_table, iterator=FrameIterator.create(video=video_table.video))
158
+
159
+ @pxt.expr_udf
160
+ def embed_image(img: PIL.Image.Image):
161
+ return clip_image(img, model_id='openai/clip-vit-base-patch32')
162
+
163
+ @pxt.expr_udf
164
+ def str_embed(s: str):
165
+ return clip_text(s, model_id='openai/clip-vit-base-patch32')
166
+
167
+ # Create an index on the 'frame' column that allows text and image search
168
+ frames_view.add_embedding_index('frame', string_embed=str_embed, image_embed=embed_image)
169
+
170
+ # Now we will retrieve images based on a sample image
171
+ sample_image = '/image.jpeg'
172
+ sim = frames_view.frame.similarity(sample_image)
173
+ frames_view.order_by(sim, asc=False).limit(5).select(frames_view.frame, sim=sim).collect()
174
+
175
+ # Now we will retrieve images based on a string
176
+ sample_text = 'red truck'
177
+ sim = frames_view.frame.similarity(sample_text)
178
+ frames_view.order_by(sim, asc=False).limit(5).select(frames_view.frame, sim=sim).collect()
179
+
180
+ ```
181
+ Learn how to work with [Embedding and Vector Indexes](https://docs.pixeltable.com/docs/embedding-vector-indexes).
182
+
126
183
  ## ❓ FAQ
127
184
 
128
185
  ### What is Pixeltable?
129
186
 
130
187
  Pixeltable unifies data storage, versioning, and indexing with orchestration and model versioning under a declarative table interface, with transformations, model inference, and custom logic represented as computed columns.
131
188
 
189
+ ### What problems does Pixeltable solve?
190
+
191
+ Today's solutions for AI app development require extensive custom coding and infrastructure plumbing. Tracking lineage and versions between and across data transformations, models, and deployments is cumbersome. Pixeltable lets ML Engineers and Data Scientists focus on exploration, modeling, and app development without dealing with the customary data plumbing.
192
+
132
193
  ### What does Pixeltable provide me with? Pixeltable provides:
133
194
 
134
195
  - Data storage and versioning
@@ -4,7 +4,7 @@ from .exceptions import Error
4
4
  from .exprs import RELATIVE_PATH_ROOT
5
5
  from .func import Function, udf, Aggregator, uda, expr_udf
6
6
  from .globals import init, create_table, create_view, get_table, move, drop_table, list_tables, create_dir, drop_dir, \
7
- list_dirs, list_functions, configure_logging
7
+ list_dirs, list_functions, configure_logging, array
8
8
  from .type_system import (
9
9
  ColumnType,
10
10
  StringType,
@@ -1,3 +1,3 @@
1
1
  # These version placeholders will be replaced during build.
2
- __version__ = "0.2.17"
3
- __version_tuple__ = (0, 2, 17)
2
+ __version__ = "0.2.19"
3
+ __version_tuple__ = (0, 2, 19)
@@ -1,8 +1,9 @@
1
1
  from __future__ import annotations
2
- from typing import Optional, List, Any, Dict, Tuple
3
- from uuid import UUID
2
+
4
3
  import dataclasses
5
4
  import logging
5
+ from typing import Optional
6
+ from uuid import UUID
6
7
 
7
8
  import sqlalchemy as sql
8
9
  import sqlalchemy.orm as orm
@@ -10,8 +11,8 @@ import sqlalchemy.orm as orm
10
11
  from .table_version import TableVersion
11
12
  from .table_version_path import TableVersionPath
12
13
  from .table import Table
13
- from .named_function import NamedFunction
14
14
  from .path_dict import PathDict
15
+
15
16
  import pixeltable.env as env
16
17
  import pixeltable.metadata.schema as schema
17
18
 
@@ -39,10 +40,10 @@ class Catalog:
39
40
  # key: [id, version]
40
41
  # - mutable version of a table: version == None (even though TableVersion.version is set correctly)
41
42
  # - snapshot versions: records the version of the snapshot
42
- self.tbl_versions: Dict[Tuple[UUID, Optional[int]], TableVersion] = {}
43
+ self.tbl_versions: dict[tuple[UUID, Optional[int]], TableVersion] = {}
43
44
 
44
- self.tbls: Dict[UUID, Table] = {} # don't use a defaultdict here, it doesn't cooperate with the debugger
45
- self.tbl_dependents: Dict[UUID, List[Table]] = {}
45
+ self.tbls: dict[UUID, Table] = {} # don't use a defaultdict here, it doesn't cooperate with the debugger
46
+ self.tbl_dependents: dict[UUID, list[Table]] = {}
46
47
 
47
48
  self._init_store()
48
49
  self.paths = PathDict() # do this after _init_catalog()
@@ -133,7 +134,7 @@ class Catalog:
133
134
  base_path=base_path if not is_snapshot else None)
134
135
  view_path = TableVersionPath(tbl_version, base=base_path)
135
136
 
136
- tbl = View(
137
+ tbl: Table = View(
137
138
  tbl_record.id, tbl_record.dir_id, tbl_md.name, view_path, base_tbl_id,
138
139
  snapshot_only=snapshot_only)
139
140
  self.tbl_dependents[base_tbl_id].append(tbl)