GithubHelp home page GithubHelp logo

shudali / csm-ai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from commonsensemachines/csm-ai

0.0 0.0 0.0 259 KB

The official Python library for the CSM API

Home Page: https://python-docs.csm.ai/

License: Apache License 2.0

Python 100.00%

csm-ai's Introduction

CSM Python API Library

Installation

# from PyPI
pip install csm-ai

# from source
pip install git+https://github.com/CommonSenseMachines/csm-ai.git

Usage

Initialize the API client:

from csm import CSMClient

# NOTE: replace with a valid API key
csm_client = CSMClient(api_key='6bCfF4467bXXXXXX4E6B271BeC5')

Run an image-to-3d job:

# a) using a local image path
image_path = "/path/to/image.png"

mesh_path = csm_client.image_to_3d(image_path, mesh_format='glb')

# b) using an image URL
image_url = "https://upload.wikimedia.org/wikipedia/en/a/a9/MarioNSMBUDeluxe.png"

mesh_path = csm_client.image_to_3d(image_url, mesh_format='obj')

Run a text-to-3d job:

prompt = "3d asset of a character head, cartoon style, low poly, front view"

mesh_path, image_path = csm_client.text_to_3d(prompt, mesh_format='glb')

Mesh formats: Choose any of ['obj', 'glb', 'usdz'] for the mesh_format argument.

Verbose mode: Run client functions with option verbose=True (the default) to see additional status messages and logs.

csm-ai's People

Contributors

rfeinman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.