Introducing SyNumpy: A Standalone C++17 Library for Woking with Numpy Files and Arrays

enter image description here

At PixLab and Symisc Systems, we build systems that move data between native C++ code and Python-based machine learning workflows. In practice, that often means dealing with NumPy array files.

Today, we are open-sourcing syNumpy, a standalone C++17 library for reading and writing NumPy .npy files.

syNumpy is designed to be simple to integrate, easy to understand, and reliable in production. It gives native applications a clean way to exchange numerical arrays with Python tooling without dragging in a heavy dependency stack.

Why We Built It

In computer vision, facial analysis, visual search, OCR, and document processing, moving tensors and feature vectors across systems is routine. NumPy’s .npy format is a practical interchange format, but using it directly from C++ often means either relying on outdated code, pulling in more infrastructure than needed, or maintaining internal glue code.

We wanted something better:

  • modern C++17
  • small and focused API surface
  • easy vendoring into existing projects
  • explicit validation and predictable failures
  • production-ready .npy support without unnecessary complexity

That became syNumpy.

Production-Tested Inside FACEIO and PixLab

syNumpy is not a toy project or a throwaway utility. It is used internally by FACEIO for facial feature extraction workflows and by PixLab / Symisc Systems across production systems tied to visual search, document processing, and identity-document scanning.

That includes internal workflows behind:

That production use shaped the library directly. The goal was not to ship a bloated abstraction layer. The goal was to ship something dependable.

What syNumpy Provides

syNumpy focuses on doing one thing well: reading and writing NumPy .npy arrays from modern C++.

Current highlights include:

  • support for NumPy .npy files
  • a standalone C++17 implementation
  • a compact API centered around:
    • syNumpy::NpyArray
    • syNumpy::loadNpyBuffer()
    • syNumpy::loadNpy()
    • syNumpy::saveNpyRaw()
    • typed syNumpy::saveNpy() overloads
  • append mode support for compatible arrays
  • strict validation of malformed headers and truncated payloads
  • explicit runtime failures through syNumpy::Error

The core parser entry point is syNumpy::loadNpyBuffer(), which makes the library useful in embedded, memory-mapped, or network-driven workflows where the file is already available in memory.

Integration Is Intentionally Simple

One of the main design goals was frictionless integration.

The easiest way to use syNumpy is to add these two files directly to your codebase:

  • synumpy.hpp
  • synumpy.cpp

Compile them with your existing C++17 target and you are done.

No service layer. No code generator. No large runtime dependency stack.

The repository also includes a CMakeLists.txt and a simple Makefile, but the direct drop-in path is the intended fast path for most teams.

Minimal Example

#include "synumpy.hpp"
#include <vector>

int main() {
    std::vector<float> values = {1.0f, 2.0f, 3.0f};

    syNumpy::saveNpy("floats.npy", values);

    syNumpy::NpyArray arr = syNumpy::loadNpy("floats.npy");
    std::vector<float> roundtrip = arr.asVector<float>();

    return roundtrip.size() == 3 ? 0 : 1;
}

A Better Fit for Native ML and Vision Pipelines

There is a practical gap between Python-first tooling and production-grade native applications. syNumpy is meant to help close that gap.

If your system is already in C++, but your models, offline tooling, embeddings, or data-preparation steps live in Python and NumPy, having a straightforward .npy bridge matters. That is especially true in machine vision and identity workflows, where performance, reliability, and integration simplicity matter more than abstraction for abstraction’s sake.

Open Source and Licensing

syNumpy is released under the BSD 3-Clause License.

You can explore the project here:

Thoughts

We are releasing syNumpy because it solves a real problem we face in production, and because we think the wider C++ and machine vision community can benefit from a small, modern, well-scoped NumPy .npy library.

If you are building native AI, ML, OCR, document-analysis, or vision systems and need a direct bridge to NumPy arrays, syNumpy is built for exactly that use case.

Introducing the Pixel Generate API Endpoint

PixLab Logo

The PixLab Computer Vision Team is pleased to introduce the Pixel Generate API endpoint (/pixelgenerate) which let you in a single call, generate on the fly, images filled with random pixels of desired width & height using a mix of standard Image Processing and soon Machine Learning algorithms.

This endpoint is similar to /newimage except that the image contents is filled with random pixels. This is very useful for generating background (negative) samples for feeding Machine Learning training algorithms for example.

By default, this endpoint return a JSON object holding a link to the generated image output. But, you can set it via the Blob parameters to return the image binary contents instead.

Below, a Python snippet which generate on the fly a new image of height & width of 300x300 filled with random pixels using a single call to /pixelgenerate:

The code sample used to achieve such result is available to consult via the following Github link:

PixLab API 1.9.72 Released!

The PixLab development team is pleased to announce the immediate availability of the PixLab API 1.9.72.

PixLab Logo

Since its launch on 2017, PixLab have already processed over 450 Millions of users contents whether static images, GIF or Videos Frames. This milestone release introduces new API endpoints, various minor bug fixes, processing speed improvements by up to 5% and many innovative features. Let's start with the one we are existed about in no particular order:

  • Passports & ID Cards Scan: While documents scanning were introduced in earlier version of the PixLab API via the /docscan endpoint. This release pushes further the accuracy of the OCR engine. A 5MB raw Passport sample now takes less than 3 seconds to execute including face detection & extraction, MRZ (Machine Readable Zone) extraction and finally transformation of the Raw MRZ data into textual content. You can try out the accuracy of the Passport scanning engine using these Python and PHP scripts to see it in action.
  • DNS infrastructure moved to Cloudflare for faster than ever response times.
  • Full support for HTTP/2 and HTTP/3 (QUIC).
  • Up to three layers of redundancy for the standard PixLab OCR engine for faster, accurate & guaranteed scan results.
  • A fresh update of the adult & gore content detection ML model which is used to power the famous PixLab /NSFW API endpoint that have already analyzed over 100 millions of user contents with high accuracy.
  • Face Detection (including facial landmarks extraction) & Emotion Pattern (including gender & age) extraction are now using the RetinaFace Model which scores the highest on the LFW dataset.
  • The /docscan API endpoint now fully support scanning ID cards from Malaysia & Singapore and many other countries (at users request) as well the brand new India Aadhar ID card. Find out more information about Aadhard fully support via our blog announcement here.
  • Finally, a brand new, high performance custom image processing layer written in C/C++ and powered by ImageMagick and our Embedded computer Vision Library SOD is integrated directly into our cloud API.

Pixlab customers are more than advised to take a look at The official API endpoints documentation, The Samples Page, The Github repository for additional information.

Finally, for potentially interested users, you are more than welcome to start a 7 days free trial to see the API in action. Simply head to the PixLab Dashboard and activate your free trial from there.

PixLab Logo

Face Emotion now predict the Age and Gender of the target face

Good news for PixLab customers!

The /facemotion endpoint now besides outputting the rectangle coordinates for each detected human face, you'll be able to accurately extract their gender, age and emotion pattern via their facial shapes in just a matter of few milliseconds thanks to our newly deployed machine learning models hosted on OVH and AWS instances simultaneously for worldwide availability.

face emotion, gender and age

Below a Python sample to show you how easy is to predict the Age and Gender of any human face.

import requests
import json

# Detect all human faces present in a given image and try to guess their age, gender and emotion state via their facial shapes

# Target image: Feel free to change to whatever image holding as many human faces as you want
img = 'http://www.scienceforums.com/uploads/1282315190/gallery_1625_35_9165.jpg'

req = requests.get('http://api.pixlab.io/facemotion',params={
    'img': img,
    'key':'PixLab_API_Key',
})
reply = req.json()
if reply['status'] != 200:
    print (reply['error'])
    exit();

total = len(reply['faces']) # Total detected faces
print(str(total)+" faces were detected")
# Extract each face now 
for face in reply['faces']:
    cord = face['rectangle']
    print ('Face coordinate: width: ' + str(cord['width']) + ' height: ' + str(cord['height']) + ' x: ' + str(cord['left']) +' y: ' + str(cord['top']))
    # Guess emotion
    for emotion in face['emotion']:
        if emotion['score'] > 0.5:
            print ("Emotion - "+emotion['state']+': '+str(emotion['score']))
    # Grab the age and gender
    print ("Age ~: " + str(face['age']))
    print ("Gender: " + str(face['gender']))

You can visit the PixLab Github repository for additional code samples in various programming languages including PHP and Java.

SOD Embedded 1.1.7 Released

Symisc Systems is pleased to release the first major version of the SOD library! SOD is an embedded, modern cross-platform computer vision and machine learning software library that expose a set of APIs for deep-learning, advanced media analysis & processing including real-time, multi-class object detection and model training on embedded systems with limited computational resource and IoT devices.

SOD was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in open source as well commercial products.

Notable SOD features

  • Built for real world and real-time applications.
  • State-of-the-art, CPU optimized deep-neural networks including the brand new, exclusive RealNets architecture.
  • Patent-free, advanced computer vision algorithms.
  • Support major image format.
  • Simple, clean and easy to use API.
  • Brings deep learning on limited computational resource, embedded systems and IoT devices.
  • Easy interpolatable with OpenCV or any other proprietary API.
  • Pre-trained models available for most architectures.
  • CPU capable, RealNets model training.
  • Production ready, cross-platform, high quality source code.
  • SOD is dependency free, written in C, compile and run unmodified on virtually any platform & architecture with a decent C compiler.
  • Amalgamated - All SOD source files are combined into a single C file (sod.c) for easy deployment.
  • Open-source, actively developed & maintained product.
  • Developer friendly support channels.

Programming Interfaces

The documentation works both as an API reference and a programming tutorial. It describes the internal structure of the library and guides one in creating applications with a few lines of code. Note that SOD is straightforward to learn, even for new programmer.

SOD in 5 minutes or less

A quick introduction to programming with the SOD Embedded C/C++ API with real-world code samples implemented in C.


C/C++ API Reference Guide

This document describes each API function in details. This is the reference document you should rely on.


SOD Github Repository

The official Github repository.


C/C++ Code Samples

Real world code samples on how to embed, load models and start experimenting with SOD.

Real-Time ASCII Art Rendering Library Released

The PixLab engineering team is pleased to announce the immediate availability of the Real-Time ASCII Art C/C++ Rendering Library.

ASCII Art is a single file C/C++ library that let you transform an input image or video frame into printable ASCII characters at real-time using a single decision tree. Real-time performance is achieved by using pixel intensity comparison inside internal nodes of the tree.

  1. For a general overview on how the algorithm works, please visit the demonstration page at https://art.pixlab.io.
  2. The Github Repository at https://github.com/symisc/ascii_art.
  3. The ASCII Art API at https://pixlab.io/art.

Demo