Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BeeAR

Live demo Python 3.11+ Server 3D Person Libs License: MIT MergeOS

BeeAR is a virtual try-on stack for glasses and accessories — frame catalog, full 3D person + glasses GLB studio, pupil-distance (PD) fit, multi-frame compare, plus web / desktop / Android clients on shared libraries.

Product: mergeos-bounties/BeeAR · Live demo: mergeos-bounties.github.io/BeeAR


Live demo (GitHub Pages)

Static, minified browser demo — no Python server required:

Page URL
Camera / 2D try-on https://mergeos-bounties.github.io/BeeAR/
3D person studio https://mergeos-bounties.github.io/BeeAR/studio3d.html
  • Catalog + SVG + GLB assets are shipped as static files (site/catalog/).
  • API calls are shimmed by static-api.js (sessions/wishlist soft-mocked).
  • Build locally: node scripts/build-pages.mjs → open site/ with any static server.
  • Deploy: GitHub Actions workflow pages (push to master or workflow_dispatch).
  • On library release (node scripts/release-libs.mjs), try-on IIFE is emitted as .min.js and the Pages site is rebuilt with minified JS/CSS.
# preview static demo
node scripts/build-pages.mjs
npx --yes serve site -p 4173
# → http://127.0.0.1:4173/

Table of contents


3D person try-on (new)

BeeAR ships full-body Meshy characters (female + male) plus a low-poly bust, and multiple glasses GLB meshes. In the WebGL studio you can switch person, orbit, fit scale, auto-rotate, and snapshot. v0.4.4 fixes 3D AR parenting (glasses stay locked on the face when the person reloads), face-anchor fit for Meshy bodies, and composites camera/demo GLB overlays onto the main canvas so snapshots match what you see.

Asset Path
Female character packages/catalog/glb/person_female.glb (Meshy)
Male character packages/catalog/glb/person_male.glb (Meshy)
Studio bust (fallback) packages/catalog/glb/person_bust.glb
Glasses GLBs Meshy ellipse / square / studio + aviator, wayfarer, round, cat-eye, sport, …
Studio UI packages/web/studio3d.html/studio3d.html (person dropdown + frames)
2D + camera / (canvas try-on; GLB overlay when WebGL available)
cd packages\server
pip install -e ".[dev]"
beear serve --port 8860
# open:
#   http://127.0.0.1:8860/studio3d.html   ← 3D person + glasses
#   http://127.0.0.1:8860/                 ← camera / demo photo

Regenerate meshes (offline, no network):

python packages\catalog\scripts\generate_3d_assets.py

BeeAR 3D person try-on

3D person bust + Aviator Gold GLB (offline mesh render used for docs)


Demo video

Full rotation of the 3D person with glasses GLB try-on:

https://github.com/mergeos-bounties/BeeAR/raw/master/docs/videos/beear-3d-tryon.mp4

BeeAR 3D try-on video poster

Click the poster or open docs/videos/beear-3d-tryon.mp4

Rebuild the video after asset changes:

python scripts\render_3d_demo_video.py

Monorepo packages

Package Path Role
@beear/tryon packages/tryon-js Shared JS try-on lib (fit, overlay) for web + Android WebView
BeeAR Server packages/server Catalog API, try-on helpers, FastAPI, CLI (beear)
BeeAR Web packages/web Browser host + 3D Studio
BeeAR Desktop packages/desktop Electron shell wrapping the web app
beear-webview packages/android/beear-webview Android library (AAR) — reusable WebView try-on
BeeAR Android app packages/android/app Demo host embedding the AAR
Catalog packages/catalog SVG + GLB frames + person models

Primary offline path: server (beear demo · beear serve).


Libraries (web + Android)

BeeAR try-on ships as reusable libraries — download prebuilt artifacts from GitHub Releases:

libs-v0.4.0

Lib Artifact Consumers
@beear/tryon (npm) beear-tryon-0.4.0.min.js · full JS · npm tgz Web host, Android WebView, desktop
com.beear:beear-webview (AAR) beear-webview-0.4.0.aar · POM Any Android app embedding try-on

Web install

<script src="https://github.com/mergeos-bounties/BeeAR/releases/download/libs-v0.4.0/beear-tryon-0.4.0.js"></script>
<script>
  console.log(BeeARTryOn.VERSION); // 0.4.0
</script>
# npm install from GitHub Release tarball (no npmjs login required)
npm install https://github.com/mergeos-bounties/BeeAR/releases/download/libs-v0.4.0/beear-tryon-0.4.0.tgz
# after public registry publish:  npm install @beear/tryon

