[!WARNING] This project is a Work in Progress (WIP). Core features are actively being developed, and breaking changes may occur. Contributions are highly welcome!
GradeAnt is a small cross-platform desktop prototype that converts UI layout images into editable HTML using a CPU-only OpenCV library and a Python customtkinter interface. The native implementation uses C++20 and generates nested HTML/CSS from a typed, versioned intermediate representation (IR).
Install a C++20 compiler, CMake 3.16+, and OpenCV development files (including core, imgproc, and imgcodecs). Then build from the repository root:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config ReleaseThe library is written to build/ (or build/Release/ with Visual Studio generators).
See the architecture overview and the v1 IR JSON Schema. The fidelity, semantic, and hybrid profiles operate on the compiled IR; hybrid is the default. The profile selector in the desktop app regenerates output without repeating detection.
The IR and HTML generation tests can be built without OpenCV:
cmake -S . -B build-tests -DGRADEANT_BUILD_NATIVE=OFF
cmake --build build-tests
ctest --test-dir build-tests --output-on-failurepython -m venv .venv
# Activate the virtual environment, then:
python -m pip install -r requirements.txt
python src/app/main.pyThe UI loads the platform library from build/ and exports a self-contained HTML file. On Windows, build and run with matching architectures (for example, both x64).
The current detector uses contour geometry and conservative alignment heuristics; it does not yet reconstruct text, source colours, assets, or exact design intent. Its output is a structural starting point, not production-ready code. The versioned C ABI provides an owned compilation-result handle, IR access, profile-based HTML generation, error codes, optional progress callbacks, and explicit release. The older compile_image_layout entry point remains available for compatibility.