Skip to content

Feat: On-device OCR to extract and copy text from images #1522

Description

@Surajshivam-123

Describe the feature

Feature

Add a local, privacy-preserving Optical Character Recognition (OCR) feature that allows users to extract text from photos and copy it directly to their clipboard.

Proposed Implementation & Architecture

1. Backend (On-Device Inference via ONNX)

  • Model: Integrate a lightweight, offline ONNX OCR model .
  • Register the model under a new or optional feature tier so users can manage/download it locally.
  • Implement a dedicated model class extending ONNXSessionBase for thread-safe inference.
  • Index extracted text in SQLite so users can search their photo library by text found inside images.

2. Frontend (Viewer & UX)

  • Viewer Action: Add a "Scan Text" icon button .
  • Extraction Flow:
  • Triggering the action shows a subtle loading state while inference runs.
  • A modal dialog displays the recognized text with line formatting preserved.
  • A primary "Copy to Clipboard" button with immediate feedback (e.g. "Copied!").
  • Handles cases where no text was found.
  • Prompts the user to download/enable the OCR model from Settings if not yet installed.

Add ScreenShots

Hi @rohan-pandeyy can i work in this feature.

Record

  • I agree to follow this project's Code of Conduct
  • I want to work on this issue

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions