Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eto-ai/rikai-pg
Postgres Rikai Extension
https://github.com/eto-ai/rikai-pg
deep-learning machine-learning postgresql pytorch rikai tensorflow
Last synced: about 2 months ago
JSON representation
Postgres Rikai Extension
- Host: GitHub
- URL: https://github.com/eto-ai/rikai-pg
- Owner: eto-ai
- License: apache-2.0
- Created: 2022-05-10T17:04:10.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-11T05:09:36.000Z (over 2 years ago)
- Last Synced: 2023-03-03T23:18:53.435Z (almost 2 years ago)
- Topics: deep-learning, machine-learning, postgresql, pytorch, rikai, tensorflow
- Language: Jupyter Notebook
- Homepage:
- Size: 56.6 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postgres Rikai Extension
Status: Proof of concept
```sh
pip install rikai
make install
```## Usage
To load `rikai` PostgreSQL extension
```sql
CREATE EXTENSION plpython3u;
CREATE EXTENSION rikai;
```Create a model via `INSERT INTO`
```sql
INSERT INTO ml.models
(name, flavor, model_type, uri)
VALUES
('cat_detector', 'pytorch', 'ssd', 's3://bucket/to/cat.pth')
```A function `ml.` will be created after model insertation.
To use the registered model for inference:
```sql
SELECT ml.cat_detector(image) FROM cat_dataset
```Show all registered models:
```sql
SELECT * FROM ml.models;
```## Local development
```sh
# Build and run docker image, prepare testing data and load a model.
$ make run# Connect to postgres
$ psql -h localhost -U postgres
```## TODOs
- [ ] Support classification models
- [ ] Release and installation## Limitations
- `rikai` needs to be installed with the system python.
- Batch inference.
- Not ready for production yet.