informative-drawings-onnx
ONNX models for generating outline drawings from photos
2 min readupdated
This repository contains ONNX versions (models formatted for fast execution across various devices) of three generators from the Informative Drawings project. The models are designed to turn regular photos into high-quality black-and-white lines, sketches, and anime art. The set includes models with different precision levels (fp16 and fp32), optimized for use in the OutlineKid mobile app. The tool will be useful for developers of image-processing apps and enthusiasts running AI models locally.
Key features
- Three generation styles: contour, anime, and opensketch.
- Available in fp16 (half-precision for speedup) and fp32 (full precision) formats.
- Models exported to ONNX with support for dynamic image resolution (H and W).
- Source code and weights distributed under the MIT license.
What you can do
- Integrate the models into a mobile or desktop app to convert photos into graphic sketches.
- Run image processing via ONNX Runtime on CPU or other supported platforms.
- Test different line styles (contour, anime, opensketch) on your own photos.
Example
The model accepts an RGB image in the range from 0 to 1 with a dynamic size (multiples of 8 are recommended) as input, and outputs a single-channel line map as a tensor.
Read more
DetailsBenchmarks (IoU): fp32 accuracy is 1.0000, while for fp16 across different styles and resolutions (512 and 1024), the IoU value stays within 0.9995–0.9999.
Repository files: anime.onnx (~8.6 MB), contour.onnx (~8.6 MB), opensketch.onnx (~8.6 MB), and contour_fp32.onnx (~17.2 MB as a fallback option).
Training details: converted from original PyTorch code using onnxslim and onnxconverter_common (opset 17).
Features: InstanceNorm statistics depend on the image size, so the input image is fed as a whole rather than in tiles.








Comments