d3c83053f2
- CMakeLists.txt - app.md - appicon.ico - backend/ - main.cpp Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
72 lines
2.6 KiB
Markdown
72 lines
2.6 KiB
Markdown
---
|
|
name: image_to_3d_studio
|
|
lang: cpp
|
|
domain: gfx
|
|
description: "Image to 3D studio: imagen origen + POST a backend Python (TripoSR/Hunyuan3D/Trellis) y guarda mesh GLB."
|
|
tags: [imagegen, 3d, mesh, viewer, imgui]
|
|
icon:
|
|
phosphor: "cube-transparent"
|
|
accent: "#0ea5e9"
|
|
uses_functions:
|
|
- http_request_cpp_core # POST /generate al backend Python
|
|
- gl_texture_load_cpp_gfx # preview de la imagen origen en panel Input
|
|
- gltf_load_mesh_cpp_gfx # parse GLB -> Mesh CPU para el viewer 3D
|
|
- mesh_gpu_cpp_gfx # sube Mesh a GPU (VAO/VBO/EBO)
|
|
- mesh_viewer_cpp_viz # render orbit + FBO depth del mesh
|
|
- orbit_camera_cpp_core # camara orbital (drag rotar / wheel zoom)
|
|
- gl_framebuffer_cpp_gfx # FBO con depth para el render offscreen
|
|
uses_types: []
|
|
framework: "imgui"
|
|
entry_point: "main.cpp"
|
|
dir_path: "projects/imagegen/apps/image_to_3d_studio"
|
|
repo_url: "https://gitea.organic-machine.com/dataforge/image_to_3d_studio"
|
|
---
|
|
|
|
# image_to_3d_studio
|
|
|
|
UI ImGui que envia una imagen al backend Python (FastAPI) y guarda el
|
|
mesh GLB resultante en `local_files/cache/`. Despachador soporta varios
|
|
modelos image-to-3D detras del mismo endpoint:
|
|
|
|
- **TripoSR** (MIT, ~0.5 s, ~6 GB VRAM) — backend listo.
|
|
- **Hunyuan3D-2** (Tencent Community, mejor textura) — stub.
|
|
- **Trellis** (Microsoft MIT, mesh/3DGS/NeRF) — stub.
|
|
|
|
Viewer GLB integrado: panel **Viewer 3D** carga el mesh con `gltf_load_mesh`,
|
|
lo sube a GPU y lo renderiza con `mesh_viewer` (orbit camera + FBO con depth).
|
|
Drag = rotar, rueda = zoom, "Reset cam" recentra, checkbox wireframe. Auto-carga
|
|
el mesh al terminar Generate; tambien boton "View 3D" en el panel Output.
|
|
|
|
## Arquitectura
|
|
|
|
```
|
|
image_to_3d_studio (C++ ImGui)
|
|
── multipart POST /generate ──▶ backend FastAPI 127.0.0.1:8600
|
|
dispatcher → backends/<id>.py
|
|
◀── bytes GLB ──
|
|
guarda en <exe>/local_files/cache/<model>_<hash>.glb
|
|
```
|
|
|
|
## Build
|
|
|
|
```bash
|
|
cd cpp && cmake --build build --target image_to_3d_studio -j
|
|
```
|
|
|
|
## Run
|
|
|
|
```bash
|
|
# 1) backend Python (otra terminal)
|
|
projects/imagegen/apps/image_to_3d_studio/backend/run.sh
|
|
|
|
# 2) app C++
|
|
./cpp/build/image_to_3d_studio
|
|
```
|
|
|
|
## Estado
|
|
|
|
- Notebook `projects/imagegen/analysis/spike_image_to_3d/notebooks/01_panorama_image_to_3d.ipynb` — panorama + tabla comparativa.
|
|
- Notebook `02_smoke_triposr.ipynb` — smoke end-to-end.
|
|
- Backend `backend/server.py` — dispatcher, TripoSR funcional, Hunyuan3D-2 + Trellis = stubs `501 Not Implemented`.
|
|
- App C++ — Input/Models/Output paneles + POST + cache. Sin viewer GLB todavia.
|