PierreBrunelle commited on
Commit
149ca92
·
verified ·
1 Parent(s): d1f8ddb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +1 -152
README.md CHANGED
@@ -33,114 +33,6 @@ pip install pixeltable
33
 
34
  ## 🧱 Code Samples
35
 
36
- ### Import media data into Pixeltable (videos, images, audio...)
37
- ```python
38
- import pixeltable as pxt
39
-
40
- v = pxt.create_table('external_data.videos', {'video': pxt.VideoType()})
41
-
42
- prefix = 's3://multimedia-commons/'
43
- paths = [
44
- 'data/videos/mp4/ffe/ffb/ffeffbef41bbc269810b2a1a888de.mp4',
45
- 'data/videos/mp4/ffe/feb/ffefebb41485539f964760e6115fbc44.mp4',
46
- 'data/videos/mp4/ffe/f73/ffef7384d698b5f70d411c696247169.mp4'
47
- ]
48
- v.insert({'video': prefix + p} for p in paths)
49
- ```
50
- Learn how to [work with data in Pixeltable](https://pixeltable.readme.io/docs/working-with-external-files).
51
-
52
- ### Object detection in images using DETR model
53
- ```python
54
- import pixeltable as pxt
55
- from pixeltable.functions import huggingface
56
-
57
- # Create a table to store data persistently
58
- t = pxt.create_table('image', {'image': pxt.ImageType()})
59
-
60
- # Insert some images
61
- prefix = 'https://upload.wikimedia.org/wikipedia/commons'
62
- paths = [
63
- '/1/15/Cat_August_2010-4.jpg',
64
- '/e/e1/Example_of_a_Dog.jpg',
65
- '/thumb/b/bf/Bird_Diversity_2013.png/300px-Bird_Diversity_2013.png'
66
- ]
67
- t.insert({'image': prefix + p} for p in paths)
68
-
69
- # Add a computed column for image classification
70
- t['classification'] = huggingface.detr_for_object_detection(
71
- (t.image), model_id='facebook/detr-resnet-50'
72
- )
73
-
74
- # Retrieve the rows where cats have been identified
75
- t.select(animal = t.image,
76
- classification = t.classification.label_text[0]) \
77
- .where(t.classification.label_text[0]=='cat').head()
78
- ```
79
- Learn about computed columns and object detection: [Comparing object detection models](https://pixeltable.readme.io/docs/object-detection-in-videos).
80
-
81
- ### Extend Pixeltable's capabilities with user-defined functions
82
- ```python
83
- @pxt.udf
84
- def draw_boxes(img: PIL.Image.Image, boxes: list[list[float]]) -> PIL.Image.Image:
85
- result = img.copy() # Create a copy of `img`
86
- d = PIL.ImageDraw.Draw(result)
87
- for box in boxes:
88
- d.rectangle(box, width=3) # Draw bounding box rectangles on the copied image
89
- return result
90
- ```
91
- Learn more about user-defined functions: [UDFs in Pixeltable](https://pixeltable.readme.io/docs/user-defined-functions-udfs).
92
-
93
- ### Automate data operations with views, e.g., split documents into chunks
94
- ```python
95
- # In this example, the view is defined by iteration over the chunks of a DocumentSplitter
96
- chunks_table = pxt.create_view(
97
- 'rag_demo.chunks',
98
- documents_table,
99
- iterator=DocumentSplitter.create(
100
- document=documents_table.document,
101
- separators='token_limit', limit=300)
102
- )
103
- ```
104
- Learn how to leverage views to build your [RAG workflow](https://pixeltable.readme.io/docs/document-indexing-and-rag).
105
-
106
- ### Evaluate model performance
107
- ```python
108
- # The computation of the mAP metric can become a query over the evaluation output
109
- frames_view.select(mean_ap(frames_view.eval_yolox_tiny), mean_ap(frames_view.eval_yolox_m)).show()
110
- ```
111
- Learn how to leverage Pixeltable for [Model analytics](https://pixeltable.readme.io/docs/object-detection-in-videos).
112
-
113
- ### Working with inference services
114
- ```python
115
- chat_table = pxt.create_table('together_demo.chat', {'input': pxt.StringType()})
116
-
117
- # The chat-completions API expects JSON-formatted input:
118
- messages = [{'role': 'user', 'content': chat_table.input}]
119
-
120
- # This example shows how additional parameters from the Together API can be used in Pixeltable
121
- chat_table['output'] = chat_completions(
122
- messages=messages,
123
- model='mistralai/Mixtral-8x7B-Instruct-v0.1',
124
- max_tokens=300,
125
- stop=['\n'],
126
- temperature=0.7,
127
- top_p=0.9,
128
- top_k=40,
129
- repetition_penalty=1.1,
130
- logprobs=1,
131
- echo=True
132
- )
133
- chat_table['response'] = chat_table.output.choices[0].message.content
134
-
135
- # Start a conversation
136
- chat_table.insert([
137
- {'input': 'How many species of felids have been classified?'},
138
- {'input': 'Can you make me a coffee?'}
139
- ])
140
- chat_table.select(chat_table.input, chat_table.response).head()
141
- ```
142
- Learn how to interact with inference services such as [Together AI](https://pixeltable.readme.io/docs/together-ai) in Pixeltable.
143
-
144
  ### Text and image similarity search on video frames with embedding indexes
145
  ```python
146
  import pixeltable as pxt
@@ -179,50 +71,7 @@ frames_view.order_by(sim, asc=False).limit(5).select(frames_view.frame, sim=sim)
179
  ```
180
  Learn how to work with [Embedding and Vector Indexes](https://docs.pixeltable.com/docs/embedding-vector-indexes).
181
 
182
- ## ❓ FAQ
183
-
184
- ### What is Pixeltable?
185
-
186
- 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.
187
-
188
- ### What problems does Pixeltable solve?
189
-
190
- 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.
191
-
192
- ### What does Pixeltable provide me with? Pixeltable provides:
193
-
194
- - Data storage and versioning
195
- - Combined Data and Model Lineage
196
- - Indexing (e.g. embedding vectors) and Data Retrieval
197
- - Orchestration of multimodal workloads
198
- - Incremental updates
199
- - Code is automatically production-ready
200
-
201
- ### Why should you use Pixeltable?
202
-
203
- - **It gives you transparency and reproducibility**
204
- - All generated data is automatically recorded and versioned
205
- - You will never need to re-run a workload because you lost track of the input data
206
- - **It saves you money**
207
- - All data changes are automatically incremental
208
- - You never need to re-run pipelines from scratch because you’re adding data
209
- - **It integrates with any existing Python code or libraries**
210
- - Bring your ever-changing code and workloads
211
- - You choose the models, tools, and AI practices (e.g., your embedding model for a vector index); Pixeltable orchestrates the data
212
-
213
- ### What is Pixeltable not providing?
214
-
215
- - Pixeltable is not a low-code, prescriptive AI solution. We empower you to use the best frameworks and techniques for your specific needs.
216
- - We do not aim to replace your existing AI toolkit, but rather enhance it by streamlining the underlying data infrastructure and orchestration.
217
-
218
- > [!TIP]
219
- > Check out the [Integrations](https://pixeltable.readme.io/docs/working-with-openai) section, and feel free to submit a request for additional ones.
220
-
221
  ## 🐛 Contributions & Feedback
222
 
223
  Are you experiencing issues or bugs with Pixeltable? File an [Issue](https://github.com/pixeltable/pixeltable/issues).
224
- </br>Do you want to contribute? Feel free to open a [PR](https://github.com/pixeltable/pixeltable/pulls).
225
-
226
- ## :classical_building: License
227
-
228
- This library is licensed under the Apache 2.0 License.
 
33
 
34
  ## 🧱 Code Samples
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  ### Text and image similarity search on video frames with embedding indexes
37
  ```python
38
  import pixeltable as pxt
 
71
  ```
72
  Learn how to work with [Embedding and Vector Indexes](https://docs.pixeltable.com/docs/embedding-vector-indexes).
73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  ## 🐛 Contributions & Feedback
75
 
76
  Are you experiencing issues or bugs with Pixeltable? File an [Issue](https://github.com/pixeltable/pixeltable/issues).
77
+ </br>Do you want to contribute? Feel free to open a [PR](https://github.com/pixeltable/pixeltable/pulls).