mirror of
https://github.com/RPCS3/discord-bot.git
synced 2026-07-19 13:54:44 -04:00
[PR #999] [MERGED] Re-introduce OCR for images #1003
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RPCS3/discord-bot/pull/999
Author: @13xforever
Created: 7/5/2025
Status: ✅ Merged
Merged: 7/7/2025
Merged by: @13xforever
Base:
master← Head:feature/ocr📝 Commits (4)
2259febimplement pluggable ocr provider and add tesseract and florence2 impl4ecb64eunify some config params, and move datfile location to app dataa81d48fupgraded nlog back to v6, and it should work as expected nowe99e507offer user input as one of the autocomplete choices for events and compat📊 Changes
18 files changed (+421 additions, -118 deletions)
View changed files
📝
Clients/CompatApiClient/CompatApiClient.csproj(+1 -1)📝
CompatBot/Commands/AutoCompleteProviders/EventNameAutoCompleteProvider.cs(+3 -1)📝
CompatBot/Commands/AutoCompleteProviders/ProductCodeAutoCompleteProvider.cs(+5 -2)📝
CompatBot/Commands/BotStatus.cs(+3 -5)📝
CompatBot/Commands/Vision.cs(+15 -15)📝
CompatBot/CompatBot.csproj(+4 -2)📝
CompatBot/Config.cs(+15 -5)📝
CompatBot/EventHandlers/ContentFilterMonitor.cs(+2 -0)📝
CompatBot/EventHandlers/MediaScreenshotMonitor.cs(+60 -80)➕
CompatBot/Ocr/Backend/AzureVision.cs(+52 -0)➕
CompatBot/Ocr/Backend/BackendBase.cs(+33 -0)➕
CompatBot/Ocr/Backend/Florence2.cs(+65 -0)➕
CompatBot/Ocr/Backend/IOcrBackend.cs(+8 -0)➕
CompatBot/Ocr/Backend/Tesseract.cs(+81 -0)➕
CompatBot/Ocr/OcrProvider.cs(+59 -0)📝
CompatBot/Program.cs(+3 -1)📝
Dockerfile(+4 -5)📝
README.md(+8 -1)📄 Description
Refactored Azure Computer Vision OCR as one of the supported backends, and added Florence2 and Tesseract as alternatives.
There's a new config parameter
OcrBackend, which is set toautoby default. Possible options:azure: preferred whenAzureComputerVisionKeyis configured — best accuracy and speed; requires Azure subflorence2: preferred for host with 4GB of ram or more — 2nd best accuracy, no native dependencies; slow, and requires more ramtesseract: used as the last resort — ok accuracy, requires extra packages on Linux (see updated Readme); fast, low resource usageAdditionally, the reaction handler for message filter check now also checks image attachments.
And, as we're now not limited to the number of API calls, all channels are being checked.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.