{ "cells": [ { "cell_type": "markdown", "id": "90a786c6", "metadata": {}, "source": [ "# Request CUDA execution" ] }, { "cell_type": "code", "execution_count": 1, "id": "8501be4c", "metadata": { "execution": { "iopub.execute_input": "2026-11-01T06:45:20.471853Z", "iopub.status.busy": "2026-11-01T06:45:20.471726Z", "iopub.status.idle": "2026-11-01T06:45:21.090580Z", "shell.execute_reply": "2026-11-01T06:45:21.090224Z" }, "scrolled": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Installed runtime providers:\n", "['TensorrtExecutionProvider', 'CUDAExecutionProvider', 'CPUExecutionProvider']\n" ] } ], "source": [ "import onnxruntime as ort\n", "\n", "print(\"Installed runtime providers:\")\n", "print(ort.get_available_providers())" ] }, { "cell_type": "code", "execution_count": 2, "id": "03cb7859", "metadata": { "execution": { "iopub.execute_input": "2026-11-01T06:45:21.092398Z", "iopub.status.busy": "2026-11-01T06:45:21.092231Z", "iopub.status.idle": "2026-11-01T06:45:40.507771Z", "shell.execute_reply": "2026-11-01T06:45:40.507147Z" }, "scrolled": false }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Loaded DBNet detector (GPU/CUDA, threads=8)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Loaded SVTR recognizer (vocab=185 chars, GPU/CUDA, threads=8)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "[occular] LM (pure Python): compact_lm.npz (268 MB), unigrams=2010937, alpha=0.5 beta=1.0 beam=100\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "СУПЕРМАРКЕТ «ВОЛГА-МАРКЕТ»\n", "ул. Белинского, 32\n", "00О «Волга-Ритейл»\n", "ИНН 5260998741\n", "Смена 214\n" ] } ], "source": [ "from occular import ocr\n", "\n", "text = ocr(\"receipt.jpg\", gpu=True)\n", "print(\"\\n\".join(text.splitlines()[:5]))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.3" } }, "nbformat": 4, "nbformat_minor": 5 }