Skip to main content

BiyoVes - Python Library

AI-powered biometric, passport, and visa photo generation for Python.

Resources: Web Studio · PyPI · Source · Issues · License

Overview

BiyoVes provides a compact API for background removal, face alignment, standards-based cropping, and print-ready photo layouts.

Prefer a browser? The free BiyoVes Web Studio uses the same processing pipeline without requiring an account.

Installation

pip install biyoves

Or from source:

git clone https://github.com/mehmetaytugyuruk/biyoves-python-library.git
cd biyoves-python-library
pip install -e .

Quick Start

Method 1: Class-Based Usage (Recommended)

from biyoves import BiyoVes

# Specify the photo path
img = BiyoVes("photo.jpg")

# Create a passport photo (2-up layout)
passport = img.create_image("vesikalik", "2li", "result_passport.jpg")

# Create a biometric photo (4-up layout)
biometric = img.create_image("biyometrik", "4lu", "result_biometric.jpg")

# US visa photo
us_visa = img.create_image("abd_vizesi", "2li", "result_us_visa.jpg")

# Schengen visa photo
schengen = img.create_image("schengen", "4lu", "result_schengen.jpg")

Method 2: Function-Based Usage

from biyoves import create_image

# Single-line processing
passport = create_image("photo.jpg", "vesikalik", "2li", "result.jpg")

Batch Processing

from biyoves import BiyoVes

results = BiyoVes.batch_process(
    input_dir="photos/",
    photo_type="biyometrik",
    layout_type="4lu",
    output_dir="results/",
)

for result in results:
    print(result)

Models are loaded once and shared across the batch. A failed photo is reported with status="error" without stopping the remaining files. If output_dir is omitted, results are written to input_dir/results.

Photo Quality Preflight

from biyoves import BiyoVes

img = BiyoVes("photo.jpg")
report = img.check_quality()

print(report["is_acceptable"])
print(report["warnings"])

The optional preflight checks face-region blur, eye openness, and estimated frontal face angle. It reports warnings but never blocks image generation.

Photo Types

  • "biyometrik" - Standard biometric photo (50x60mm)
  • "vesikalik" - Passport photo (45x60mm)
  • "abd_vizesi" - US visa photo (50x50mm)
  • "schengen" - Schengen visa photo (35x45mm)

Layout Types

  • "2li" - 2 photos stacked vertically (2x1)
  • "4lu" - 4 photos in a grid (2x2)
  • "6li" - 6 photos in a grid (3x2)
  • "8li" - 8 photos in a grid (4x2)

Features

  • AI-powered automatic background removal
  • Automatic face angle correction
  • Automatic cropping to standard dimensions
  • Batch directory processing with per-file results
  • Optional preflight checks for blur, eye openness, and face angle
  • Print templates (2-up / 4-up / 6-up / 8-up layouts)
  • Print-ready PDF output at 300 DPI
  • Cut lines for print-ready output

Requirements

  • Python >= 3.8
  • OpenCV
  • NumPy
  • ONNX Runtime

Models Used

This project uses the following ONNX models:

Model Purpose Source
modnet.onnx Background Removal MODNet - Efficient background removal model
det_500m.onnx Face Detection InsightFace SCRFD - SCRFD (Stable Cascaded Refinement Face Detector) buffalo_s model
2d106det.onnx Face Landmark Detection InsightFace 2D106 - 106-point facial landmark detection model

Model Directory: All models are stored in the src/biyoves/models/ directory.

Model Citations

  • MODNet: Zhanghan Ke et al., "MODNet: Real-Time Trimap-Free Portrait Matting via Objective Decomposition," AAAI 2022.
  • InsightFace: Jiankang Deng et al., "InsightFace: 2D and 3D Face Analysis Project."

Third-Party Models and Licensing

The BiyoVes source code is MIT-licensed. Bundled model weights retain their original terms and are not relicensed by this repository:

  • MODNet code and published models are provided under Apache-2.0 by the MODNet project.
  • InsightFace model-zoo weights, including the SCRFD and 2D106 components used here, are provided for non-commercial research purposes only according to the InsightFace model-zoo notice.

Review the upstream terms before redistributing the weights or using them in a commercial product.

License

The BiyoVes source code is released under the MIT License. Third-party model weights are governed by the terms listed above.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

biyoves-1.4.1.tar.gz (31.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

biyoves-1.4.1-py3-none-any.whl (31.0 MB view details)

Uploaded Python 3

File details

Details for the file biyoves-1.4.1.tar.gz.

File metadata

  • Download URL: biyoves-1.4.1.tar.gz
  • Upload date:
  • Size: 31.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for biyoves-1.4.1.tar.gz
Algorithm Hash digest
SHA256 b99b5d40c2d973a4b097f412c458d836c84a1ef5d2c451907701ef5e805b0bf3
MD5 80d0b9e9414c1a81a2354017394486a4
BLAKE2b-256 71321dbe3db241de69c6e6dbeb1a32f7b6614beee1b55ed74a285b64a4debedb

See more details on using hashes here.

Provenance

The following attestation bundles were made for biyoves-1.4.1.tar.gz:

Publisher: release.yml on mehmetaytugyuruk/biyoves-python-library

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file biyoves-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: biyoves-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 31.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for biyoves-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f9eb9b864ecb69e8a0f3300fd8d1dcb48a57ba9760248b00e491084cdbf6ac88
MD5 619c418beaf74b8c1b30fd326b2e7c39
BLAKE2b-256 b73408f7c18bbda3af6dd69732b4f8ae776621c87f63844fe398b7faa5f18944

See more details on using hashes here.

Provenance

The following attestation bundles were made for biyoves-1.4.1-py3-none-any.whl:

Publisher: release.yml on mehmetaytugyuruk/biyoves-python-library

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.4.1 This release

2 files

1.4.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.4

2 files

1.0.2

2 files

1.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page