A RESTful API for Microsoft's TRELLIS, enabling seamless evaluation of machine learning model robustness. This project simplifies TRELLIS’s powerful tools into an accessible interface for researchers and developers.
- Upload and process images for 3D model generation.
- Evaluate robustness against various perturbations.
- Retrieve detailed metrics and visualizations.
- Enable seamless integration into automated workflows.
- Python 3.8+
- Docker (optional, for containerized deployment)
- Pipenv or pip for dependency management
- Operating System: Ubuntu 22.04.5 LTS (WSL2)
- Python Version: 3.10.12
-
Stop and remove any existing container:
docker stop trellis-service-client docker rm trellis-service-client
-
Build the Docker image and run it:
docker build -t trellis-processor . docker run -d --gpus all -p 5000:5000 \ -v "/mnt/d/Code/trellis_service/output:/workspace/TRELLIS/output:rw" \ --name trellis-service-client trellis-processor docker logs -f trellis-service-client
If you prefer to avoid building the Docker image, you can use the pre-built image from Docker Hub:
docker pull plenost/trellis-processor docker run -d --gpus all -p 5000:5000 \ -v "/mnt/d/Code/trellis_service/output:/workspace/TRELLIS/output:rw" \ --name trellis-service-client plenost/trellis-processor docker logs -f trellis-service-client
The API will be available at http://localhost:5000
.
Open a new bash
-
Initialize the models (download the weights):
curl -v -X POST http://localhost:5000/initialize
-
Process an image (outputs 3 MP4 and 1 GLB files):
curl -v -X POST -F "image=@input/cherry.webp" http://localhost:5000/process
- POST
/initialize
- Initialize the TRELLIS processing pipeline.
- POST
/process
- Upload an image for processing and retrieve 3D outputs (Gaussian, radiance field, mesh, and GLB files).
curl -X POST http://localhost:5000/initialize
curl -X POST -F 'image=@path/to/image.png' http://localhost:5000/process
Handles the initialization of the TRELLIS pipeline, loading pre-trained models and ensuring resources are ready for processing.
Processes images using the TRELLIS pipeline, generating outputs like Gaussian videos, radiance fields, and 3D meshes.
Implements the Flask API with endpoints for initialization and image processing. Logs all actions and provides detailed error handling.
- Fork the repository.
- Create a new branch:
git checkout -b feature-branch
- Commit your changes:
git commit -m "Add new feature"
- Push to your branch:
git push origin feature-branch
- Open a pull request.
This project is licensed under the MIT License.
Special thanks to Microsoft for developing TRELLIS.
Feel free to contribute or open issues to improve this project!