pixeltable 0.2.12__py3-none-any.whl → 0.2.14__py3-none-any.whl
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.
- pixeltable/__init__.py +1 -1
- pixeltable/__version__.py +2 -2
- pixeltable/catalog/column.py +5 -0
- pixeltable/catalog/globals.py +8 -0
- pixeltable/catalog/insertable_table.py +2 -2
- pixeltable/catalog/table.py +27 -9
- pixeltable/catalog/table_version.py +41 -68
- pixeltable/catalog/view.py +3 -3
- pixeltable/dataframe.py +7 -6
- pixeltable/exec/__init__.py +2 -1
- pixeltable/exec/expr_eval_node.py +8 -1
- pixeltable/exec/row_update_node.py +61 -0
- pixeltable/exec/{sql_scan_node.py → sql_node.py} +120 -56
- pixeltable/exprs/__init__.py +1 -2
- pixeltable/exprs/comparison.py +5 -5
- pixeltable/exprs/compound_predicate.py +12 -12
- pixeltable/exprs/expr.py +67 -22
- pixeltable/exprs/function_call.py +60 -29
- pixeltable/exprs/globals.py +2 -0
- pixeltable/exprs/in_predicate.py +3 -3
- pixeltable/exprs/inline_array.py +18 -11
- pixeltable/exprs/is_null.py +5 -5
- pixeltable/exprs/method_ref.py +63 -0
- pixeltable/ext/__init__.py +9 -0
- pixeltable/ext/functions/__init__.py +8 -0
- pixeltable/ext/functions/whisperx.py +45 -5
- pixeltable/ext/functions/yolox.py +60 -14
- pixeltable/func/aggregate_function.py +10 -4
- pixeltable/func/callable_function.py +16 -4
- pixeltable/func/expr_template_function.py +1 -1
- pixeltable/func/function.py +12 -2
- pixeltable/func/function_registry.py +26 -9
- pixeltable/func/udf.py +32 -4
- pixeltable/functions/__init__.py +1 -1
- pixeltable/functions/fireworks.py +33 -0
- pixeltable/functions/globals.py +36 -1
- pixeltable/functions/huggingface.py +155 -7
- pixeltable/functions/image.py +242 -40
- pixeltable/functions/openai.py +214 -0
- pixeltable/functions/string.py +600 -8
- pixeltable/functions/timestamp.py +210 -0
- pixeltable/functions/together.py +106 -0
- pixeltable/functions/video.py +28 -10
- pixeltable/functions/whisper.py +32 -0
- pixeltable/globals.py +3 -3
- pixeltable/io/__init__.py +1 -1
- pixeltable/io/globals.py +186 -5
- pixeltable/io/label_studio.py +42 -2
- pixeltable/io/pandas.py +70 -34
- pixeltable/metadata/__init__.py +1 -1
- pixeltable/metadata/converters/convert_18.py +39 -0
- pixeltable/metadata/notes.py +10 -0
- pixeltable/plan.py +82 -7
- pixeltable/tool/create_test_db_dump.py +4 -5
- pixeltable/tool/doc_plugins/griffe.py +81 -0
- pixeltable/tool/doc_plugins/mkdocstrings.py +6 -0
- pixeltable/tool/doc_plugins/templates/material/udf.html.jinja +135 -0
- pixeltable/type_system.py +15 -14
- pixeltable/utils/s3.py +1 -1
- pixeltable-0.2.14.dist-info/METADATA +206 -0
- {pixeltable-0.2.12.dist-info → pixeltable-0.2.14.dist-info}/RECORD +64 -56
- pixeltable-0.2.14.dist-info/entry_points.txt +3 -0
- pixeltable/exprs/image_member_access.py +0 -96
- pixeltable/exprs/predicate.py +0 -44
- pixeltable-0.2.12.dist-info/METADATA +0 -137
- {pixeltable-0.2.12.dist-info → pixeltable-0.2.14.dist-info}/LICENSE +0 -0
- {pixeltable-0.2.12.dist-info → pixeltable-0.2.14.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pixeltable
|
|
3
|
+
Version: 0.2.14
|
|
4
|
+
Summary: Pixeltable: The Multimodal AI Data Plane
|
|
5
|
+
Author: Pixeltable, Inc.
|
|
6
|
+
Author-email: contact@pixeltable.com
|
|
7
|
+
Requires-Python: >=3.9,<4.0
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Requires-Dist: av (>=10.0.0)
|
|
14
|
+
Requires-Dist: beautifulsoup4 (>=4.0.0,<5.0.0)
|
|
15
|
+
Requires-Dist: cloudpickle (>=2.2.1,<3.0.0)
|
|
16
|
+
Requires-Dist: ftfy (>=6.2.0,<7.0.0)
|
|
17
|
+
Requires-Dist: jinja2 (>=3.1.3,<4.0.0)
|
|
18
|
+
Requires-Dist: jmespath (>=1.0.1,<2.0.0)
|
|
19
|
+
Requires-Dist: mistune (>=3.0.2,<4.0.0)
|
|
20
|
+
Requires-Dist: more-itertools (>=10.2,<11.0)
|
|
21
|
+
Requires-Dist: numpy (>=1.25)
|
|
22
|
+
Requires-Dist: opencv-python-headless (>=4.7.0.68,<5.0.0.0)
|
|
23
|
+
Requires-Dist: pandas (>=2.0,<3.0)
|
|
24
|
+
Requires-Dist: pgserver (==0.1.4)
|
|
25
|
+
Requires-Dist: pgvector (>=0.2.1,<0.3.0)
|
|
26
|
+
Requires-Dist: pillow (>=9.3.0)
|
|
27
|
+
Requires-Dist: psutil (>=5.9.5,<6.0.0)
|
|
28
|
+
Requires-Dist: psycopg2-binary (>=2.9.5,<3.0.0)
|
|
29
|
+
Requires-Dist: pymupdf (>=1.24.1,<2.0.0)
|
|
30
|
+
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
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)
|
|
34
|
+
Requires-Dist: tenacity (>=8.2,<9.0)
|
|
35
|
+
Requires-Dist: tqdm (>=4.64)
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
<div align="center">
|
|
39
|
+
<img src="https://raw.githubusercontent.com/pixeltable/pixeltable/master/docs/release/pixeltable-banner.png" alt="Pixeltable" width="45%" />
|
|
40
|
+
|
|
41
|
+
# Unifying Data, Models, and Orchestration for AI Products
|
|
42
|
+
|
|
43
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
44
|
+

