How mikkelmiksen/python-server-part works
This repository provides single-image 3D reconstruction using TripoSR, through both a FastAPI service and a standalone script. A client uploads an image; the service decodes it, calls shared helpers to preprocess it and generate a mesh, then returns binary GLB. The helpers also load and warm the model at startup. The script runs a similar reconstruction path and writes an OBJ file. The TripoSR implementation is present as a submodule directory, but its source was not sampled; connections to it are limited to calls visible in the provided files.
Main entry points: main.py Standalone runner · server.py FastAPI service · triposr_helpers.py Model lifecycle · TripoSR TripoSR engine
Components 9
Entry points
- FastAPI service
server.py - Standalone runner
main.py
Reconstruction
- Model lifecycle
triposr_helpers.py - Image preprocessing
triposr_helpers.py - TripoSR engine
TripoSR - Background removal
Mesh outputs
- GLB response
- OBJ mesh file
output/0/mesh.obj
Other components
- API client
Connections 9
- API client → FastAPI service: uploads image
server.py - FastAPI service → Model lifecycle: loads and invokes
server.py - Model lifecycle → Image preprocessing: preprocesses image
triposr_helpers.py - Image preprocessing → Background removal: removes background
triposr_helpers.py - Model lifecycle → TripoSR engine: loads and runs
triposr_helpers.py - FastAPI service → GLB response: serializes and returns
server.py - Standalone runner → Image preprocessing: processes image
main.py - Standalone runner → TripoSR engine: loads and runs
main.py - Standalone runner → OBJ mesh file: exports mesh
main.py