Android install (AAR library)

// app/libs/beear-webview-0.4.0.aar
implementation(files("libs/beear-webview-0.4.0.aar"))

val view = BeeARWebView(this)
view.attach(this, BeeARConfig.loopback()) // or BeeARConfig.offlineAssets()
view.loadTryOn()

Build from source

cd packages/tryon-js && npm test && npm run build

node packages/android/scripts/sync-web-assets.mjs
cd packages/android && ./gradlew :beear-webview:assembleRelease

node scripts/release-libs.mjs
node scripts/release-libs.mjs --publish
# optional:  --npm  (needs NPM_TOKEN for registry.npmjs.org)
# optional:  --npm-github --maven  (needs GITHUB_TOKEN with write:packages)

Docs: packages/tryon-js/README.md · packages/android/README.md


Highlights

Capability Description
3D person Low-poly person_bust.glb with face anchor for glasses
GLB glasses Multiple styles (aviator, wayfarer, round, cat-eye, sport, …)
3D Studio Orbit / zoom / auto-rotate try-on at /studio3d.html
Frame catalog Glasses + accessories with SVG + GLB
PD fit Pupil distance (mm) + landmark box
Compare Side-by-side frame metrics
Offline demo Catalog + fit + compare without a camera
Clients Web, desktop, Android over shared libs

Screenshots

3D studio

3D person 3D studio angle
Person + aviator GLB Alternate orbit

2D / camera try-on

Aviator Wayfarer
Aviator on demo face Wayfarer Black
Cat-eye Sport PD
Cat-eye Rose Sport · PD 70
Compare VI UI
Compare frames VI UI

Quick start (server)

cd packages\server
python -m venv .venv
.\.venv\Scripts\activate
pip install -e ".[dev]"

beear version
beear demo
beear catalog list
beear tryon fit aviator_gold --pd 64
beear serve --port 8860

Then open:


CLI reference

Command Purpose
beear version Package version (0.4.0)
beear demo Catalog + PD fit + compare + 3D person/GLB smoke
beear catalog list [-c category] List frames
beear catalog show <id> Frame detail
beear catalog search <q> Search frames
beear tryon fit <id> --pd 64 Fit estimate
beear tryon compare <a> <b> Compare two frames
beear serve FastAPI + web + studio3d

Catalog, fit & 3D assets

  • Frames: id, name, category, style, price, SVG, optional GLB.
  • Person models: listed under person_models in packages/catalog/frames.json.
  • Fit uses PD (mm) and landmark box (synthetic when offline).
  • API: GET /api/catalog, GET /api/catalog/meta, GET /catalog/glb/{file}.
beear catalog list -c glasses
beear tryon compare aviator_gold wayfarer_black --pd 64
python packages\catalog\scripts\generate_3d_assets.py

Diagrams

System architecture and workflow — full width. Open the HTML files for dark/light theme and export (PNG/SVG).

Architecture

Open interactive diagram

BeeAR architecture

Workflow

Open interactive diagram

BeeAR workflow

Generated with archify.


Repository layout

packages/
  catalog/
    glb/              # person_bust + glasses meshes
    svg/              # 2D frame icons
    frames.json       # catalog + person_models
    scripts/generate_3d_assets.py
  server/src/beear/   # CLI, API, catalog, tryon
  web/
    index.html        # camera / demo face try-on
    studio3d.html     # 3D person + GLB studio
    assets/
  tryon-js/ desktop/ android/
docs/
  videos/beear-3d-tryon.mp4
  screenshots/
  diagrams/
scripts/render_3d_demo_video.py

Privacy

  • Prefer synthetic / consented demo faces in docs and CI.
  • Do not commit real user camera captures without consent.
  • Camera video stays in the browser; it is not uploaded by the default server.
  • See docs/PRIVACY.md.

Development

cd packages\server
pytest -q
ruff check src tests
beear demo

# assets + docs media
python ..\..\packages\catalog\scripts\generate_3d_assets.py
python ..\..\scripts\render_3d_demo_video.py

Android

Demo app and AAR library live under packages/android/.
See packages/android/README.md for Gradle sync, camera consent, and WebView loopback.


MergeOS bounties

Star → claim a bounty issue → PR to master → MRG 25–200.
See mergeos and docs/BOUNTY.md.


License

MIT

About

BeeAR — virtual try-on for glasses and accessories (web + Windows + Android)

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages