圖片轉文字 ( OCR 圖片字元辨識 )

https://steam.oxxostudio.tw/category/python/example/image-ocr.html

from PIL import Image
import pytesseract

設定 Tesseract 的安裝路徑(如果需要)

pytesseract.pytesseract.tesseract_cmd = r’C:\Program Files\Tesseract-OCR\tesseract.exe’

讀取圖片

image_path = ‘img1.png’
image = Image.open(image_path)

使用繁體中文語言包進行 OCR 辨識

text = pytesseract.image_to_string(image, lang=’chi_tra’)

輸出辨識結果

print(text)

Open WebUI 安裝

https://docs.openwebui.com

Manual Installation
手動安裝

Installation with pip (Beta)
安裝 (Beta)

For users who prefer to use Python’s package manager pip, Open WebUI offers a installation method. Python 3.11 is required for this method.
對於喜歡使用 Python 包管理員的使用者,Open WebUI 提供了一種安裝方法。此方法需要 Python 3.11。

  1. Install Open WebUI: Open your terminal and run the following command:
    :
    開啟終端並執行以下命令:pip install open-webui
  2. Start Open WebUI: Once installed, start the server using:
    :
    安裝後,使用以下命令啟動伺服器:open-webui serve

This method installs all necessary dependencies and starts Open WebUI, allowing for a simple and efficient setup. After installation, you can access Open WebUI at http://localhost:8080. Enjoy! 😄
此方法會安裝所有必要的依賴項並啟動Open WebUI,從而實現簡單高效的設置。安裝后,您可以在 http://localhost:8080 訪問 Open WebUI。享受!😄