> For the complete documentation index, see [llms.txt](https://docs.clore.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.clore.ai/guides/guides_v2-hi/3d/triposr.md).

# TripoSR

Clore.ai पर TripoSR के साथ एकल छवियों से 3D मॉडल जनरेट करें

एक सेकंड से भी कम समय में एकल छवियों से 3D मॉडल बनाएं।

{% hint style="success" %}
सभी उदाहरण GPU सर्वरों पर चलाए जा सकते हैं, जिन्हें किराए पर लिया गया है [CLORE.AI मार्केटप्लेस](https://clore.ai/marketplace).
{% endhint %}

## CLORE.AI पर किराए पर लेना

1. विज़िट करें [CLORE.AI मार्केटप्लेस](https://clore.ai/marketplace)
2. GPU प्रकार, VRAM और कीमत के अनुसार फ़िल्टर करें
3. चुनें **ऑन-डिमांड** (स्थिर दर) या **स्पॉट** (बोली मूल्य)
4. अपना ऑर्डर कॉन्फ़िगर करें:
   * Docker इमेज चुनें
   * पोर्ट सेट करें (SSH के लिए TCP, वेब UI के लिए HTTP)
   * यदि आवश्यक हो तो environment variables जोड़ें
   * स्टार्टअप कमांड दर्ज करें
5. भुगतान चुनें: **CLORE**, **BTC**या **USDT/USDC**
6. ऑर्डर बनाएं और डिप्लॉयमेंट की प्रतीक्षा करें

### अपने सर्वर तक पहुँचें

* कनेक्शन विवरण यहाँ खोजें **मेरे ऑर्डर**
* वेब इंटरफ़ेस: HTTP पोर्ट URL का उपयोग करें
* SSH: `ssh -p <port> root@<proxy-address>`

## TripoSR क्या है?

Stability AI और Tripo AI का TripoSR सक्षम करता है:

* एकल छवि से 3D मेश निर्माण
* एक सेकंड से कम अनुमान गति
* उच्च-गुणवत्ता वाले टेक्सचर्ड मेश
* OBJ, GLB और अन्य प्रारूपों में निर्यात करें

## संसाधन

* **GitHub:** [VAST-AI-Research/TripoSR](https://github.com/VAST-AI-Research/TripoSR)
* **HuggingFace:** [stabilityai/TripoSR](https://huggingface.co/stabilityai/TripoSR)
* **पेपर:** [TripoSR पेपर](https://arxiv.org/abs/2403.02151)
* **डेमो:** [HuggingFace Space](https://huggingface.co/spaces/stabilityai/TripoSR)

## अनुशंसित हार्डवेयर

| घटक     | न्यूनतम       | अनुशंसित      | इष्टतम        |
| ------- | ------------- | ------------- | ------------- |
| GPU     | RTX 3060 12GB | RTX 4080 16GB | RTX 4090 24GB |
| VRAM    | 8GB           | 12GB          | 16GB          |
| CPU     | 4 कोर         | 8 कोर         | 16 कोर        |
| RAM     | 16GB          | 32GB          | 64GB          |
| स्टोरेज | 20GB SSD      | 50GB NVMe     | 100GB NVMe    |
| इंटरनेट | 100 Mbps      | 500 Mbps      | 1 Gbps        |

## CLORE.AI पर त्वरित परिनियोजन

**Docker इमेज:**

```
pytorch/pytorch:2.11.0-cuda12.8-cudnn9-devel
```

**पोर्ट:**

```
22/tcp
7860/http
```

**कमांड:**

```bash
cd /workspace && \
git clone https://github.com/VAST-AI-Research/TripoSR.git && \\
cd TripoSR && \\
pip install -r requirements.txt && \
python gradio_app.py
```

## अपनी सेवा तक पहुँचना

डिप्लॉयमेंट के बाद, अपना `http_pub` URL यहाँ **मेरे ऑर्डर**:

1. पर जाएँ **मेरे ऑर्डर** पेज
2. अपने ऑर्डर पर क्लिक करें
3. खोजें `http_pub` URL (उदा., `abc123.clorecloud.net`)

उपयोग करें `https://YOUR_HTTP_PUB_URL` की बजाय `localhost` नीचे दिए गए उदाहरणों में।

## इंस्टॉलेशन

```bash
git clone https://github.com/VAST-AI-Research/TripoSR.git
cd TripoSR
pip install -r requirements.txt

# मॉडल पहली बार चलाने पर अपने आप डाउनलोड हो जाता है
```

## आप क्या बना सकते हैं

### गेमिंग और VR

* कॉन्सेप्ट आर्ट को 3D एसेट्स में बदलें
* गेम ऑब्जेक्ट्स के लिए त्वरित प्रोटोटाइपिंग
* कैरेक्टर मॉडल निर्माण
* पर्यावरणीय प्रॉप्स

### ई-कॉमर्स

* उत्पाद 3D विज़ुअलाइज़ेशन
* AR ट्राई-ऑन अनुभव
* 360-डिग्री उत्पाद दृश्य
* वर्चुअल शोरूम

### आर्किटेक्चर

* स्केच से त्वरित 3D मॉडल
* इंटीरियर डिज़ाइन विज़ुअलाइज़ेशन
* फर्नीचर प्रोटोटाइप
* भवन तत्व निर्माण

### शिक्षा

* सीखने की सामग्री के लिए 3D मॉडल
* वैज्ञानिक विज़ुअलाइज़ेशन
* ऐतिहासिक कलाकृति पुनर्निर्माण
* शारीरिक रचना मॉडल

### रचनात्मक प्रोजेक्ट

* डिजिटल कला और NFT
* एनीमेशन एसेट्स
* 3D प्रिंटिंग तैयारी
* मीम और अवतार निर्माण

## मूल उपयोग

### कमांड लाइन

```bash
python run.py input_image.png \\
    --output-dir output/ \\
    --render
```

### Python API

```python
import torch
from PIL import Image
from tsr.system import TSR
from tsr.utils import remove_background, save_video

# मॉडल लोड करें
model = TSR.from_pretrained(
    "stabilityai/TripoSR",
    config_name="config.yaml",
    weight_name="model.ckpt"
)
model.to("cuda")

# छवि लोड और पूर्व-प्रसंस्करण करें
image = Image.open("input.png")

# 3D मेश जनरेट करें
with torch.no_grad():
    scene_codes = model([image], device="cuda")

# मेश निकालें
meshes = model.extract_mesh(scene_codes)

# मेश सहेजें
meshes[0].export("output.obj")
```

### पृष्ठभूमि हटाने के साथ

```python
from tsr.system import TSR
from tsr.utils import remove_background
from PIL import Image

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

# छवि लोड करें और पृष्ठभूमि हटाएं
image = Image.open("photo.jpg")
image_no_bg = remove_background(image)

# 3D जनरेट करें
with torch.no_grad():
    scene_codes = model([image_no_bg], device="cuda")

mesh = model.extract_mesh(scene_codes)[0]
mesh.export("model.glb")  # वेब के लिए GLB के रूप में निर्यात करें
```

## बैच प्रोसेसिंग

```python
import os
from PIL import Image
import torch
from tsr.system import TSR
from tsr.utils import remove_background

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

input_dir = "./images"
output_dir = "./3d_models"
os.makedirs(output_dir, exist_ok=True)

images_to_process = []
filenames = []

for filename in os.listdir(input_dir):
    if not filename.endswith(('.jpg', '.png')):
        continue

    image = Image.open(os.path.join(input_dir, filename))
    image_no_bg = remove_background(image)
    images_to_process.append(image_no_bg)
    filenames.append(filename)

# बैचों में प्रोसेस करें
batch_size = 4
for i in range(0, len(images_to_process), batch_size):
    batch = images_to_process[i:i+batch_size]
    batch_names = filenames[i:i+batch_size]

    with torch.no_grad():
        scene_codes = model(batch, device="cuda")

    meshes = model.extract_mesh(scene_codes)

    for mesh, name in zip(meshes, batch_names):
        output_name = name.rsplit('.', 1)[0] + '.obj'
        mesh.export(os.path.join(output_dir, output_name))
        print(f"Generated: {output_name}")
```

## निर्यात प्रारूप

```python
from tsr.system import TSR
from PIL import Image

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

image = Image.open("input.png")

with torch.no_grad():
    scene_codes = model([image], device="cuda")

mesh = model.extract_mesh(scene_codes)[0]

# विभिन्न निर्यात प्रारूप
mesh.export("model.obj")   # Wavefront OBJ
mesh.export("model.glb")   # GLTF बाइनरी (वेब-तैयार)
mesh.export("model.ply")   # PLY प्रारूप
mesh.export("model.stl")   # STL (3D प्रिंटिंग)
```

## पूर्वावलोकन वीडियो रेंडर करें

```python
from tsr.system import TSR
from tsr.utils import save_video
from PIL import Image
import torch

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

image = Image.open("input.png")

with torch.no_grad():
    scene_codes = model([image], device="cuda")

# 360-डिग्री वीडियो रेंडर करें
render_images = model.render(
    scene_codes,
    n_views=30,
    return_type="pil"
)

save_video(render_images[0], "preview.mp4", fps=30)
```

## Gradio इंटरफ़ेस

```python
import gradio as gr
import torch
from PIL import Image
from tsr.system import TSR
from tsr.utils import remove_background
import tempfile

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

def generate_3d(image, remove_bg, output_format):
    if remove_bg:
        image = remove_background(image)

    with torch.no_grad():
        scene_codes = model([image], device="cuda")

    mesh = model.extract_mesh(scene_codes)[0]

    with tempfile.NamedTemporaryFile(suffix=f".{output_format}", delete=False) as f:
        mesh.export(f.name)
        return f.name, image

demo = gr.Interface(
    fn=generate_3d,
    inputs=[
        gr.Image(type="pil", label="Input Image"),
        gr.Checkbox(label="पृष्ठभूमि हटाएं", value=True),
        gr.Dropdown(choices=["obj", "glb", "ply", "stl"], value="glb", label="आउटपुट प्रारूप")
    ],
    outputs=[
        gr.File(label="3D मॉडल"),
        gr.Image(label="प्रसंस्कृत इनपुट")
    ],
    title="TripoSR - छवि से 3D",
    description="कुछ ही सेकंड में एकल छवियों से 3D मॉडल बनाएं। CLORE.AI GPU सर्वरों पर चल रहा है।"
)

demo.launch(server_name="0.0.0.0", server_port=7860)
```

## मेश परिशोधन के साथ

```python
from tsr.system import TSR
from PIL import Image
import torch

model = TSR.from_pretrained("stabilityai/TripoSR")
model.to("cuda")

image = Image.open("input.png")

with torch.no_grad():
    scene_codes = model([image], device="cuda")

# उच्च रिज़ॉल्यूशन पर निकालें
mesh = model.extract_mesh(
    scene_codes,
    resolution=256  # अधिक = अधिक विवरण, डिफ़ॉल्ट 128 है
)[0]

mesh.export("high_detail.obj")
```

## प्रदर्शन

| रिज़ॉल्यूशन    | GPU      | गति  | गुणवत्ता |
| -------------- | -------- | ---- | -------- |
| 128 (डिफ़ॉल्ट) | RTX 3090 | 0.5s | अच्छा    |
| 128            | RTX 4090 | 0.3s | अच्छा    |
| 256            | RTX 4090 | 1.2s | बेहतर    |
| 256            | A100     | 0.8s | बेहतर    |

## सामान्य समस्याएँ और समाधान

### खराब 3D गुणवत्ता

**समस्या:** जनरेट किया गया मेश गलत या विकृत दिखता है

**समाधान:**

* स्पष्ट विषय और सरल पृष्ठभूमि वाली छवियों का उपयोग करें
* प्रसंस्करण से पहले पृष्ठभूमि हटाएं
* वस्तु का सामने से लिया गया दृश्य उपयोग करें
* स्रोत छवि में अच्छी रोशनी सुनिश्चित करें

```python

# सर्वोत्तम परिणामों के लिए हमेशा पृष्ठभूमि हटाएं
from tsr.utils import remove_background

image = Image.open("photo.jpg")
clean_image = remove_background(image)
```

### पृष्ठभूमि हटाना विफल

**समस्या:** पृष्ठभूमि हटाने के बाद आर्टिफैक्ट्स रह जाते हैं

**समाधान:**

* rembg जैसे समर्पित टूल से पूर्व-प्रसंस्करण करें
* छवि की पृष्ठभूमि को मैन्युअल रूप से संपादित करें
* सरल पृष्ठभूमि वाली छवियों का उपयोग करें

```bash
pip install rembg
```

```python
from rembg import remove
from PIL import Image

image = Image.open("photo.jpg")
image_no_bg = remove(image)
image_no_bg.save("clean.png")
```

### मेमोरी समाप्त

**समस्या:** उच्च रिज़ॉल्यूशन पर CUDA OOM

**समाधान:**

```python

# कम रिज़ॉल्यूशन का उपयोग करें
mesh = model.extract_mesh(scene_codes, resolution=128)

# या बैचों के बीच कैश साफ़ करें
import torch
torch.cuda.empty_cache()
```

### मेश में छेद हैं

**समस्या:** जनरेट किए गए मेश में कुछ हिस्से गायब हैं

**समाधान:**

* उच्च रिज़ॉल्यूशन निष्कर्षण का उपयोग करें
* विषय को अलग देखने के कोण से आज़माएं
* Blender या MeshLab में मेश का पोस्ट-प्रोसेस करें
* वस्तु पूरी तरह दिखाई देने वाली छवियों का उपयोग करें

### धीमी प्रोसेसिंग

**समस्या:** प्रति छवि बहुत समय लगता है

**समाधान:**

* कई छवियों के लिए बैच प्रोसेसिंग का उपयोग करें
* प्रोटोटाइपिंग के लिए कम रिज़ॉल्यूशन उपयोग करें
* RTX 4090 या A100 GPU का उपयोग करें

## समस्या निवारण

### 3D मेश गुणवत्ता खराब है

* स्पष्ट वस्तु सीमाओं वाली छवियों का उपयोग करें
* पृष्ठभूमि हटाएं या मास्क करें
* सामने से लिए गए दृश्य सबसे अच्छे काम करते हैं

### निर्यात विफल होता है

* जांचें कि आउटपुट निर्देशिका मौजूद है
* सुनिश्चित करें कि मेश प्रारूप समर्थित है
* पर्याप्त डिस्क स्थान सुनिश्चित करें

### टेक्सचर गायब है

* कुछ निर्यातों में टेक्सचर शामिल नहीं होता
* टेक्सचर्ड आउटपुट के लिए GLB प्रारूप का उपयोग करें
* मटेरियल निर्यात सेटिंग्स जांचें

{% hint style="danger" %}
**मेमोरी समाप्त**
{% endhint %}

* TripoSR कुशल है, लेकिन 6GB+ की आवश्यकता होती है
* आउटपुट रिज़ॉल्यूशन कम करें
* एक समय में एक छवि प्रोसेस करें

## लागत का अनुमान

CLORE.AI मार्केटप्लेस की सामान्य दरें (2024 तक):

| GPU       | प्रति घंटा दर | प्रति दिन दर | 4-घंटे का सत्र |
| --------- | ------------- | ------------ | -------------- |
| RTX 3060  | \~$0.03       | \~$0.70      | \~$0.12        |
| RTX 3090  | \~$0.06       | \~$1.50      | \~$0.25        |
| RTX 4090  | \~$0.10       | \~$2.30      | \~$0.40        |
| A100 40GB | \~$0.17       | \~$4.00      | \~$0.70        |
| A100 80GB | \~$0.25       | \~$6.00      | \~$1.00        |

*मूल्य प्रदाता और मांग के अनुसार बदलते हैं। देखें* [*CLORE.AI मार्केटप्लेस*](https://clore.ai/marketplace) *वर्तमान दरों के लिए।*

**पैसे बचाएँ:**

* का उपयोग करें **स्पॉट** बाधित किए जा सकने वाले कार्य के लिए मार्केट — लगभग एक-तिहाई सर्वरों की स्पॉट कीमत ऑन-डिमांड से कम होती है (मध्य \~13% छूट), बाकी उससे मेल खाते हैं
* से भुगतान करें **CLORE** टोकन
* विभिन्न प्रदाताओं के बीच कीमतों की तुलना करें

## अगले चरण

* Stable Diffusion - इनपुट छवियाँ जनरेट करें
* [IC-Light](/guides/guides_v2-hi/image-processing/iclight.md) - 3D से पहले छवियों को रीलाइट करें
* ComfyUI - वर्कफ़्लो एकीकरण


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.clore.ai/guides/guides_v2-hi/3d/triposr.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
