Metadata-Version: 2.1
Name: pixeltable
Version: 0.1.2
Summary: Pixeltable: a dataframe-like interface to image and video data
Author: Marcel Kornacker
Author-email: marcelk@gmail.com
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: cloudpickle (>=2.2.1,<3.0.0)
Requires-Dist: ffmpeg-python (>=0.2.0,<0.3.0)
Requires-Dist: ftfy (>=6.1.1,<7.0.0)
Requires-Dist: hnswlib (>=0.6.2,<0.7.0)
Requires-Dist: jmespath (>=1.0.1,<2.0.0)
Requires-Dist: numpy (>=1.24.1,<2.0.0)
Requires-Dist: opencv-python-headless (>=4.7.0.68,<5.0.0.0)
Requires-Dist: pandas (>=1.5.3,<2.0.0)
Requires-Dist: pillow (>=9.4.0,<10.0.0)
Requires-Dist: psycopg2-binary (>=2.9.5,<3.0.0)
Requires-Dist: regex (>=2022.10.31,<2023.0.0)
Requires-Dist: sqlalchemy (>=1.4.41,<2.0.0)
Requires-Dist: sqlalchemy-utils (>=0.39.0,<0.40.0)
Requires-Dist: tqdm (>=4.64.1,<5.0.0)
Description-Content-Type: text/markdown

# Pixeltable

Pixeltable presents a dataframe-like interface to image and video data.

## Installation

1. Install Postgres

    On MacOS, [postgresapp.com](postgresapp.com) is a convenient way to do that.

2. `pip install pixeltable`

3. Install additional dependencies
   - Install PyTorch (required for CLIP): see [here](https://pytorch.org/get-started/locally/)
   - Install CLIP from [here](https://github.com/openai/CLIP)

## Setup

Pixeltable requires a home directory and a Postgres database, both are created automatically the first time you create a Pixeltable client (see below).
The location of the home directory is `~/.pixeltable` (or the value of the `PIXELTABLE_HOME` environment variable);
the name of the Postgres database is `pixeltable` (or the value of the `PIXELTABLE_DB` environment variable).

## Overview

Import convention:
```
import pixeltable as pt
```

### Create a client
```
cl = pt.Client()
```

### Create a database
```
Client.create_db('db1')
```

### Create a table with video data
```
c1 = Column('video', VideoType())
c2 = Column('frame_idx', IntType())
c3 = Column('frame', ImageType())
Db.create_table(
    'video_table', [c1, c2, c3],
    extract_frames_from='video',
    extracted_frame_col='frame',
    extracted_frame_idx_col='frame_idx',
    extracted_fps=1)
```

### Query table

|H1|H2|
|----|----|
| Look at 10 rows | `Table.show(10)` |
| Look at row for frame 15 | `t[t.frame_idx == 15].show()` |
| Look at all frames after index 15 | `t[t.frame_idx >= 15][t.frame].show(0)` |