|
|
45
|
+
[]()
|
|
46
|
+
[](https://github.com/pixeltable/pixeltable/actions)
|
|
47
|
+
[](https://pypi.org/project/pixeltable/)
|
|
48
|
+
|
|
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/master/docs/release/tutorials)
|
|
50
|
+
</div>
|
|
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.
|
|
57
|
+
|
|
58
|
+
## 💾 Installation
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
pip install pixeltable
|
|
62
|
+
```
|
|
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.
|
|
65
|
+
|
|
66
|
+
## 💡 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.
|
|
68
|
+
|
|
69
|
+
| Topic | Notebook | Topic | Notebook |
|
|
70
|
+
|:----------|:-----------------|:-------------------------|:---------------------------------:|
|
|
71
|
+
| 10-Minute Tour of Pixeltable | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/master/docs/release/tutorials/pixeltable-basics.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> | Tables and Data Operations | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/master/docs/release/fundamentals/tables-and-data-operations.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
72
|
+
| User-Defined Functions (UDFs) | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/master/docs/release/howto/udfs-in-pixeltable.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a> | Object Detection Models | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/master/docs/release/tutorials/object-detection-in-videos.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
73
|
+
| Experimenting with Chunking (RAG) | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/master/docs/release/tutorials/rag-operations.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> | Working with External Files | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/master/docs/release/howto/working-with-external-files.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
74
|
+
| Integrating with Label Studio | <a target="_blank" href="https://pixeltable.readme.io/docs/label-studio"> <img src="https://img.shields.io/badge/Docs-Label Studio-blue" alt="Visit our documentation"/></a> | Audio/Video Transcript Indexing | <a target="_blank" href="https://colab.research.google.com/github/pixeltable/pixeltable/blob/master/docs/release/tutorials/audio-transcriptions.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
|
|
75
|
+
|
|
76
|
+
## 🧱 Code Samples
|
|
77
|
+
|
|
78
|
+
### Import media data into Pixeltable (videos, images, audio...)
|
|
79
|
+
```python
|
|
80
|
+
import pixeltable as pxt
|
|
81
|
+
|
|
82
|
+
v = pxt.create_table('external_data.videos', {'video': pxt.VideoType()})
|
|
83
|
+
|
|
84
|
+
prefix = 's3://multimedia-commons/'
|
|
85
|
+
paths = [
|
|
86
|
+
'data/videos/mp4/ffe/ffb/ffeffbef41bbc269810b2a1a888de.mp4',
|
|
87
|
+
'data/videos/mp4/ffe/feb/ffefebb41485539f964760e6115fbc44.mp4',
|
|
88
|
+
'data/videos/mp4/ffe/f73/ffef7384d698b5f70d411c696247169.mp4'
|
|
89
|
+
]
|
|
90
|
+
v.insert({'video': prefix + p} for p in paths)
|
|
91
|
+
```
|
|
92
|
+
Learn how to [work with data in Pixeltable](https://pixeltable.readme.io/docs/working-with-external-files).
|
|
93
|
+
|
|
94
|
+
### Add an object detection model to your workflow
|
|
95
|
+
```python
|
|
96
|
+
table['detections'] = huggingface.detr_for_object_detection(table.input_image, model_id='facebook/detr-resnet-50')
|
|
97
|
+
```
|
|
98
|
+
Learn about computed columns and object detection: [Comparing object detection models](https://pixeltable.readme.io/docs/object-detection-in-videos).
|
|
99
|
+
|
|
100
|
+
### Extend Pixeltable's capabilities with user-defined functions
|
|
101
|
+
```python
|
|
102
|
+
@pxt.udf
|
|
103
|
+
def draw_boxes(img: PIL.Image.Image, boxes: list[list[float]]) -> PIL.Image.Image:
|
|
104
|
+
result = img.copy() # Create a copy of `img`
|
|
105
|
+
d = PIL.ImageDraw.Draw(result)
|
|
106
|
+
for box in boxes:
|
|
107
|
+
d.rectangle(box, width=3) # Draw bounding box rectangles on the copied image
|
|
108
|
+
return result
|
|
109
|
+
```
|
|
110
|
+
Learn more about user-defined functions: [UDFs in Pixeltable](https://pixeltable.readme.io/docs/user-defined-functions-udfs).
|
|
111
|
+
|
|
112
|
+
### Automate data operations with views
|
|
113
|
+
```python
|
|
114
|
+
# In this example, the view is defined by iteration over the chunks of a DocumentSplitter.
|
|
115
|
+
chunks_table = pxt.create_view(
|
|
116
|
+
'rag_demo.chunks',
|
|
117
|
+
documents_table,
|
|
118
|
+
iterator=DocumentSplitter.create(
|
|
119
|
+
document=documents_table.document,
|
|
120
|
+
separators='token_limit', limit=300)
|
|
121
|
+
)
|
|
122
|
+
```
|
|
123
|
+
Learn how to leverage views to build your [RAG workflow](https://pixeltable.readme.io/docs/document-indexing-and-rag).
|
|
124
|
+
|
|
125
|
+
### Evaluate model performance
|
|
126
|
+
```python
|
|
127
|
+
# The computation of the mAP metric can simply become a query over the evaluation output, aggregated with the mean_ap() function.
|
|
128
|
+
frames_view.select(mean_ap(frames_view.eval_yolox_tiny), mean_ap(frames_view.eval_yolox_m)).show()
|
|
129
|
+
```
|
|
130
|
+
Learn how to leverage Pixeltable for [Model analytics](https://pixeltable.readme.io/docs/object-detection-in-videos).
|
|
131
|
+
|
|
132
|
+
### Working with inference services
|
|
133
|
+
```python
|
|
134
|
+
chat_table = pxt.create_table('together_demo.chat', {'input': pxt.StringType()})
|
|
135
|
+
|
|
136
|
+
# The chat-completions API expects JSON-formatted input:
|
|
137
|
+
messages = [{'role': 'user', 'content': chat_table.input}]
|
|
138
|
+
|
|
139
|
+
# This example shows how additional parameters from the Together API can be used in Pixeltable to customize the model behavior.
|
|
140
|
+
chat_table['output'] = chat_completions(
|
|
141
|
+
messages=messages,
|
|
142
|
+
model='mistralai/Mixtral-8x7B-Instruct-v0.1',
|
|
143
|
+
max_tokens=300,
|
|
144
|
+
stop=['\n'],
|
|
145
|
+
temperature=0.7,
|
|
146
|
+
top_p=0.9,
|
|
147
|
+
top_k=40,
|
|
148
|
+
repetition_penalty=1.1,
|
|
149
|
+
logprobs=1,
|
|
150
|
+
echo=True
|
|
151
|
+
)
|
|
152
|
+
chat_table['response'] = chat_table.output.choices[0].message.content
|
|
153
|
+
|
|
154
|
+
# Start a conversation
|
|
155
|
+
chat_table.insert([
|
|
156
|
+
{'input': 'How many species of felids have been classified?'},
|
|
157
|
+
{'input': 'Can you make me a coffee?'}
|
|
158
|
+
])
|
|
159
|
+
chat_table.select(chat_table.input, chat_table.response).head()
|
|
160
|
+
```
|
|
161
|
+
Learn how to interact with inference services such as [Together AI](https://pixeltable.readme.io/docs/together-ai) in Pixeltable.
|
|
162
|
+
|
|
163
|
+
## ❓ FAQ
|
|
164
|
+
|
|
165
|
+
### What is Pixeltable?
|
|
166
|
+
|
|
167
|
+
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
|
+
|
|
169
|
+
### What does Pixeltable provide me with? Pixeltable provides:
|
|
170
|
+
|
|
171
|
+
- Data storage and versioning
|
|
172
|
+
- Combined Data and Model Lineage
|
|
173
|
+
- Indexing (e.g. embedding vectors) and Data Retrieval
|
|
174
|
+
- Orchestration of multimodal workloads
|
|
175
|
+
- Incremental updates
|
|
176
|
+
- Code is automatically production-ready
|
|
177
|
+
|
|
178
|
+
### Why should you use Pixeltable?
|
|
179
|
+
|
|
180
|
+
- **It gives you transparency and reproducibility**
|
|
181
|
+
- All generated data is automatically recorded and versioned
|
|
182
|
+
- You will never need to re-run a workload because you lost track of the input data
|
|
183
|
+
- **It saves you money**
|
|
184
|
+
- All data changes are automatically incremental
|
|
185
|
+
- You never need to re-run pipelines from scratch because you’re adding data
|
|
186
|
+
- **It integrates with any existing Python code or libraries**
|
|
187
|
+
- Bring your ever-changing code and workloads
|
|
188
|
+
- You choose the models, tools, and AI practices (e.g., your embedding model for a vector index); Pixeltable orchestrates the data
|
|
189
|
+
|
|
190
|
+
### What is Pixeltable not providing?
|
|
191
|
+
|
|
192
|
+
- Pixeltable is not a low-code, prescriptive AI solution. We empower you to use the best frameworks and techniques for your specific needs.
|
|
193
|
+
- We do not aim to replace your existing AI toolkit, but rather enhance it by streamlining the underlying data infrastructure and orchestration.
|
|
194
|
+
|
|
195
|
+
> [!TIP]
|
|
196
|
+
> Check out the [Integrations](https://pixeltable.readme.io/docs/working-with-openai) section, and feel free to submit a request for additional ones.
|
|
197
|
+
|
|
198
|
+
## 🐛 Contributions & Feedback
|
|
199
|
+
|
|
200
|
+
Are you experiencing issues or bugs with Pixeltable? File an [Issue](https://github.com/pixeltable/pixeltable/issues).
|
|
201
|
+
</br>Do you want to contribute? Feel free to open a [PR](https://github.com/pixeltable/pixeltable/pulls).
|
|
202
|
+
|
|
203
|
+
## :classical_building: License
|
|
204
|
+
|
|
205
|
+
This library is licensed under the Apache 2.0 License.
|
|
206
|
+
|
|
@@ -1,103 +1,105 @@
|
|
|
1
|
-
pixeltable/__init__.py,sha256=
|
|
2
|
-
pixeltable/__version__.py,sha256=
|
|
1
|
+
pixeltable/__init__.py,sha256=ISVoeqNCvSJonD0EXJ32Mer84m29YQDyLhhUydyCV_o,1272
|
|
2
|
+
pixeltable/__version__.py,sha256=RQ6OoDf4FBJnM8s1hEJoZvxUBFqSNnCbCQV7vdybuQg,114
|
|
3
3
|
pixeltable/catalog/__init__.py,sha256=E41bxaPeQIcgRYzTWc2vkDOboQhRymrJf4IcHQO7o_8,453
|
|
4
4
|
pixeltable/catalog/catalog.py,sha256=8gsFWm6o9Qg4_BEO6oejdpmP4MAOlhmuKRaJP0o2UPU,7906
|
|
5
|
-
pixeltable/catalog/column.py,sha256=
|
|
5
|
+
pixeltable/catalog/column.py,sha256=Uw1SnG64YO-slDF8_m6by7hSq-5HGC0lAKLRqzZJkhU,9551
|
|
6
6
|
pixeltable/catalog/dir.py,sha256=DWl9nnCOoiYLKWp31MNMvLmryXeQiQZu5YJcd4tpy38,921
|
|
7
|
-
pixeltable/catalog/globals.py,sha256=
|
|
8
|
-
pixeltable/catalog/insertable_table.py,sha256=
|
|
7
|
+
pixeltable/catalog/globals.py,sha256=RFHl6XrgXzi_fon7O1RhnQ9SM_tkPexDhwrshMRpnmQ,1384
|
|
8
|
+
pixeltable/catalog/insertable_table.py,sha256=qYNuestCC-oR8bEoO1K7WMRWtCTB6RwF3X2LeK3kWG4,5878
|
|
9
9
|
pixeltable/catalog/named_function.py,sha256=UhHaimM_uJHS-0RQcqGOgvWeZtMfKsIgSeKSRwT2moU,1149
|
|
10
10
|
pixeltable/catalog/path.py,sha256=QgccEi_QOfaKt8YsR2zLtd_z7z7QQkU_1kprJFi2SPQ,1677
|
|
11
11
|
pixeltable/catalog/path_dict.py,sha256=xfvxg1Ze5jZCARUGASF2DRbQPh7pRVTYhuJ_u82gYUo,5941
|
|
12
12
|
pixeltable/catalog/schema_object.py,sha256=1GuxN68P3c7g0gmY8doB6qoUGJsalyECWaO-KEi96D0,1879
|
|
13
|
-
pixeltable/catalog/table.py,sha256=
|
|
14
|
-
pixeltable/catalog/table_version.py,sha256=
|
|
13
|
+
pixeltable/catalog/table.py,sha256=tV2BWr74NqlvSDEtD4zEpdFCnvq-9fanPnrH39AnL3w,42013
|
|
14
|
+
pixeltable/catalog/table_version.py,sha256=gZq7__PHf7-8QXTehv7tMJ4smrizBRBVixo6JK-FKkQ,55887
|
|
15
15
|
pixeltable/catalog/table_version_path.py,sha256=6JZlgKMYa3Xf8p_2Z-iDIFIcfuYRyjbpc3_CC9l1HME,6396
|
|
16
|
-
pixeltable/catalog/view.py,sha256=
|
|
17
|
-
pixeltable/dataframe.py,sha256=
|
|
16
|
+
pixeltable/catalog/view.py,sha256=ISRela9z5NcrUEvqe5H360xIXs3sY622cCQGe_2bxdY,10397
|
|
17
|
+
pixeltable/dataframe.py,sha256=T8Vi17wy8KT3squF_CsrCf8LYPEof7kH5dBKrVCW5n4,34497
|
|
18
18
|
pixeltable/env.py,sha256=WO_WLfRj9Fft6QyW89S9cw47RTg1ALviStu9pNygJEQ,21635
|
|
19
19
|
pixeltable/exceptions.py,sha256=MSP9zeL0AmXT93XqjdvgGN4rzno1_KRrGriq6hpemnw,376
|
|
20
|
-
pixeltable/exec/__init__.py,sha256=
|
|
20
|
+
pixeltable/exec/__init__.py,sha256=ZU88pHrIT4ob4OQE-2HlYcM4MP_dY4k67KdQGHnGC-M,507
|
|
21
21
|
pixeltable/exec/aggregation_node.py,sha256=cf6rVAgrGh_uaMrCIgXJIwQTmbcboJlnrH_MmPIQSd0,3321
|
|
22
22
|
pixeltable/exec/cache_prefetch_node.py,sha256=d5pEuR6AtJQkEVy9X3XeYFI_q0szMtoNAH96vYdtBE0,5241
|
|
23
23
|
pixeltable/exec/component_iteration_node.py,sha256=Uz6zEeaJMcbvF3S0W0qmLI_uWsZsaSspHKNzuAMrasg,4069
|
|
24
24
|
pixeltable/exec/data_row_batch.py,sha256=1IDYHBkSQ60dwOnAGnS-Wpp3AsnbMqKcY40zUT7ku-Q,3392
|
|
25
25
|
pixeltable/exec/exec_context.py,sha256=0rg5V8HzSy-BvqmSbGr-U4aJ4eOZg2JN0x6zjYQGtBc,1090
|
|
26
26
|
pixeltable/exec/exec_node.py,sha256=ixkv3p_EfF53UDWgwLjQGKR1LNIQxzgDXsTzzJj6ea4,2211
|
|
27
|
-
pixeltable/exec/expr_eval_node.py,sha256=
|
|
27
|
+
pixeltable/exec/expr_eval_node.py,sha256=eLyUwxA6HE9gHOE_oBT5nfVgd4oK2TQ6gaOM5RnCA8Q,11465
|
|
28
28
|
pixeltable/exec/in_memory_data_node.py,sha256=vvjr5-r94mRddOYIpKF8zDWCJPJrG0YpQVtYSyKlyVU,3502
|
|
29
29
|
pixeltable/exec/media_validation_node.py,sha256=OKfRyKpcn7AZdACy_HD4NsDC87ZfNFs1tdrQz2NiIVw,1514
|
|
30
|
-
pixeltable/exec/
|
|
31
|
-
pixeltable/
|
|
30
|
+
pixeltable/exec/row_update_node.py,sha256=b8yuKtkmI2Q6U-7svKbkjdM3Z85ddZoJgJgUa17j-YE,2773
|
|
31
|
+
pixeltable/exec/sql_node.py,sha256=N-KpAPiLn8TuF2t_07vms3R9_l6k0wqwSWkGIbikV4A,12921
|
|
32
|
+
pixeltable/exprs/__init__.py,sha256=zNlFbBiCI8PAzwBGR1tjyhbGpNXcPr07U2G66Fp7LS0,901
|
|
32
33
|
pixeltable/exprs/arithmetic_expr.py,sha256=sWBYCBKI6IHj9ASwDcm2BlkQ5gleVtKtmpiPvzFNBJM,4386
|
|
33
34
|
pixeltable/exprs/array_slice.py,sha256=VmWc6iFusrM85MjyEBBCfXG1Jnt8-Gr6-J88BXxNoOE,2131
|
|
34
35
|
pixeltable/exprs/column_property_ref.py,sha256=0PHiBys0fxe2LgjaMId5UHob4E-ZggyPLnnW41RgA0E,2706
|
|
35
36
|
pixeltable/exprs/column_ref.py,sha256=rlw6Ic_atAfPZpEBNAqbRZauMeEUci2rDyVoHd1pA1I,5195
|
|
36
|
-
pixeltable/exprs/comparison.py,sha256=
|
|
37
|
-
pixeltable/exprs/compound_predicate.py,sha256=
|
|
37
|
+
pixeltable/exprs/comparison.py,sha256=bWa_KZTir_5teKGEXf6cNzJWk55S9-XPPFdY8zoPn6U,4793
|
|
38
|
+
pixeltable/exprs/compound_predicate.py,sha256=y80Kc3LmifYP4Zqa8Etujb4jnItro2D6cS10WYQIGiI,3758
|
|
38
39
|
pixeltable/exprs/data_row.py,sha256=RTBw1cBt29g_9g_hgdEYZ5aiHl7WZMBaBC2fOMOfwOc,8668
|
|
39
|
-
pixeltable/exprs/expr.py,sha256
|
|
40
|
+
pixeltable/exprs/expr.py,sha256=-VKrOW_B-QqL-ZMcIDMJoU4p4vcwtaRn8Q2-JNBioro,27003
|
|
40
41
|
pixeltable/exprs/expr_set.py,sha256=Q64Q2yI0CTq2Ma_E-BUYlMotSstVuMm4OFZnBCedHRk,1222
|
|
41
|
-
pixeltable/exprs/function_call.py,sha256=
|
|
42
|
-
pixeltable/exprs/globals.py,sha256=
|
|
43
|
-
pixeltable/exprs/
|
|
44
|
-
pixeltable/exprs/
|
|
45
|
-
pixeltable/exprs/inline_array.py,sha256=293WuUEhYXrcp8-AnPDVIWQBPQMrPviB88A619Ls_Es,4499
|
|
42
|
+
pixeltable/exprs/function_call.py,sha256=l0_-EJ9bFlrDh56cZqqAdQAmCiVmn78y9bWcXJ2_1qE,18139
|
|
43
|
+
pixeltable/exprs/globals.py,sha256=SUZdoYEqUSAn8UeY1qJREOmL5OilUtMLvb6iOJQ8rUM,1910
|
|
44
|
+
pixeltable/exprs/in_predicate.py,sha256=ASxkSLeGdOjGN4QgWQA0zF1SkKOmHU_IV0spNpjvTGQ,3707
|
|
45
|
+
pixeltable/exprs/inline_array.py,sha256=AaRnN53-4krYkJ5vQ0i2hpnR-Vqp4N7xwHeTE_4M7lQ,4860
|
|
46
46
|
pixeltable/exprs/inline_dict.py,sha256=TWYokJ14Nq-evODcYFVO471WSEDbz6cJqIdRb2PkbZQ,3885
|
|
47
|
-
pixeltable/exprs/is_null.py,sha256=
|
|
47
|
+
pixeltable/exprs/is_null.py,sha256=K5EQCgpgLk-VfqO58b2T98qR9uui5ryhmskU2Ap8lWg,1016
|
|
48
48
|
pixeltable/exprs/json_mapper.py,sha256=I60VNgus64ai80gnFCIsRn0VRWYXMkqH5VNvnATsN9s,4559
|
|
49
49
|
pixeltable/exprs/json_path.py,sha256=Wz_5zFsyc9TPhsSbsDjDmQ3Nb0uVIwMCx5nh-cQYBiE,6526
|
|
50
50
|
pixeltable/exprs/literal.py,sha256=5NNza-WL1dd3hNznwwkr_yAcTGXSIRYUszGfy30lruI,2396
|
|
51
|
+
pixeltable/exprs/method_ref.py,sha256=GE2RaNlAEI_RHJBXeT7QhLG84V3P_k5DSzq5npNAgf0,2588
|
|
51
52
|
pixeltable/exprs/object_ref.py,sha256=eTcx84aWRI59fIiGvbdv3_cfL0XW4xEFQ4lwpLpJkM8,1250
|
|
52
|
-
pixeltable/exprs/predicate.py,sha256=OSDgjfSqiK7J_5GZMUXMvjfyomKEGi0JNxeB073SGXw,1859
|
|
53
53
|
pixeltable/exprs/row_builder.py,sha256=0OYd51J2ECPHkk2iN3MfYpS7LqnHTV5l5ubsVcy0dJA,15926
|
|
54
54
|
pixeltable/exprs/rowid_ref.py,sha256=74w4rEy21YysTVbyKNc3op-pYFqDAx8VJdtl7ZPpxHs,4268
|
|
55
55
|
pixeltable/exprs/similarity_expr.py,sha256=DqLOWtwPn9LxBRPm-d5Qz0yZ7w9YTOP8w0rgbr-6Lyg,3702
|
|
56
56
|
pixeltable/exprs/type_cast.py,sha256=JMg8p1qYoFfiAXfJPSbTEnfrK7lRO_JMaqlPHOrhNQU,1793
|
|
57
57
|
pixeltable/exprs/variable.py,sha256=Kg_O4ytcHYZFijIyMHYBJn063cTKU1-YE583FAz8Qaw,1361
|
|
58
|
-
pixeltable/ext/__init__.py,sha256=
|
|
59
|
-
pixeltable/ext/functions/
|
|
60
|
-
pixeltable/ext/functions/
|
|
58
|
+
pixeltable/ext/__init__.py,sha256=iO0J_Jfnv38F5y40sDAW54gpXjIyZgOGgoWQJAwjQec,423
|
|
59
|
+
pixeltable/ext/functions/__init__.py,sha256=hIjPEKC5E5uJOXlQqUyhP9yn9ZqWOCJAlj0kXWDlhlE,159
|
|
60
|
+
pixeltable/ext/functions/whisperx.py,sha256=wDi0XwAi1PeiB7NoA_4t9JwbwWjjbHBSgd5hH0HD0aM,2176
|
|
61
|
+
pixeltable/ext/functions/yolox.py,sha256=qxW-WosgFkpC8EWQUn7CPgW58z_Vc4idfbDIpZ6FpDA,5093
|
|
61
62
|
pixeltable/func/__init__.py,sha256=WjftUGyNkd6bF_qSxqZ5Gd7Elf8oExb3dUlpydhdFTo,407
|
|
62
|
-
pixeltable/func/aggregate_function.py,sha256=
|
|
63
|
-
pixeltable/func/callable_function.py,sha256=
|
|
64
|
-
pixeltable/func/expr_template_function.py,sha256=
|
|
65
|
-
pixeltable/func/function.py,sha256=
|
|
66
|
-
pixeltable/func/function_registry.py,sha256=
|
|
63
|
+
pixeltable/func/aggregate_function.py,sha256=pyF479nBrN2mZ8mAnsbmt2T8KxsDAVNgpUXiqHM2Nt8,9486
|
|
64
|
+
pixeltable/func/callable_function.py,sha256=vmAs9FIvyV7loUKc-2NAA9MUKVXS6hEZWQ9RHcdcqwQ,4913
|
|
65
|
+
pixeltable/func/expr_template_function.py,sha256=0krKY-0i-aTZdgAS8wZkq4NQc-EVtAA7-a0zh2vHmTI,4059
|
|
66
|
+
pixeltable/func/function.py,sha256=Q8q6qf3LUtBnGRQTxJLuDgQU3QHoyR2GsFyS1Tnn6RA,5955
|
|
67
|
+
pixeltable/func/function_registry.py,sha256=VvYJjS6OZaS15JdhTNM0aDU26b9NjFndc8E25YtTHLI,12406
|
|
67
68
|
pixeltable/func/globals.py,sha256=sEwn6lGgHMp6VQORb_P5qRd_-Q2_bUSqvqM9-XPN_ec,1483
|
|
68
69
|
pixeltable/func/query_template_function.py,sha256=BUU0KZYkqVPjIFg6g6msU4PzVGf2fkEKveDaEMGXhzI,3680
|
|
69
70
|
pixeltable/func/signature.py,sha256=6Lwf32auSnmhYGrN4NkHk07BmG2a73TNICbWnelkH1s,8638
|
|
70
|
-
pixeltable/func/udf.py,sha256=
|
|
71
|
-
pixeltable/functions/__init__.py,sha256=
|
|
71
|
+
pixeltable/func/udf.py,sha256=xrfCuYFF7Qqx-I_vE11WT9AoY6UbbzIIZ2DBGzYGzDE,7772
|
|
72
|
+
pixeltable/functions/__init__.py,sha256=QT6fbgIIrA_Q-lFIne9tq0phPz7vHBstzMq9NjERaZM,301
|
|
72
73
|
pixeltable/functions/eval.py,sha256=FMn95e0GG-ge7ss6dkDOV-7KQK9mSPvn-UyFB2rgBFI,8492
|
|
73
|
-
pixeltable/functions/fireworks.py,sha256=
|
|
74
|
-
pixeltable/functions/globals.py,sha256=
|
|
75
|
-
pixeltable/functions/huggingface.py,sha256=
|
|
76
|
-
pixeltable/functions/image.py,sha256=
|
|
77
|
-
pixeltable/functions/openai.py,sha256=
|
|
78
|
-
pixeltable/functions/string.py,sha256=
|
|
79
|
-
pixeltable/functions/
|
|
74
|
+
pixeltable/functions/fireworks.py,sha256=69EoYE8aS9s9SV6iTJGeUb7mNEHdodHh96JsOa2KL7Y,2575
|
|
75
|
+
pixeltable/functions/globals.py,sha256=9yz5XzhGhh4kuvHJ8eiFvy9SCPYaZrF5ltwscMH9xEg,2692
|
|
76
|
+
pixeltable/functions/huggingface.py,sha256=__SbMaYVLBd81gQXstNXPp6wxXPbNvrTgu8gi_RCnZI,12750
|
|
77
|
+
pixeltable/functions/image.py,sha256=mG1AKn1rwmY3eQdKgzuJRn0Vdxq84xHqla-P5dDe0dY,13306
|
|
78
|
+
pixeltable/functions/openai.py,sha256=4FyL60mQUPcqb19DkFMBbBHf6utV3xsOs6SPWZrfXp8,15981
|
|
79
|
+
pixeltable/functions/string.py,sha256=JEng3jwYZUSYSfjWjto7tLxlIvQLW1JvQ7OmncIgd5M,20085
|
|
80
|
+
pixeltable/functions/timestamp.py,sha256=pfP28wErdjWOMLgJaxqXPMMScf4_LGUFja7oYb_cNBg,6620
|
|
81
|
+
pixeltable/functions/together.py,sha256=Gvy7ontUQmTx1n-eFvGaDEfl48v95eClNy0FmoT3Ivw,8587
|
|
80
82
|
pixeltable/functions/util.py,sha256=F2iiIL7UfhYdCVzdCa3efYqWbaeLKFrbycKnuPkG57M,650
|
|
81
|
-
pixeltable/functions/video.py,sha256=
|
|
82
|
-
pixeltable/functions/whisper.py,sha256=
|
|
83
|
-
pixeltable/globals.py,sha256=
|
|
83
|
+
pixeltable/functions/video.py,sha256=qojNjimWK5jIO8fm_3WtQtAy8v-5qGDTl3Zx--St_fw,7077
|
|
84
|
+
pixeltable/functions/whisper.py,sha256=8oS2HjpewwAxt7RmLMXNqPl76_7Aq9c-qyAe-zJbu1U,3234
|
|
85
|
+
pixeltable/globals.py,sha256=RNlJDTf6w350YaCco5JXYxYY2j1rcSzgBNazmIHB48c,14823
|
|
84
86
|
pixeltable/index/__init__.py,sha256=XBwetNQQwnz0fiKwonOKhyy_U32l_cjt77kNvEIdjWs,102
|
|
85
87
|
pixeltable/index/base.py,sha256=YAQ5Dz1mfI0dfu9rxWHWroE8TjB90yKfPtXAzoADq38,1568
|
|
86
88
|
pixeltable/index/btree.py,sha256=NE4GYhcJWYJhdKyeHI0sQBlFvUaIgGOF9KLyCZOfFjE,1822
|
|
87
89
|
pixeltable/index/embedding_index.py,sha256=U1wAjcTYvw3uJf3QHIOzBV8FLOUn8IeaFsLzUb_QTmc,7829
|
|
88
|
-
pixeltable/io/__init__.py,sha256=
|
|
90
|
+
pixeltable/io/__init__.py,sha256=bJGWPhKfgoMrSKFdXhLGupjQQbIXt7JaoUPwilND2PE,519
|
|
89
91
|
pixeltable/io/external_store.py,sha256=owha7bEmA1ZvpZvBLBS6LHi9uLq1rUIkrMTGarsbjOU,16422
|
|
90
|
-
pixeltable/io/globals.py,sha256=
|
|
92
|
+
pixeltable/io/globals.py,sha256=F4L7Ft2tctH0PS7p3C3DuU_l6TmN-hhE9KUPk4AjlmQ,13267
|
|
91
93
|
pixeltable/io/hf_datasets.py,sha256=h5M1NkXOvEU8kaeT3AON1A18Vmhnc1lVo5a3TZ5AAic,8004
|
|
92
|
-
pixeltable/io/label_studio.py,sha256=
|
|
93
|
-
pixeltable/io/pandas.py,sha256=
|
|
94
|
+
pixeltable/io/label_studio.py,sha256=ipcgyFkKurP9IsBScLVK7UVddWJWXQ8M1p_3bh9Z60s,31018
|
|
95
|
+
pixeltable/io/pandas.py,sha256=XC3ZKTameWyD6h5bV0szhjOVgiBENbpWUyGweQ3GmEQ,8153
|
|
94
96
|
pixeltable/io/parquet.py,sha256=i4hvYHsARe2GnZHxNmI66Vf3tr1sIFLN6KGCJYvH3o8,8149
|
|
95
97
|
pixeltable/iterators/__init__.py,sha256=sjldFckkT8aVRiKgEP6faeAK2NQBdzbmpwAeRhI1FkM,366
|
|
96
98
|
pixeltable/iterators/base.py,sha256=cnEh1tNN2JAxRzrLTg3dhun3N1oNQ8vifCm6ts3_UiE,1687
|
|
97
99
|
pixeltable/iterators/document.py,sha256=netSCJatG8NcgbHZ69BvQVICdAorQlYi8OlcpqwLQD4,19436
|
|
98
100
|
pixeltable/iterators/string.py,sha256=NG_fWc_GAITDfzl6MvrDOMrSoMcZdMZf6hPQztCSatE,1305
|
|
99
101
|
pixeltable/iterators/video.py,sha256=xtxODL1AfZwTfHVzWekhTCLA8gwTJIvJFdxC0KecD9Q,3836
|
|
100
|
-
pixeltable/metadata/__init__.py,sha256=
|
|
102
|
+
pixeltable/metadata/__init__.py,sha256=niAW1Ac-lwaqbQ3svAwoiqbcWhfJEbgHjsj3s1ZyK2E,2172
|
|
101
103
|
pixeltable/metadata/converters/convert_10.py,sha256=J1_r7LNNAWTdb042AwqFpJ4sEB-i4qhUdk5iOjcZk34,719
|
|
102
104
|
pixeltable/metadata/converters/convert_12.py,sha256=Ci-qyZW1gqci-8wnjeOB5afdq7KTuN-hVSV9OqSPx8g,162
|
|
103
105
|
pixeltable/metadata/converters/convert_13.py,sha256=yFR6lD3pOrZ46ZQBFKYvxiIYa7rRxh46Bsq7yiCBNak,1356
|
|
@@ -105,14 +107,19 @@ pixeltable/metadata/converters/convert_14.py,sha256=o4Dwu5wujJYILN-2chg3xCSUsh4c
|
|
|
105
107
|
pixeltable/metadata/converters/convert_15.py,sha256=N-Lt3OdOrUprN-z1gFcxniZgAtZ7jzup_YUZzXX6EtY,1709
|
|
106
108
|
pixeltable/metadata/converters/convert_16.py,sha256=SvcWOYgLwRw_gLTnLbCSI9f2cpdkXazYOmmtJUOOzv4,476
|
|
107
109
|
pixeltable/metadata/converters/convert_17.py,sha256=vJg4y2lg53WSj9OSntWsdUiCr6yRgMQm0eFbs_Geqjg,861
|
|
110
|
+
pixeltable/metadata/converters/convert_18.py,sha256=tejUM88AVZmPsg4l2OWqEEPmpSzXpb6ZFxFTdYZ8-7E,1462
|
|
108
111
|
pixeltable/metadata/converters/util.py,sha256=AcYs3yUICl93y8whf0pkeWZoCzE4JuUMafmcYMyJUCY,2618
|
|
112
|
+
pixeltable/metadata/notes.py,sha256=NLZdM_iXONU0BeNwz5wK6I4UioMG71Sakfu9k15F6jc,467
|
|
109
113
|
pixeltable/metadata/schema.py,sha256=WJZ1YPgS88rFElXbjYgDhcrI4VReR1I9VPOnTkoHvoI,8418
|
|
110
|
-
pixeltable/plan.py,sha256=
|
|
114
|
+
pixeltable/plan.py,sha256=7CyRIkwXtAgwIjrco0p0Hrya0va0r6Q2LHmq-iIsK50,37010
|
|
111
115
|
pixeltable/store.py,sha256=UDn-UMYuL6dTUym3yFsVhv9hUtnP_QtzhDJzsFInApc,18853
|
|
112
|
-
pixeltable/tool/create_test_db_dump.py,sha256=
|
|
116
|
+
pixeltable/tool/create_test_db_dump.py,sha256=R5dY2OPvVtVhRWDxboIUjbzM6qjr2L1EcdiQDmegY4Q,10696
|
|
113
117
|
pixeltable/tool/create_test_video.py,sha256=OLfccymYReIpzE8osZn4rQvLXxxiPC_l0vc06U74hVM,2899
|
|
118
|
+
pixeltable/tool/doc_plugins/griffe.py,sha256=Q6ARBlQNBm8J21G_p625TB5c8MQ8r6hJlm7I2LoBon0,3422
|
|
119
|
+
pixeltable/tool/doc_plugins/mkdocstrings.py,sha256=afq7XOaSC5WRmugkh-FMFMK8PqOgIlDIsJdD8cuPhtE,207
|
|
120
|
+
pixeltable/tool/doc_plugins/templates/material/udf.html.jinja,sha256=R-7Q57nmDd5BUea-F1-MjwjK3pq7uBHXNoSo8_QjZG4,4890
|
|
114
121
|
pixeltable/tool/embed_udf.py,sha256=llHUhjGnCMp7Wyz7eHgKZV2v6o2ZWSgLQKscESuHK_o,269
|
|
115
|
-
pixeltable/type_system.py,sha256=
|
|
122
|
+
pixeltable/type_system.py,sha256=6qa0LBBKuS61sYBIfJGBKkrw3O_to8UQkDUDlegmb5s,29663
|
|
116
123
|
pixeltable/utils/__init__.py,sha256=UYlrf6TIWJT0g-Hac0b34-dEk478B5Qx8dGco34YlIk,439
|
|
117
124
|
pixeltable/utils/arrow.py,sha256=83_7aG5UR2qtTktw_otLkQs-RQbLk0VVM0JLJkbweNU,3692
|
|
118
125
|
pixeltable/utils/coco.py,sha256=ISpFBhR4eO1jOcg_SPb0thVI4KdS6H0RyNQauZIA5A4,7287
|
|
@@ -124,10 +131,11 @@ pixeltable/utils/help.py,sha256=cCnxJ4VP9MJ57iDqExmnDcM-JG3a1lw_q7g-D7bpSVI,252
|
|
|
124
131
|
pixeltable/utils/http_server.py,sha256=WQ5ILMzlz4TlwI9j5YqAPgEZyhrN1GytMNDbLD9occk,2422
|
|
125
132
|
pixeltable/utils/media_store.py,sha256=x71wnJDZDHcdd13VCfL4AkHQ6IJB41gNA-zBvXJwFos,3116
|
|
126
133
|
pixeltable/utils/pytorch.py,sha256=BR4tgfUWw-2rwWTOgzXj5qdMBpe1Arpp5SK4ax6jjpk,3483
|
|
127
|
-
pixeltable/utils/s3.py,sha256=
|
|
134
|
+
pixeltable/utils/s3.py,sha256=DBfXp0SYubhiKckdAD7PsiVBX_YfVP8Rcu6DCG_3SaQ,433
|
|
128
135
|
pixeltable/utils/sql.py,sha256=5n5_OmXAGtqFdL6z5XvgnU-vlx6Ba6f1WJrO1ZwUle8,765
|
|
129
136
|
pixeltable/utils/transactional_directory.py,sha256=UGzCrGtLR3hEEf8sYGuWBzLVFAEQml3vdIavigWeTBM,1349
|
|
130
|
-
pixeltable-0.2.
|
|
131
|
-
pixeltable-0.2.
|
|
132
|
-
pixeltable-0.2.
|
|
133
|
-
pixeltable-0.2.
|
|
137
|
+
pixeltable-0.2.14.dist-info/LICENSE,sha256=0UNMmwuqWPC0xDY1NWMm4uNJ2_MyA1pnTNRgQTvuBiQ,746
|
|
138
|
+
pixeltable-0.2.14.dist-info/METADATA,sha256=pAH2nPgSnxv-hT0TmO0WX3GaZqNVNQNlk8-gHRTbAak,11242
|
|
139
|
+
pixeltable-0.2.14.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
140
|
+
pixeltable-0.2.14.dist-info/entry_points.txt,sha256=TNI1Gb5vPwFrTdw6TimSYjO8FeK8c_HuPr28vcf7o_I,108
|
|
141
|
+
pixeltable-0.2.14.dist-info/RECORD,,
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
from typing import Optional, List, Any, Dict, Tuple
|
|
4
|
-
|
|
5
|
-
import PIL
|
|
6
|
-
import sqlalchemy as sql
|
|
7
|
-
|
|
8
|
-
import pixeltable.exceptions as excs
|
|
9
|
-
import pixeltable.func as func
|
|
10
|
-
import pixeltable.type_system as ts
|
|
11
|
-
from .data_row import DataRow
|
|
12
|
-
from .expr import Expr
|
|
13
|
-
from .function_call import FunctionCall
|
|
14
|
-
from .row_builder import RowBuilder
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# TODO: this doesn't dig up all attrs for actual jpeg images
|
|
18
|
-
def _create_pil_attr_info() -> Dict[str, ts.ColumnType]:
|
|
19
|
-
# create random Image to inspect for attrs
|
|
20
|
-
img = PIL.Image.new('RGB', (100, 100))
|
|
21
|
-
# we're only interested in public attrs (including properties)
|
|
22
|
-
result: Dict[str, ts.ColumnType] = {}
|
|
23
|
-
for name in [name for name in dir(img) if not callable(getattr(img, name)) and not name.startswith('_')]:
|
|
24
|
-
if getattr(img, name) is None:
|
|
25
|
-
continue
|
|
26
|
-
if isinstance(getattr(img, name), str):
|
|
27
|
-
result[name] = ts.StringType()
|
|
28
|
-
if isinstance(getattr(img, name), int):
|
|
29
|
-
result[name] = ts.IntType()
|
|
30
|
-
if getattr(img, name) is dict:
|
|
31
|
-
result[name] = ts.JsonType()
|
|
32
|
-
return result
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class ImageMemberAccess(Expr):
|
|
36
|
-
"""
|
|
37
|
-
Access of either an attribute or function member of PIL.Image.Image.
|
|
38
|
-
Ex.: tbl.img_col_ref.rotate(90), tbl.img_col_ref.width
|
|
39
|
-
TODO: remove this class and use FunctionCall instead (attributes to be replaced by functions)
|
|
40
|
-
"""
|
|
41
|
-
attr_info = _create_pil_attr_info()
|
|
42
|
-
|
|
43
|
-
def __init__(self, member_name: str, caller: Expr):
|
|
44
|
-
if member_name in self.attr_info:
|
|
45
|
-
super().__init__(self.attr_info[member_name])
|
|
46
|
-
else:
|
|
47
|
-
candidates = func.FunctionRegistry.get().get_type_methods(member_name, ts.ColumnType.Type.IMAGE)
|
|
48
|
-
if len(candidates) == 0:
|
|
49
|
-
raise excs.Error(f'Unknown Image member: {member_name}')
|
|
50
|
-
if len(candidates) > 1:
|
|
51
|
-
raise excs.Error(f'Ambiguous Image method: {member_name}')
|
|
52
|
-
self.img_method = candidates[0]
|
|
53
|
-
super().__init__(ts.InvalidType()) # requires FunctionCall to return value
|
|
54
|
-
self.member_name = member_name
|
|
55
|
-
self.components = [caller]
|
|
56
|
-
self.id = self._create_id()
|
|
57
|
-
|
|
58
|
-
def default_column_name(self) -> Optional[str]:
|
|
59
|
-
return self.member_name.replace('.', '_')
|
|
60
|
-
|
|
61
|
-
@property
|
|
62
|
-
def _caller(self) -> Expr:
|
|
63
|
-
return self.components[0]
|
|
64
|
-
|
|
65
|
-
def __str__(self) -> str:
|
|
66
|
-
return f'{self._caller}.{self.member_name}'
|
|
67
|
-
|
|
68
|
-
def _as_dict(self) -> Dict:
|
|
69
|
-
return {'member_name': self.member_name, **super()._as_dict()}
|
|
70
|
-
|
|
71
|
-
@classmethod
|
|
72
|
-
def _from_dict(cls, d: Dict, components: List[Expr]) -> Expr:
|
|
73
|
-
assert 'member_name' in d
|
|
74
|
-
assert len(components) == 1
|
|
75
|
-
return cls(d['member_name'], components[0])
|
|
76
|
-
|
|
77
|
-
def __call__(self, *args, **kwargs) -> FunctionCall:
|
|
78
|
-
result = self.img_method(*[self._caller, *args], **kwargs)
|
|
79
|
-
result.is_method_call = True
|
|
80
|
-
return result
|
|
81
|
-
|
|
82
|
-
def _equals(self, other: ImageMemberAccess) -> bool:
|
|
83
|
-
return self.member_name == other.member_name
|
|
84
|
-
|
|
85
|
-
def _id_attrs(self) -> List[Tuple[str, Any]]:
|
|
86
|
-
return super()._id_attrs() + [('member_name', self.member_name)]
|
|
87
|
-
|
|
88
|
-
def sql_expr(self) -> Optional[sql.ClauseElement]:
|
|
89
|
-
return None
|
|
90
|
-
|
|
91
|
-
def eval(self, data_row: DataRow, row_builder: RowBuilder) -> None:
|
|
92
|
-
caller_val = data_row[self._caller.slot_idx]
|
|
93
|
-
try:
|
|
94
|
-
data_row[self.slot_idx] = getattr(caller_val, self.member_name)
|
|
95
|
-
except AttributeError:
|
|
96
|
-
data_row[self.slot_idx] = None
|
pixeltable/exprs/predicate.py
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
from typing import Optional, List, Tuple, Callable
|
|
3
|
-
|
|
4
|
-
from .expr import Expr
|
|
5
|
-
from .globals import LogicalOperator
|
|
6
|
-
import pixeltable
|
|
7
|
-
import pixeltable.type_system as ts
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Predicate(Expr):
|
|
11
|
-
def __init__(self) -> None:
|
|
12
|
-
super().__init__(ts.BoolType())
|
|
13
|
-
|
|
14
|
-
def split_conjuncts(
|
|
15
|
-
self, condition: Callable[[Predicate], bool]) -> Tuple[List[Predicate], Optional[Predicate]]:
|
|
16
|
-
"""
|
|
17
|
-
Returns clauses of a conjunction that meet condition in the first element.
|
|
18
|
-
The second element contains remaining clauses, rolled into a conjunction.
|
|
19
|
-
"""
|
|
20
|
-
if condition(self):
|
|
21
|
-
return [self], None
|
|
22
|
-
else:
|
|
23
|
-
return [], self
|
|
24
|
-
|
|
25
|
-
def __and__(self, other: object) -> 'pixeltable.exprs.CompoundPredicate':
|
|
26
|
-
if not isinstance(other, Expr):
|
|
27
|
-
raise TypeError(f'Other needs to be an expression: {type(other)}')
|
|
28
|
-
if not other.col_type.is_bool_type():
|
|
29
|
-
raise TypeError(f'Other needs to be an expression that returns a boolean: {other.col_type}')
|
|
30
|
-
from .compound_predicate import CompoundPredicate
|
|
31
|
-
return CompoundPredicate(LogicalOperator.AND, [self, other])
|
|
32
|
-
|
|
33
|
-
def __or__(self, other: object) -> 'pixeltable.exprs.CompoundPredicate':
|
|
34
|
-
if not isinstance(other, Expr):
|
|
35
|
-
raise TypeError(f'Other needs to be an expression: {type(other)}')
|
|
36
|
-
if not other.col_type.is_bool_type():
|
|
37
|
-
raise TypeError(f'Other needs to be an expression that returns a boolean: {other.col_type}')
|
|
38
|
-
from .compound_predicate import CompoundPredicate
|
|
39
|
-
return CompoundPredicate(LogicalOperator.OR, [self, other])
|
|
40
|
-
|
|
41
|
-
def __invert__(self) -> 'pixeltable.exprs.CompoundPredicate':
|
|
42
|
-
from .compound_predicate import CompoundPredicate
|
|
43
|
-
return CompoundPredicate(LogicalOperator.NOT, [self])
|
|
44
|
-
|