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.

Files changed (94) hide show
  1. pixeltable/__init__.py +5 -3
  2. pixeltable/__version__.py +2 -2
  3. pixeltable/catalog/__init__.py +1 -0
  4. pixeltable/catalog/catalog.py +335 -128
  5. pixeltable/catalog/column.py +21 -5
  6. pixeltable/catalog/dir.py +19 -6
  7. pixeltable/catalog/insertable_table.py +34 -37
  8. pixeltable/catalog/named_function.py +0 -4
  9. pixeltable/catalog/schema_object.py +28 -42
  10. pixeltable/catalog/table.py +195 -158
  11. pixeltable/catalog/table_version.py +187 -232
  12. pixeltable/catalog/table_version_handle.py +50 -0
  13. pixeltable/catalog/table_version_path.py +49 -33
  14. pixeltable/catalog/view.py +56 -96
  15. pixeltable/config.py +103 -0
  16. pixeltable/dataframe.py +90 -90
  17. pixeltable/env.py +98 -168
  18. pixeltable/exec/aggregation_node.py +5 -4
  19. pixeltable/exec/cache_prefetch_node.py +1 -1
  20. pixeltable/exec/component_iteration_node.py +13 -9
  21. pixeltable/exec/data_row_batch.py +3 -3
  22. pixeltable/exec/exec_context.py +0 -4
  23. pixeltable/exec/exec_node.py +3 -2
  24. pixeltable/exec/expr_eval/schedulers.py +2 -1
  25. pixeltable/exec/in_memory_data_node.py +9 -4
  26. pixeltable/exec/row_update_node.py +1 -2
  27. pixeltable/exec/sql_node.py +20 -16
  28. pixeltable/exprs/column_ref.py +9 -9
  29. pixeltable/exprs/comparison.py +1 -1
  30. pixeltable/exprs/data_row.py +4 -4
  31. pixeltable/exprs/expr.py +20 -5
  32. pixeltable/exprs/function_call.py +98 -58
  33. pixeltable/exprs/json_mapper.py +25 -8
  34. pixeltable/exprs/json_path.py +6 -5
  35. pixeltable/exprs/object_ref.py +16 -5
  36. pixeltable/exprs/row_builder.py +15 -15
  37. pixeltable/exprs/rowid_ref.py +21 -7
  38. pixeltable/func/__init__.py +1 -1
  39. pixeltable/func/function.py +38 -6
  40. pixeltable/func/query_template_function.py +3 -6
  41. pixeltable/func/tools.py +26 -26
  42. pixeltable/func/udf.py +1 -1
  43. pixeltable/functions/__init__.py +2 -0
  44. pixeltable/functions/anthropic.py +9 -3
  45. pixeltable/functions/fireworks.py +7 -4
  46. pixeltable/functions/globals.py +4 -5
  47. pixeltable/functions/huggingface.py +1 -5
  48. pixeltable/functions/image.py +17 -7
  49. pixeltable/functions/llama_cpp.py +1 -1
  50. pixeltable/functions/mistralai.py +1 -1
  51. pixeltable/functions/ollama.py +4 -4
  52. pixeltable/functions/openai.py +26 -23
  53. pixeltable/functions/string.py +23 -30
  54. pixeltable/functions/timestamp.py +11 -6
  55. pixeltable/functions/together.py +14 -12
  56. pixeltable/functions/util.py +1 -1
  57. pixeltable/functions/video.py +5 -4
  58. pixeltable/functions/vision.py +6 -9
  59. pixeltable/functions/whisper.py +3 -3
  60. pixeltable/globals.py +246 -260
  61. pixeltable/index/__init__.py +2 -0
  62. pixeltable/index/base.py +1 -1
  63. pixeltable/index/btree.py +3 -1
  64. pixeltable/index/embedding_index.py +11 -5
  65. pixeltable/io/external_store.py +11 -12
  66. pixeltable/io/label_studio.py +4 -3
  67. pixeltable/io/parquet.py +57 -56
  68. pixeltable/iterators/__init__.py +4 -2
  69. pixeltable/iterators/audio.py +11 -11
  70. pixeltable/iterators/document.py +10 -10
  71. pixeltable/iterators/string.py +1 -2
  72. pixeltable/iterators/video.py +14 -15
  73. pixeltable/metadata/__init__.py +9 -5
  74. pixeltable/metadata/converters/convert_10.py +0 -1
  75. pixeltable/metadata/converters/convert_15.py +0 -2
  76. pixeltable/metadata/converters/convert_23.py +0 -2
  77. pixeltable/metadata/converters/convert_24.py +3 -3
  78. pixeltable/metadata/converters/convert_25.py +1 -1
  79. pixeltable/metadata/converters/convert_27.py +0 -2
  80. pixeltable/metadata/converters/convert_28.py +0 -2
  81. pixeltable/metadata/converters/convert_29.py +7 -8
  82. pixeltable/metadata/converters/util.py +7 -7
  83. pixeltable/metadata/schema.py +27 -19
  84. pixeltable/plan.py +68 -40
  85. pixeltable/share/packager.py +12 -9
  86. pixeltable/store.py +37 -38
  87. pixeltable/type_system.py +41 -28
  88. pixeltable/utils/filecache.py +2 -1
  89. {pixeltable-0.3.5.dist-info → pixeltable-0.3.7.dist-info}/METADATA +1 -1
  90. pixeltable-0.3.7.dist-info/RECORD +174 -0
  91. pixeltable-0.3.5.dist-info/RECORD +0 -172
  92. {pixeltable-0.3.5.dist-info → pixeltable-0.3.7.dist-info}/LICENSE +0 -0
  93. {pixeltable-0.3.5.dist-info → pixeltable-0.3.7.dist-info}/WHEEL +0 -0
  94. {pixeltable-0.3.5.dist-info → pixeltable-0.3.7.dist-info}/entry_points.txt +0 -0
@@ -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
- if color is not None:
350
- box_colors = [color] * num_boxes
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 + (100,) # semi-transparent
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 i, (bbox, label) in enumerate(zip(boxes, labels)):
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)
@@ -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[list[float]] = [0.0, 0.2, 0.4, 0.6, 0.8, 1.0],
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
  """