No description
  • C# 60.7%
  • Python 38.4%
  • Batchfile 0.9%
Find a file
MaddoScientisto f672894c3e
Some checks failed
Build And Publish AIFotoONLUS.Core / build (push) Failing after 1m16s
Build And Publish AIFotoONLUS.Core / publish (push) Has been skipped
Update project metadata and add test data
- Changed the repository URL in the AIFotoONLUS.Core project file to point to the new Forgejo instance.
- Removed the inclusion of the XML documentation file in the NuGet package.
- Added a new CSV file containing test data for image processing, including filenames and associated text values.
2026-05-09 12:09:31 +02:00
.forgejo/workflows Update project metadata and add test data 2026-05-09 12:09:31 +02:00
models First commit 2026-02-15 14:04:11 +01:00
scripts Enhanced logging, diagnostics, and robustness throughout 2026-02-15 18:06:03 +01:00
src Update project metadata and add test data 2026-05-09 12:09:31 +02:00
.gitattributes Add .gitignore (C#/Python) and enable Git LFS for zip, dll, exe, .weights 2026-02-15 14:03:02 +01:00
.gitignore Add .gitignore (C#/Python) and enable Git LFS for zip, dll, exe, .weights 2026-02-15 14:03:02 +01:00
.gitlab-ci.yml Fixed Minversion 2026-02-15 21:39:14 +01:00
AIFotoONLUS.sln Initial .NET scaffold: Core, Console, WPF projects 2026-02-15 15:16:56 +01:00
AiGareFrontend.exe First commit 2026-02-15 14:04:11 +01:00
AiSettingsNew.json First commit 2026-02-15 14:04:11 +01:00
det.py Enhanced logging, diagnostics, and robustness throughout 2026-02-15 18:06:03 +01:00
det2.py First commit 2026-02-15 14:04:11 +01:00
det3.py First commit 2026-02-15 14:04:11 +01:00
det4.py First commit 2026-02-15 14:04:11 +01:00
gitversion.json Update project metadata and add test data 2026-05-09 12:09:31 +02:00
guida.txt First commit 2026-02-15 14:04:11 +01:00
Intelligenza artificiale foto.zip First commit 2026-02-15 14:04:11 +01:00
README.md Add full XML docs and NuGet IntelliSense support 2026-02-15 23:37:08 +01:00
script.bat Enhanced logging, diagnostics, and robustness throughout 2026-02-15 18:06:03 +01:00
settings.json First commit 2026-02-15 14:04:11 +01:00
sni.dll First commit 2026-02-15 14:04:11 +01:00

AIFotoONLUS Number Recognition Library

This library provides a small, focused engine to detect and recognize numeric text (digits) in images using Darknet (YOLO) models via OpenCvSharp's DNN API. It is suitable for batch processing folders of images or individual files.

Features

  • Detection network (Darknet/Yolo) to find candidate text regions.
  • Recognition network (Darknet/Yolo) to identify digits inside detected crops.
  • Single-file and directory-level processing APIs.
  • Parallel processing with per-thread network instances for throughput.
  • Diagnostic helpers to dump network output shapes and optionally save crop images.

Basic usage

  1. Create a ModelConfiguration instance that points to your Darknet .cfg and .weights files for both detection and recognition networks, configure confidence and NMS thresholds and provide a list of number class labels.

  2. Create an instance of NumberRecognitionEngine:

using var engine = new NumberRecognitionEngine(modelConfig, logger: null);
  1. Process a single image:
var result = engine.ProcessImage("/path/to/image.jpg");
Console.WriteLine(result.Text);
  1. Process a directory (parallelized):
var results = await engine.ProcessDirectoryAsync("/path/to/images", recursive: false);
foreach (var r in results) Console.WriteLine($"{r.FileName}: {r.Text}");

Configuration notes

  • ModelConfiguration controls model file paths, input sizes, thresholds and whether to save cropped images for diagnostics. Make sure the paths are accessible to the process and the model files match the expected network architectures.

  • The engine expects detection network outputs in the YOLO-style layout: [cx, cy, w, h, objectness, class1, class2, ...].

Threading & diagnostics

  • For directory/batch processing the engine creates per-thread Net instances so OpenCV forward calls can run concurrently. It also contains fallback logic that will perform processing with shared nets under a lock if needed.

  • When EnableCropSaving is enabled in configuration, each recognized crop is saved to logs/crops with a timestamp and optional context label to aid debugging false positives/negatives.

Troubleshooting

  • If the engine returns no detections, verify the model files are correct and compatible with the expected output layout. Use ProcessFileWithDiagnostics to inspect output layer shapes.

License & Notes This project is provided as-is. See repository for licensing information and for the model files distribution terms (models are usually not redistributed with code and must be obtained separately).