Git Product home page Git Product logo

eva's Introduction

EVA AI-Relational Database System

EVA is a database system for building simpler and faster AI-powered applications.

EVA is designed for supporting database applications that operate on both structured (tables, feature vectors) and unstructured data (videos, podcasts, PDFs, etc.) using deep learning models. It accelerates AI pipelines by 10-100x using a collection of optimizations inspired by time-tested relational database systems, including function caching, sampling, and cost-based predicate reordering. EVA supports an AI-oriented SQL-like query language tailored for analyzing unstructured data. It comes with a wide range of models for analyzing unstructured data, including models for image classification, object detection, OCR, text sentiment classification, face detection, etc. It is fully implemented in Python and licensed under the Apache license.

Quick Links

Features

  • ๐Ÿ”ฎ Build simpler AI-powered applications using short SQL-like queries
  • โšก๏ธ 10-100x faster AI pipelines using AI-centric query optimization
  • ๐Ÿ’ฐ Save money spent on GPU-driven inference
  • ๐Ÿš€ First-class support for your custom deep learning models through user-defined functions
  • ๐Ÿ“ฆ Built-in caching to eliminate redundant model invocations across queries
  • โŒจ๏ธ First-class support for PyTorch and HuggingFace models
  • ๐Ÿ Installable via pip and fully implemented in Python

Demo

Here are some illustrative EVA-backed applications (all of them are Jupyter notebooks that can be opened in Google Colab):

Documentation

  • Detailed Documentation
    • If you are wondering why you might need an AI-relational database system, start with the page on Video Database Systems.
    • The Getting Started page shows how you can use EVA for different AI pipelines, and how you can easily extend EVA by defining an user-defined function that wraps around your custom deep learning model.
    • The User Guides section contains Jupyter Notebooks that demonstrate how to use various features of EVA. Each notebook includes a link to Google Colab to run the code.
  • Tutorials
  • Join Slack
  • Demo

Quick Start

  • Install EVA using the pip package manager. EVA supports Python versions >= 3.7.
pip install evadb
cursor = connect_to_server()
  • Load a video onto the EVA server (we use ua_detrac.mp4 for illustration):
LOAD VIDEO "data/ua_detrac/ua_detrac.mp4" INTO TrafficVideo;
  • That's it! You can now run queries over the loaded video:
SELECT id, data FROM TrafficVideo WHERE id < 5;
  • Search for frames in the video that contain a car
SELECT id, data FROM TrafficVideo WHERE ['car'] <@ YoloV5(data).labels;
Source Video Query Result
Source Video Query Result
  • Search for frames in the video that contain a pedestrian and a car
SELECT id, data FROM TrafficVideo WHERE ['pedestrian', 'car'] <@ YoloV5(data).labels;
  • Search for frames with more than three cars
SELECT id, data FROM TrafficVideo WHERE ArrayCount(YoloV5(data).labels, 'car') > 3;
  • Use your custom deep learning model in queries with a user-defined function (UDF):
CREATE UDF IF NOT EXISTS MyUDF
INPUT  (frame NDARRAY UINT8(3, ANYDIM, ANYDIM))
OUTPUT (labels NDARRAY STR(ANYDIM), bboxes NDARRAY FLOAT32(ANYDIM, 4),
        scores NDARRAY FLOAT32(ANYDIM))
TYPE  Classification
IMPL  'eva/udfs/fastrcnn_object_detector.py';
  • Compose multiple models in a single query to set up useful AI pipelines.
   -- Analyse emotions of faces in a video
   SELECT id, bbox, EmotionDetector(Crop(data, bbox)) 
   FROM MovieVideo JOIN LATERAL UNNEST(FaceDetector(data)) AS Face(bbox, conf)  
   WHERE id < 15;
  • EVA runs queries faster using its AI-centric query optimizer. Two key optimizations are:

    ๐Ÿ’พ Caching: EVA automatically caches and reuses previous query results (especially model inference results), eliminating redundant computation and reducing query processing time.

    ๐ŸŽฏ Predicate Reordering: EVA optimizes the order in which the query predicates are evaluated (e.g., runs the faster, more selective model first), leading to faster queries and lower inference costs.

Consider these two exploratory queries on a dataset of ๐Ÿ• images:

  -- Query 1: Find all images of black-colored dogs
  SELECT id, bbox FROM dogs 
  JOIN LATERAL UNNEST(YoloV5(data)) AS Obj(label, bbox, score) 
  WHERE Obj.label = 'dog' 
    AND Color(Crop(data, bbox)) = 'black'; 

  -- Query 2: Find all Great Danes that are black-colored
  SELECT id, bbox FROM dogs 
  JOIN LATERAL UNNEST(YoloV5(data)) AS Obj(label, bbox, score) 
  WHERE Obj.label = 'dog' 
    AND DogBreedClassifier(Crop(data, bbox)) = 'great dane' 
    AND Color(Crop(data, bbox)) = 'black';

By reusing the results of the first query and reordering the predicates based on the available cached inference results, EVA runs the second query 10x faster!

Illustrative Applications

๐Ÿ”ฎ Traffic Analysis (Object Detection Model)

Source Video Query Result
Source Video Query Result

๐Ÿ”ฎ MNIST Digit Recognition (Image Classification Model)

Source Video Query Result
Source Video Query Result

๐Ÿ”ฎ Movie Emotion Analysis (Face Detection + Emotion Classfication Models)

Source Video Query Result
Source Video Query Result

๐Ÿ”ฎ License Plate Recognition (Plate Detection + OCR Extraction Models)

Query Result
Query Result

๐Ÿ”ฎ Meme Toxicity Classification (OCR Extraction + Toxicity Classification Models)

Query Result
Query Result

Community and Support

๐Ÿ‘‹ If you have general questions about EVA, want to say hello or just follow along, we'd like to invite you to join our Slack Community.

EVA Slack Channel

If you run into any problems or issues, please create a Github issue and we'll try our best to help.

Don't see a feature in the list? Search our issue tracker if someone has already requested it and add a comment to it explaining your use-case, or open a new issue if not. We prioritize our roadmap based on user feedback, so we'd love to hear from you.

Contributing

PyPI Version CI Status Documentation Status

EVA is the beneficiary of many contributors. All kinds of contributions to EVA are appreciated. To file a bug or to request a feature, please use GitHub issues. Pull requests are welcome.

For more information, see our contribution guide.

License

Copyright (c) 2018-present Georgia Tech Database Group. Licensed under Apache License.

eva's People

Contributors

gaurav274 avatar jarulraj avatar xzdandy avatar saiprashanth173 avatar jiashenc avatar sanjanag avatar jaehobang avatar abdullahshah avatar ishsiva avatar akhileshsiddhanti avatar pgluss avatar pchunduri6 avatar lorddarkula avatar aryan-rajoria avatar anirudh58 avatar kaushikravichandran avatar snd96 avatar suryatejreddy avatar karan-sarkar avatar swati21 avatar albert-hen avatar rodrigodlpontes avatar alekhyam94 avatar sanmathik avatar dependabot[bot] avatar kokareiitp avatar pramodith avatar tushar-97 avatar asrayousuf avatar jacksonfan1225 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.