Skip to content

Commit c8f4782

Browse files
authored
fix: update docs and examples (#678)
* chore: add image-clustering example * chore: update documentation
1 parent a304230 commit c8f4782

16 files changed

Lines changed: 962 additions & 40 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# List of patterns, relative to source directory, that match files and
4646
# directories to ignore when looking for source files.
4747
# This pattern also affects html_static_path and html_extra_path.
48-
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "examples/*.ipynb"]
48+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4949

5050
# -- Options for HTML output -------------------------------------------------
5151

@@ -91,6 +91,7 @@
9191
"seaborn",
9292
"pandas",
9393
"tesseract",
94+
"pytesseract",
9495
"tqdm",
9596
# Additional ML/AI libraries
9697
"umap",
@@ -325,6 +326,9 @@
325326

326327
nb_execution_mode = "off"
327328
nb_execution_timeout = 300
329+
330+
# Suppress highlighting warnings for shell commands in notebooks
331+
suppress_warnings = ["misc.highlighting_failure"]
328332
# -- Options for intersphinx -------------------------------------------------
329333

330334
intersphinx_mapping = {

docs/examples/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
Here you can find a collection of jupyter notebooks which have use cases of using `feluda` and its `operators`.
44

5-
| Notebook | Description | Colab |
6-
|----------|-------------|-------|
7-
| [plot_tsne_videos](https://github.com/tattle-made/feluda/blob/main/examples/plot_tsne_videos.ipynb) | How to extract video embeddings using Feluda and its operators and visualize them in 2D space using t-SNE | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tattle-made/feluda/blob/main/examples/plot_tsne_videos.ipynb) |
8-
| [plot_cluster_videos](https://github.com/tattle-made/feluda/blob/main/examples/plot_cluster_videos.ipynb) | How to automatically cluster vidoes using Feluda and its operators | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tattle-made/feluda/blob/main/examples/plot_cluster_videos.ipynb) |
9-
| [classify_video_zero_shot](https://github.com/tattle-made/feluda/blob/main/examples/classify_video_zero_shot.ipynb) | How to zero-shot classify vidoes using Feluda and its operators | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tattle-made/feluda/blob/main/examples/classify_video_zero_shot.ipynb) |
5+
```{toctree}
6+
:maxdepth: 1
7+
8+
classify_video_zero_shot.ipynb
9+
compare_video_hashes.ipynb
10+
detect_lewd_images.ipynb
11+
find_text_in_newspaper.ipynb
12+
plot_cluster_images.ipynb
13+
plot_cluster_videos.ipynb
14+
plot_tsne_videos.ipynb
15+
```

docs/examples/classify_video_zero_shot.ipynb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,19 @@
1414
"- Visualizing the clusters with video thumbnails and the classified labels."
1515
]
1616
},
17+
{
18+
"cell_type": "markdown",
19+
"id": "f7562061",
20+
"metadata": {},
21+
"source": [
22+
"[![GitHub](https://img.shields.io/badge/GitHub-View%20Source-blue?logo=github)](https://github.com/tattle-made/feluda/blob/main/docs/examples/classify_video_zero_shot.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tattle-made/feluda/blob/main/docs/examples/classify_video_zero_shot.ipynb)"
23+
]
24+
},
1725
{
1826
"cell_type": "markdown",
1927
"id": "b63d79e1",
2028
"metadata": {},
2129
"source": [
22-
"### Install Required Packages\n",
2330
"Install dependencies conditionally based on whether the notebook is running in Colab or locally."
2431
]
2532
},
@@ -83,7 +90,7 @@
8390
"metadata": {},
8491
"source": [
8592
"\n",
86-
"### Dataset Structure Breakdown\n",
93+
"Dataset Structure Breakdown\n",
8794
"\n",
8895
"- **UCF101_subset/**: The root directory containing the dataset.\n",
8996
" - **train/**: Contains training samples.\n",
@@ -138,8 +145,7 @@
138145
"id": "35a99415-ca33-4395-8bf0-84b109bcd382",
139146
"metadata": {},
140147
"source": [
141-
"### Initializing Feluda operator\n",
142-
"We'll use one operator for this example."
148+
"Initializing Feluda operator for this example"
143149
]
144150
},
145151
{
@@ -277,7 +283,7 @@
277283
"id": "82ece75b",
278284
"metadata": {},
279285
"source": [
280-
"### Clustering videos\n",
286+
"Clustering videos \n",
281287
"\n",
282288
"This cell groups the videos by its predicted class"
283289
]
@@ -307,7 +313,7 @@
307313
"id": "4cf0fc79-8a4c-4088-aeda-9fe4f0d9059d",
308314
"metadata": {},
309315
"source": [
310-
"### Visualizing Clusters"
316+
"Visualizing Clusters"
311317
]
312318
},
313319
{

docs/examples/compare_video_hashes.ipynb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@
1212
"two sample videos and shows their hash values for similarity analysis."
1313
]
1414
},
15+
{
16+
"cell_type": "markdown",
17+
"id": "c32d1dd4",
18+
"metadata": {},
19+
"source": [
20+
"[![GitHub](https://img.shields.io/badge/GitHub-View%20Source-blue?logo=github)](https://github.com/tattle-made/feluda/blob/main/docs/examples/compare_video_hashes.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tattle-made/feluda/blob/main/docs/examples/compare_video_hashes.ipynb)"
21+
]
22+
},
1523
{
1624
"cell_type": "markdown",
1725
"id": "b63d79e1",
1826
"metadata": {},
1927
"source": [
20-
"### Install Required Packages\n",
2128
"Install dependencies conditionally based on whether the notebook is running in Colab or locally."
2229
]
2330
},
@@ -63,7 +70,6 @@
6370
"id": "35a99415-ca33-4395-8bf0-84b109bcd382",
6471
"metadata": {},
6572
"source": [
66-
"### Initializing Feluda operator\n",
6773
"We'll use one operator for this example."
6874
]
6975
},

docs/examples/detect_lewd_images.ipynb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@
1212
"probability score indicating likelihood of lewd content."
1313
]
1414
},
15+
{
16+
"cell_type": "markdown",
17+
"id": "38455989",
18+
"metadata": {},
19+
"source": [
20+
"[![GitHub](https://img.shields.io/badge/GitHub-View%20Source-blue?logo=github)](https://github.com/tattle-made/feluda/blob/main/docs/examples/detect_lewd_images.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tattle-made/feluda/blob/main/docs/examples/detect_lewd_images.ipynb)"
21+
]
22+
},
1523
{
1624
"cell_type": "markdown",
1725
"id": "b63d79e1",
1826
"metadata": {},
1927
"source": [
20-
"### Install Required Packages\n",
2128
"Install dependencies conditionally based on whether the notebook is running in Colab or locally."
2229
]
2330
},
@@ -63,7 +70,6 @@
6370
"id": "35a99415-ca33-4395-8bf0-84b109bcd382",
6471
"metadata": {},
6572
"source": [
66-
"### Initializing Feluda operator\n",
6773
"We'll use one operator for this example."
6874
]
6975
},

docs/examples/find_text_in_newspaper.ipynb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,19 @@
1212
"detected text with proper formatting and analysis."
1313
]
1414
},
15+
{
16+
"cell_type": "markdown",
17+
"id": "9d8c9f48",
18+
"metadata": {},
19+
"source": [
20+
"[![GitHub](https://img.shields.io/badge/GitHub-View%20Source-blue?logo=github)](https://github.com/tattle-made/feluda/blob/main/docs/examples/find_text_in_newspaper.ipynb) [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/tattle-made/feluda/blob/main/docs/examples/find_text_in_newspaper.ipynb)"
21+
]
22+
},
1523
{
1624
"cell_type": "markdown",
1725
"id": "1b60aae8",
1826
"metadata": {},
1927
"source": [
20-
"### Install Required Packages\n",
2128
"Install dependencies conditionally based on whether the notebook is running in Colab or locally."
2229
]
2330
},
@@ -63,8 +70,6 @@
6370
"id": "07d21783-b48c-4d4f-8a46-840b4ac0aaa6",
6471
"metadata": {},
6572
"source": [
66-
"### Initializing Feluda class with config file\n",
67-
"\n",
6873
"We'll use one operator for this example, for detecting text from newspaper clippings. Let's initialize the operator."
6974
]
7075
},
@@ -223,8 +228,7 @@
223228
"outputs": [],
224229
"source": [
225230
"def display_results(results: list[dict]) -> None:\n",
226-
" \"\"\"\n",
227-
" Display the results of text detection in a formatted manner.\n",
231+
" \"\"\"Display the results of text detection in a formatted manner.\n",
228232
" \"\"\"\n",
229233
" if not results:\n",
230234
" print(\"No images were successfully processed.\")\n",

0 commit comments

Comments
 (0)