Skip to content

Repository files navigation

ForgeDiff Inspector 2.0

Offline, explainable computer vision for metal-assembly inspection.

ForgeDiff Inspector compares a known-good reference photograph with an inspection photograph, verifies that both images contain the same assembly, and presents technician-readable evidence for missing, extra, or structurally changed parts. The application is written in C#/.NET 8 with Avalonia and performs inference locally.

Portfolio source release by Muhammet Sait Doğmuş, including the production component-decision implementation. Pretrained model weights are not committed to the git history for licensing reasons, and customer/contest input photographs are not included. See Source release scope.

Download and run

No build step is required to try the application:

  1. Go to the Releases page and download the Windows or Linux package for the latest version.
  2. Extract the archive.
  3. Windows: double-click ForgeDiff-Baslat.bat (or run ForgeDiff.exe directly). Linux: run ./ForgeDiff-Baslat.sh (or launch ForgeDiff directly).

The published packages are self-contained — no separate .NET runtime, Python environment, or model download is needed.

ForgeDiff desktop inspection interface

Why this project exists

Conventional pixel subtraction is useful only when two photographs are nearly registered. Real shop-floor images introduce camera movement, exposure changes, reflections, partial occlusion, background clutter, and three-dimensional viewpoint variation. ForgeDiff treats these as two different inspection problems:

Situation Processing strategy
Same or nearly identical viewpoint SIFT/RANSAC registration followed by normalized dense structural comparison
Different viewpoint Learned local correspondence, semantic assembly identity, class-agnostic proposals, inventory and topology reasoning

The output is deliberately more than a similarity score. A reviewer receives:

  • a side-by-side annotated comparison;
  • numbered common areas and candidate findings;
  • measured confidence and geometric evidence;
  • an explicit safe stop when identity cannot be established;
  • exportable PDF, DOCX, PNG, and JSON reports.

Demonstrated behavior

Regression and validation matrix

The regression suite covers exact duplicates, strong brightness changes, a small structural edit, viewpoint changes, and unrelated negative controls. The application is conservative by design: when the evidence does not prove that two photographs are comparable, it returns Not Comparable instead of fabricating defect boxes.

Example inspection evidence

Cross-view evidence Structured report
Column comparison evidence PDF report preview

The screenshots show evaluation material supplied through the original project brief. They document the interface and measured output; the underlying evaluation photographs are not included in this repository.

Architecture

flowchart LR
    A[Reference A] --> Q[Input and quality checks]
    B[Inspection B] --> Q
    Q --> R{Registration reliable?}
    R -->|Yes| S[Same-view structural pipeline]
    R -->|No| C[Cross-view evidence pipeline]
    S --> N[Lighting normalization]
    N --> D[Intensity + gradient + edge evidence]
    C --> L[DISK + LightGlue correspondences]
    C --> I[DINOv2 assembly identity]
    C --> P[FastSAM part proposals]
    L --> G[Fundamental-matrix geometry]
    I --> V[Identity and overlap gate]
    P --> V
    G --> V
    D --> O[Numbered findings]
    V --> O
    O --> U[Technician UI]
    O --> X[PDF / DOCX / PNG / JSON]
Loading

More detail is available in Architecture, Validation, and Reporting.

Technology

  • Desktop: C#, .NET 8, Avalonia 11, SkiaSharp
  • Computer vision: OpenCV/OpenCvSharp, SIFT, RANSAC, CLAHE, Scharr, Canny
  • Learned features: DISK + LightGlue exported to ONNX
  • Semantic representation: DINOv2-small INT8 ONNX
  • Automatic proposals: FastSAM-S ONNX
  • Inference: Microsoft ONNX Runtime, CPU, offline
  • Delivery: self-contained Windows x64 and Linux x64 publications

FastSAM is used for class-agnostic region proposals—not as a fixed-label COCO object detector. Geometry and semantic identity are evaluated independently so that a single model score cannot silently decide the final result.

Repository layout

src/ForgeDiff.App/
├── Core/           comparison models, registration, learned features, ONNX adapters
├── Controls/       reusable zoom/pan image viewer
├── Services/       bitmap conversion and multi-format reporting
├── Localization/   Turkish/English UI catalog
├── Styles/         Avalonia theme
└── MainWindow.*    responsive inspection workstation
docs/
├── images/         interface and validation evidence
├── ARCHITECTURE.md
├── REPORTING.md
└── VALIDATION.md

The repository contains the human-written UI, reporting, data-model, same-view comparison, learned-feature adapter, production component inventory/topology, and application-shell source in full. Pretrained ONNX weights are not committed to the git history (see Source release scope).

Building from source

Requirements: .NET 8 SDK on Windows or Linux, plus your own licensed copies of the three ONNX files listed in src/ForgeDiff.App/Models/README.md.

dotnet restore src/ForgeDiff.App/ForgeDiff.App.csproj
dotnet build src/ForgeDiff.App/ForgeDiff.App.csproj -c Release

If you just want to run ForgeDiff without building it yourself, use the prebuilt package from Releases instead — see Download and run above.

Design principles

  1. Evidence before verdict. A result must expose why it was produced.
  2. Safe failure. Low-confidence input stops the decision instead of inventing a box.
  3. Local processing. Customer photographs remain on the workstation.
  4. Human review. A 2D photograph is decision support, not a metrology certificate.
  5. Repeatable validation. Exact, lighting, defect, viewpoint, and unrelated controls are tested independently.

Limitations

  • A fully occluded surface cannot be inspected from a single photograph.
  • Millimetre-accurate measurement requires calibration or a known scale reference.
  • Customer-specific components require labelled good/bad images and acceptance tests.
  • Reflective stainless steel requires controlled capture guidance for best results.
  • The public source package does not contain production model weights or closed component-decision heuristics.

Ownership and licensing

The original ForgeDiff source and documentation are proprietary work owned by Muhammet Sait Doğmuş. They are published for portfolio review and evaluation only. No permission is granted to copy, modify, redistribute, sublicense, sell, or use the work in production. See LICENSE.

Third-party libraries and pretrained models remain the property of their respective authors and are governed by their own licenses. They are not relicensed by the ForgeDiff proprietary notice. See THIRD_PARTY_NOTICES.md.

Author

Muhammet Sait Doğmuş — Computer Engineer & AI Developer

About

Offline explainable computer vision for metal-assembly inspection — C#/.NET 8, Avalonia, OpenCV, DINOv2, FastSAM and LightGlue.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages