Skip to content

Commit

Permalink
usecases updated
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurav274 committed Aug 25, 2023
1 parent 6159445 commit a633d3a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 40 deletions.
11 changes: 6 additions & 5 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@ parts:
- caption: Overview
chapters:
- file: source/overview/getting-started
- file: source/overview/faq
- file: source/overview/concepts
# - file: source/overview/faq

- caption: Use Cases
chapters:
- file: source/usecases/image-classification.rst
title: Image Classification
- file: source/usecases/similar-image-search.rst
title: Image Search [FAISS]
- file: source/usecases/qa-video.rst
title: Q&A from Videos [ChatGPT + HuggingFace]
- file: source/usecases/02-object-detection.ipynb
title: Object Detection
- file: source/usecases/03-emotion-analysis.ipynb
title: Emotion Analysis
- file: source/usecases/07-object-segmentation-huggingface.ipynb
title: Image Segmentation [HuggingFace]
- file: source/usecases/similar-image-search.rst
title: Image Search [FAISS]
- file: source/usecases/qa-video.rst
title: Q&A from Videos [ChatGPT + HuggingFace]


- caption: User Reference
chapters:
Expand Down
52 changes: 27 additions & 25 deletions docs/source/usecases/image-classification.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Implementing a Image Classification Pipeline using EvaDB on a Video
Image Classification Pipeline using EvaDB
====

Assume the database has loaded a video ``mnist_video``.
Expand Down Expand Up @@ -28,23 +28,25 @@ Create an image classification function from python source code.

After the function is registered to EvaDB system, it can be directly called and used in SQL query.

.. code-block:: python
query = cursor.table("mnist_video").select("MnistImageClassifier(data).label")
.. tab-set::
.. tab-item:: Python

.. note::
.. code-block:: python
SQL statement
query = cursor.table("mnist_video").select("MnistImageClassifier(data).label")
# Get results in a DataFrame.
query.df()
.. code-block:: sql
SELECT MnistImageClassifier(data).label FROM mnist_video
.. tab-item:: SQL

Get results in a ``DataFrame``.
.. code-block:: sql
.. code-block:: python
SELECT MnistImageClassifier(data).label FROM mnist_video;
query.df()
The result contains a projected ``label`` column, which indicates the digit of a particular frame.

Expand All @@ -69,26 +71,26 @@ The result contains a projected ``label`` column, which indicates the digit of a

Like normal SQL, you can also specify conditions to filter out some frames of the video.

.. code-block:: python
.. tab-set::

.. tab-item:: Python

query = cursor.table("mnist_video") \
.filter("id < 2") \
.select("MnistImageClassifier(data).label")
.. code-block:: python
.. note::
query = cursor.table("mnist_video") \
.filter("id < 2") \
.select("MnistImageClassifier(data).label")
# Return results in a DataFrame.
query.df()
SQL statement
.. tab-item:: SQL

.. code-block:: sql
.. code-block:: sql
SELECT MnistImageClassifier(data).label FROM mnist_video
WHERE id < 2
Return results in a ``DataFrame``.

.. code-block:: python
SELECT MnistImageClassifier(data).label FROM mnist_video
WHERE id < 2
query.df()
Now, the ``DataFrame`` only contains 2 rows after filtering.

Expand Down
9 changes: 3 additions & 6 deletions docs/source/usecases/qa-video.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Q&A Application on Videos
2. Register Functions
----

Whisper
****
Register speech-to-text **whisper** model from `HuggingFace`

.. code-block:: python
Expand All @@ -28,8 +27,7 @@ Whisper

EvaDB allows users to register any model in HuggingFace as a function.

ChatGPT
****
Register **OpenAI** LLM model

.. code-block:: python
Expand All @@ -49,8 +47,7 @@ ChatGPT
3. Summarize Video in Text
----

Create a table with text summary of the video.
Text summarization is generated by running audio-to-text ``Whisper`` model from ``HuggingFace``.
Create a table with text summary of the video. Text summarization is generated by running speech-to-text ``Whisper`` model from ``HuggingFace``.

.. code-block:: python
Expand Down
6 changes: 2 additions & 4 deletions docs/source/usecases/similar-image-search.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
Implementing a Similar Image Search Pipeline using EvaDB on Images
Image Similarity Search Pipeline using EvaDB on Images
====

In this use case, we want to search similar images based on an image provided by the user.
To implement this use case, we leverage EvaDB's capability of easily expressing feature extraction pipeline.
Additionaly, we also leverage EvaDB's capability of building a similarity search index and searching the index to
In this use case, we want to search similar images based on an image provided by the user. To implement this use case, we leverage EvaDB's capability of easily expressing feature extraction pipeline. Additionaly, we also leverage EvaDB's capability of building a similarity search index and searching the index to
locate similar images through ``FAISS`` library.

For this use case, we use a reddit image dataset that can be downloaded from `Here <https://www.dropbox.com/scl/fo/fcj6ojmii0gw92zg3jb2s/h\?dl\=1\&rlkey\=j3kj1ox4yn5fhonw06v0pn7r9>`_.
Expand Down

0 comments on commit a633d3a

Please sign in to comment.