3DMMDepthFitting
Efficient 3D Morphable Model Face Fitting using Depth Sensing Technologies
Install / Use
/learn @grigala/3DMMDepthFittingREADME
Efficient 3D Morphable Model Face Fitting Using Depth Sensing Technologies
This is the root directory for the project we've implemented as part of my MSc work. It performs a 3D Morphable Model face fitting and as a result produces a dense 3D face reconstructions based on a single image and the depth information obtained from the camera.
Read the thesis here.
Abstract
Human face analysis is an important branch of Computer Vision. One of the interesting topics in this area of research is the analysis of a human face based on a single image. The complexity of this problem is rather high due to restricted information that is available in a single image. Especially challenging is a task of the 3D shape reconstruction of the face based on a single image. The reconstruction process has little information to reliably recover the shape information (depth), which is the third dimension that is completely missing from an image. Using a single image does not always produce an accurate 3D reconstruction, especially in settings where lighting conditions cannot be controlled.
This thesis aims to build an efficient and stable system, which adds, in addition to a photo of a face, also a 3D depth information to the reconstruction process. By incorporating a 3D depth information into this process, we aim to improve the overall quality of the final shape reconstruction, as well as, the visual appearance of the reconstructed face. We build the complete fitting pipeline that consists of separate modules dealing with data acquisition, shape reconstruction, and analysis of color and illumination. We show that including the complete 3D depth information into the framework in the form of a point cloud indeed improves the final reconstruction quality.
To obtain a 3D depth information alongside the other input requirements, we use an affordable consumer depth camera technology offered by Intel® RealSense™ platform. The pipeline is flexible enough that it can be seamlessly integrated into the existing demo-framework (the face-fitting web service) for various use-cases. The applications of this work include but not limited to Photo-realistic Face Manipulation, 3D face modelling and analysis.
Project contains two language specific modules Python server and the Scala client. The server handles all the camera related operations, including configuration, data acquisition and delivery for fitting pipeline.
If you do not have a dedicated camera, FitScriptOffline.scala is your starting point.
Otherwise, first you should run Server.py and then FitScriptOnline.scala
Note: You cannot run the code without having Basel Face Model (BFM) in
/datadirectory inside the Scala project root. You can obtain a copy of BFM from this website. You then have to augment the model with an additional chin landmarks which are stored in landmarks.txt file, using the script AugmentModel.scala.
DEMO:

Technology Stack & Credits
This work would not have been possible without the following Open Source projects:
Server-side:
Client-side:
- JDK 1.8
- Scala
- SBT
- Finagle
- Scrooge
- Scalismo
- Scalismo-faces
- Scalismo-ui
- Scalismo Tutorials
- Probabilistic Fitting
Copyright and License
The code is distributed under GNU General Public License v3.0, refer to LICENSE for more details.
© Giorgi Grigalashvili as part of my MSc Thesis at University of Basel, Graphics and Vision Research Group, 2019.
References
Refer to the last pages of the thesis.
Related Skills
claude-opus-4-5-migration
110.6kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
351.2kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
TrendRadar
51.1k⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。
mcp-for-beginners
15.8kThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
