-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added scenario4 example for custom image
- Loading branch information
Showing
3 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ out | |
.next | ||
.husky | ||
*.DS_Store | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"id": "initial_id", | ||
"metadata": { | ||
"collapsed": true, | ||
"ExecuteTime": { | ||
"end_time": "2024-06-11T05:53:26.738708Z", | ||
"start_time": "2024-06-11T05:53:26.735189Z" | ||
} | ||
}, | ||
"source": "# PDF Reader example", | ||
"outputs": [], | ||
"execution_count": 2 | ||
}, | ||
{ | ||
"metadata": { | ||
"ExecuteTime": { | ||
"end_time": "2024-06-11T05:53:27.408964Z", | ||
"start_time": "2024-06-11T05:53:27.405735Z" | ||
} | ||
}, | ||
"cell_type": "code", | ||
"source": "from pypdf import PdfReader", | ||
"id": "6f355b6063887594", | ||
"outputs": [], | ||
"execution_count": 3 | ||
}, | ||
{ | ||
"metadata": { | ||
"ExecuteTime": { | ||
"end_time": "2024-06-11T05:54:09.711012Z", | ||
"start_time": "2024-06-11T05:54:09.696180Z" | ||
} | ||
}, | ||
"cell_type": "code", | ||
"source": [ | ||
"reader = PdfReader(\"red_hat_openshift_ai_self-managed-2.9-introduction_to_red_hat_openshift_ai-en-us.pdf\")\n", | ||
"number_of_pages = len(reader.pages)\n", | ||
"page = reader.pages[0]\n", | ||
"text = page.extract_text()\n", | ||
"\n", | ||
"print(\"number_of_pages: \" + str(number_of_pages))\n", | ||
"\n", | ||
"print(\"text: \" + text)\n" | ||
], | ||
"id": "c97c30b17aa591bb", | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"number_of_pages: 11\n", | ||
"text: Red Hat OpenShift AI Self-Managed\n", | ||
" \n", | ||
"2.9\n", | ||
"Introduction to Red Hat OpenShift AI\n", | ||
"OpenShift AI is a platform for data scientists and developers of artificial intelligence\n", | ||
"and machine learning (AI/ML) applications\n", | ||
"Last Updated: 2024-05-03\n" | ||
] | ||
} | ||
], | ||
"execution_count": 6 | ||
}, | ||
{ | ||
"metadata": {}, | ||
"cell_type": "code", | ||
"outputs": [], | ||
"execution_count": null, | ||
"source": "", | ||
"id": "983e2bb380363b23" | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 2 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython2", | ||
"version": "2.7.6" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
Binary file added
BIN
+51.1 KB
...tion/red_hat_openshift_ai_self-managed-2.9-introduction_to_red_hat_openshift_ai-en-us.pdf
Binary file not shown.