triposr
Model Overview
A transformer-based model designed for rapid 3D object reconstruction from a single RGB image, capable of generating high-quality 3D meshes in under 0.5 seconds on an NVIDIA A100 GPU.
Setup your API Key
If you don’t have an API key for the Apilaplas API yet, feel free to use our Quickstart guide.
Submit a request
API Schema
post
Authorizations
Body
modelundefined · enumRequiredPossible values:
image_urlstring · uriRequired
output_formatstring · enumOptionalDefault:
glb
Possible values: do_remove_backgroundbooleanOptional
foreground_rationumber · max: 1OptionalDefault:
0.9
mc_resolutionintegerOptionalDefault:
256
Responses
201Success
post
POST /v1/images/generations HTTP/1.1
Host: api.apilaplas.com
Authorization: Bearer <YOUR_LAPLASAPI_KEY>
Content-Type: application/json
Accept: */*
Content-Length: 146
{
"model": "triposr",
"image_url": "https://example.com",
"output_format": "glb",
"do_remove_background": true,
"foreground_ratio": 0.9,
"mc_resolution": 256
}
201Success
No content
Example
import requests
def main():
response = requests.post(
"https://api.apilaplas.com/v1/images/generations",
headers={
# Insert your LAPLAS API Key instead of <YOUR_LAPLASAPI_KEY>:
"Authorization": "Bearer <YOUR_LAPLASAPI_KEY>",
"Content-Type": "application/json",
},
json={
"model": "triposr",
"image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/22/Fly_Agaric_mushroom_05.jpg/576px-Fly_Agaric_mushroom_05.jpg",
},
)
response.raise_for_status()
data = response.json()
url = data["model_mesh"]["url"]
file_name = data["model_mesh"]["file_name"]
mesh_response = requests.get(url, stream=True)
with open(file_name, "wb") as file:
for chunk in mesh_response.iter_content(chunk_size=8192):
file.write(chunk)
if __name__ == "__main__":
main()
Response:
The example returns a textured 3D mesh in GLB file format. You can view it here.
For clarity, we took several screenshots of our mushroom from different angles in an online GLB viewer. As you can see, the model understands the shape, but preserving the pattern on the back side (which was not visible on the reference image) could be improved:
Compare them with the reference image:
Last updated