pixeltable 0.3.5__py3-none-any.whl → 0.3.7__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 +5 -3
- pixeltable/__version__.py +2 -2
- pixeltable/catalog/__init__.py +1 -0
- pixeltable/catalog/catalog.py +335 -128
- pixeltable/catalog/column.py +21 -5
- pixeltable/catalog/dir.py +19 -6
- pixeltable/catalog/insertable_table.py +34 -37
- pixeltable/catalog/named_function.py +0 -4
- pixeltable/catalog/schema_object.py +28 -42
- pixeltable/catalog/table.py +195 -158
- pixeltable/catalog/table_version.py +187 -232
- pixeltable/catalog/table_version_handle.py +50 -0
- pixeltable/catalog/table_version_path.py +49 -33
- pixeltable/catalog/view.py +56 -96
- pixeltable/config.py +103 -0
- pixeltable/dataframe.py +90 -90
- pixeltable/env.py +98 -168
- pixeltable/exec/aggregation_node.py +5 -4
- pixeltable/exec/cache_prefetch_node.py +1 -1
- pixeltable/exec/component_iteration_node.py +13 -9
- pixeltable/exec/data_row_batch.py +3 -3
- pixeltable/exec/exec_context.py +0 -4
- pixeltable/exec/exec_node.py +3 -2
- pixeltable/exec/expr_eval/schedulers.py +2 -1
- pixeltable/exec/in_memory_data_node.py +9 -4
- pixeltable/exec/row_update_node.py +1 -2
- pixeltable/exec/sql_node.py +20 -16
- pixeltable/exprs/column_ref.py +9 -9
- pixeltable/exprs/comparison.py +1 -1
- pixeltable/exprs/data_row.py +4 -4
- pixeltable/exprs/expr.py +20 -5
- pixeltable/exprs/function_call.py +98 -58
- pixeltable/exprs/json_mapper.py +25 -8
- pixeltable/exprs/json_path.py +6 -5
- pixeltable/exprs/object_ref.py +16 -5
- pixeltable/exprs/row_builder.py +15 -15
- pixeltable/exprs/rowid_ref.py +21 -7
- pixeltable/func/__init__.py +1 -1
- pixeltable/func/function.py +38 -6
- pixeltable/func/query_template_function.py +3 -6
- pixeltable/func/tools.py +26 -26
- pixeltable/func/udf.py +1 -1
- pixeltable/functions/__init__.py +2 -0
- pixeltable/functions/anthropic.py +9 -3
- pixeltable/functions/fireworks.py +7 -4
- pixeltable/functions/globals.py +4 -5
- pixeltable/functions/huggingface.py +1 -5
- pixeltable/functions/image.py +17 -7
- pixeltable/functions/llama_cpp.py +1 -1
- pixeltable/functions/mistralai.py +1 -1
- pixeltable/functions/ollama.py +4 -4
- pixeltable/functions/openai.py +26 -23
- pixeltable/functions/string.py +23 -30
- pixeltable/functions/timestamp.py +11 -6
- pixeltable/functions/together.py +14 -12
- pixeltable/functions/util.py +1 -1
- pixeltable/functions/video.py +5 -4
- pixeltable/functions/vision.py +6 -9
- pixeltable/functions/whisper.py +3 -3
- pixeltable/globals.py +246 -260
- pixeltable/index/__init__.py +2 -0
- pixeltable/index/base.py +1 -1
- pixeltable/index/btree.py +3 -1
- pixeltable/index/embedding_index.py +11 -5
- pixeltable/io/external_store.py +11 -12
- pixeltable/io/label_studio.py +4 -3
- pixeltable/io/parquet.py +57 -56
- pixeltable/iterators/__init__.py +4 -2
- pixeltable/iterators/audio.py +11 -11
- pixeltable/iterators/document.py +10 -10
- pixeltable/iterators/string.py +1 -2
- pixeltable/iterators/video.py +14 -15
- pixeltable/metadata/__init__.py +9 -5
- pixeltable/metadata/converters/convert_10.py +0 -1
- pixeltable/metadata/converters/convert_15.py +0 -2
- pixeltable/metadata/converters/convert_23.py +0 -2
- pixeltable/metadata/converters/convert_24.py +3 -3
- pixeltable/metadata/converters/convert_25.py +1 -1
- pixeltable/metadata/converters/convert_27.py +0 -2
- pixeltable/metadata/converters/convert_28.py +0 -2
- pixeltable/metadata/converters/convert_29.py +7 -8
- pixeltable/metadata/converters/util.py +7 -7
- pixeltable/metadata/schema.py +27 -19
- pixeltable/plan.py +68 -40
- pixeltable/share/packager.py +12 -9
- pixeltable/store.py +37 -38
- pixeltable/type_system.py +41 -28
- pixeltable/utils/filecache.py +2 -1
- {pixeltable-0.3.5.dist-info → pixeltable-0.3.7.dist-info}/METADATA +1 -1
- pixeltable-0.3.7.dist-info/RECORD +174 -0
- pixeltable-0.3.5.dist-info/RECORD +0 -172
- {pixeltable-0.3.5.dist-info → pixeltable-0.3.7.dist-info}/LICENSE +0 -0
- {pixeltable-0.3.5.dist-info → pixeltable-0.3.7.dist-info}/WHEEL +0 -0
- {pixeltable-0.3.5.dist-info → pixeltable-0.3.7.dist-info}/entry_points.txt +0 -0
pixeltable/functions/vision.py
CHANGED
|
@@ -250,7 +250,6 @@ class mean_ap(pxt.Aggregator):
|
|
|
250
250
|
eps = np.finfo(np.float32).eps
|
|
251
251
|
result: dict[int, float] = {}
|
|
252
252
|
for class_idx, tpfp in self.class_tpfp.items():
|
|
253
|
-
a1 = [x['tp'] for x in tpfp]
|
|
254
253
|
tp = np.concatenate([x['tp'] for x in tpfp], axis=0)
|
|
255
254
|
fp = np.concatenate([x['fp'] for x in tpfp], axis=0)
|
|
256
255
|
num_gts = np.sum([x['num_gts'] for x in tpfp])
|
|
@@ -341,16 +340,14 @@ def draw_bounding_boxes(
|
|
|
341
340
|
elif len(labels) != num_boxes:
|
|
342
341
|
raise ValueError('Number of boxes and labels must match')
|
|
343
342
|
|
|
344
|
-
DEFAULT_COLOR = 'white'
|
|
345
343
|
if box_colors is not None:
|
|
346
344
|
if len(box_colors) != num_boxes:
|
|
347
345
|
raise ValueError('Number of boxes and box colors must match')
|
|
346
|
+
elif color is not None:
|
|
347
|
+
box_colors = [color] * num_boxes
|
|
348
348
|
else:
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
else:
|
|
352
|
-
label_colors = __create_label_colors(labels)
|
|
353
|
-
box_colors = [label_colors[label] for label in labels]
|
|
349
|
+
label_colors = __create_label_colors(labels)
|
|
350
|
+
box_colors = [label_colors[label] for label in labels]
|
|
354
351
|
|
|
355
352
|
from PIL import ImageColor, ImageDraw, ImageFont
|
|
356
353
|
|
|
@@ -369,13 +366,13 @@ def draw_bounding_boxes(
|
|
|
369
366
|
|
|
370
367
|
if fill:
|
|
371
368
|
rgb_color = ImageColor.getrgb(color)
|
|
372
|
-
fill_color = rgb_color
|
|
369
|
+
fill_color = (*rgb_color, 100) # semi-transparent
|
|
373
370
|
draw.rectangle(bbox, outline=color, width=width, fill=fill_color) # type: ignore[arg-type]
|
|
374
371
|
else:
|
|
375
372
|
draw.rectangle(bbox, outline=color, width=width) # type: ignore[arg-type]
|
|
376
373
|
|
|
377
374
|
# Now draw labels separately, so they are not obscured by the boxes
|
|
378
|
-
for
|
|
375
|
+
for bbox, label in zip(boxes, labels):
|
|
379
376
|
if label is not None:
|
|
380
377
|
label_str = str(label)
|
|
381
378
|
_, _, text_width, text_height = draw.textbbox((0, 0), label_str, font=txt_font)
|
pixeltable/functions/whisper.py
CHANGED
|
@@ -6,7 +6,7 @@ This UDF will cause Pixeltable to invoke the relevant model locally. In order to
|
|
|
6
6
|
first `pip install openai-whisper`.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from typing import TYPE_CHECKING, Optional
|
|
9
|
+
from typing import TYPE_CHECKING, Optional, Sequence
|
|
10
10
|
|
|
11
11
|
import pixeltable as pxt
|
|
12
12
|
from pixeltable.env import Env
|
|
@@ -20,7 +20,7 @@ def transcribe(
|
|
|
20
20
|
audio: pxt.Audio,
|
|
21
21
|
*,
|
|
22
22
|
model: str,
|
|
23
|
-
temperature: Optional[
|
|
23
|
+
temperature: Optional[Sequence[float]] = (0.0, 0.2, 0.4, 0.6, 0.8, 1.0),
|
|
24
24
|
compression_ratio_threshold: Optional[float] = 2.4,
|
|
25
25
|
logprob_threshold: Optional[float] = -1.0,
|
|
26
26
|
no_speech_threshold: Optional[float] = 0.6,
|
|
@@ -28,7 +28,7 @@ def transcribe(
|
|
|
28
28
|
initial_prompt: Optional[str] = None,
|
|
29
29
|
word_timestamps: bool = False,
|
|
30
30
|
prepend_punctuations: str = '"\'“¿([{-',
|
|
31
|
-
append_punctuations: str = '"\'.。,,!!??::”)]}、',
|
|
31
|
+
append_punctuations: str = '"\'.。,,!!??::”)]}、', # noqa: RUF001
|
|
32
32
|
decode_options: Optional[dict] = None,
|
|
33
33
|
) -> dict:
|
|
34
34
|
"""
|