Skip to main content

abstract_identity

Identity pipeline for hugpy, merged from the former standalone char360 and identity-render dists into one src-layout package with two subpackages:

Subpackage What it is
abstract_identity.char360 Video → per-character 360° view sets: scenes → person detect+track (YOLO) → face embed+pose (insightface) → identity cluster (agglomerative) → yaw-bin (12×30°) → best-per-bin crops + manifest.json. Library + CLI (char360 console script / python -m abstract_identity.char360.cli).
abstract_identity.render The identity-render GPU service (identity-render console script): reference photos → Hunyuan3D-2mv mesh (+ headless-Blender turntable), plus the char360-powered video_extract and video_characters_glb job kinds, behind a tokened Flask job API on :9750.

Install

Base (any box — coordinator, dev VM, CI):

pip install abstract_identity

Base is deliberately thin and wheels-only: flask + pydantic, nothing else. Every module still imports cleanly with no heavy deps present — heavy imports are lazy, inside the stage/job that needs them — so the service can boot anywhere and honestly report capabilities as not-ready.

Optional render dependencies can be installed with:

python -m pip install 'abstract_identity[render]'

Model weights and GPU/native runtimes need their own compatible installation. The optional extra alone does not establish renderer readiness. See the third-party notices in LICENSE and the package's installer scripts before redistributing model assets or native components.

Why the heavy deps are an extra, not base

pip install abstract_identity[render] pulls the char360 detection stack: scenedetect[opencv], ultralytics, insightface, onnxruntime-gpu==1.18.1, opencv-python, numpy, scikit-learn. They are not in base because they are

  • heavy/native/CUDA — pointless on a coordinator box, and
  • restrictively licensed — ultralytics is AGPL-3.0 (a deployed combination is an AGPL combined work) and the insightface pretrained packs (buffalo_l) are non-commercial research only. See the THIRD-PARTY OBLIGATIONS NOTICE in LICENSE before any commercial use or redistribution.

Hunyuan3D-2 is never a pip dep at all (restrictive Tencent community license — excludes EU/UK/South Korea including outputs). It is installed out-of-band, only on the render box, by install/install_identity_render_ae.sh (git checkout + pip install -e + weight pre-download); the code only reaches hy3dgen lazily inside a running mesh job. Same for torch, trimesh, and Blender.

Import paths and commands

Use abstract_identity.char360 and abstract_identity.render directly:

from abstract_identity.char360.pipeline import run_char360
from abstract_identity.render.jobstate import STAGE_DONE
python -m abstract_identity.char360.cli <video> -o <outdir>
python -m abstract_identity.render.service

The char360 and identity-render console scripts remain available. Service log records flow through the "identity_render" logger name.

Service API (summary)

Every request, /health included, requires X-Identity-Render-Token: <TOKEN> (401 otherwise). Jobs run one at a time (single GPU, single worker thread).

Method Path What
GET /health Service + honest capability report
POST /jobs Queue a job (mesh_build, turntable, mesh_and_turntable, video_extract, video_characters_glb); returns 202 {"job_id": ...}
GET /jobs/<job_id> {job_id, status, error?, files?}
GET /jobs/<job_id>/files/<name> Fetch an artifact's bytes
DELETE /jobs/<job_id> Best-effort cleanup of a job's files

Artifacts land under $IDENTITY_RENDER_HOME/<job_id>/; nothing is cleaned up automatically. Env vars (IDENTITY_RENDER_TOKEN/PORT/HOME, BLENDER_BIN, FFMPEG_BIN, HUNYUAN3D_*, HF_HOME, ...) are written to ~/identity-render/env by the installer. Background removal (mesh_params.remove_background) is ON by default; originals are never modified.

On ae: systemctl --user status identity-render.service, journalctl --user -u identity-render.service -f. Code-only update: re-run the installer (editable install — a restart alone picks up share changes), then systemctl --user restart identity-render.service.

char360 CLI

char360 <video> -o <outdir> [--stride 8] [--yolo yolov8m.pt] \
    [--min-h-frac 0.15] [--cluster-dist 0.55] [--min-faces 4]

Output: <outdir>/manifest.json + char_NN/view_MM_yaw±DDD.png crops (bin 0 frontal, 30° bins CCW; rear bins are yaw_source=rear_inferred via track-level identity propagation). Missing heavy deps fail loud at stage-run time with a pip install hint, never at import time.

Tests

python -m pytest tests/ -q     # or: python -m unittest discover tests

The suite never imports cv2/torch/insightface/sklearn/scenedetect — heavy stages are mocked — so it runs on a base install (plus numpy for the pipeline test's fixtures).

Source organization

abstract_identity/imports owns the shared boundary, following hugpy-discovery:

  • init_imports.py declares standard-library, external, and internal package imports. Symbols resolve on request; optional GPU imports stay inside the jobs that use them.
  • constants.py owns fixed pipeline/service constants and environment defaults.
  • functions/ owns general file utilities and service configuration reading.

Section modules import dependencies through that boundary. Geometry/scoring, character extraction stages, rendering, and job state remain in their respective sections. Queues, locks, backend instances, and active job state remain with their owning service modules. Service settings are read at boot rather than when the boundary is imported.

Blender executes its scripts by file path in a separate Python environment. Their small sys/pathlib bootstrap exposes the source package before resolving all remaining imports through the boundary.

Metadata

Release files for abstract-identity 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for abstract-identity 0.1.3
File Size Uploaded Provenance Actions
abstract_identity-0.1.3.tar.gz 59.6 kB Without provenance Details for abstract_identity-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for abstract-identity 0.1.3
File Interpreter ABI Platform Actions
abstract_identity-0.1.3-py3-none-any.whl Python 3 none any Details for abstract_identity-0.1.3-py3-none-any.whl

Total release size: 123.5 kB

Release files / abstract_identity-0.1.3.tar.gz

Download URL abstract_identity-0.1.3.tar.gz
Size 59.6 kB
Tags Source
SHA-256 checksum
How to use checksums
06ef919069fbbc6131e698f38fe1277e895b8ed0dc87b8ed08ccd36cb473a852
BLAKE2b-256 checksum
How to use checksums
2fdbb383963f72442d2a76016d3c0d3cca98a089bd327e875fc65b50bec45258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / abstract_identity-0.1.3-py3-none-any.whl

Download URL abstract_identity-0.1.3-py3-none-any.whl
Size 64.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
83c7668acc3758fd1448f0fb25a91a9e997fa5be54b17274ca91155055ce3585
BLAKE2b-256 checksum
How to use checksums
34df381dfefccafaff9d16d3bc3e48aa078a607cf112a8587dcfbdd87bfbd0fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for abstract-identity 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page