Skip to content

Commit 41c7b87

Browse files
committed
Add files
0 parents  commit 41c7b87

597 files changed

Lines changed: 272805 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Build outputs and generated data.
2+
outputs/
3+
export_logs/
4+
5+
# Data directories (mounted at runtime).
6+
data/
7+
external/checkpoints/
8+
9+
# Virtual environments.
10+
.venv/
11+
.mujoco_venv/
12+
13+
# Python caches.
14+
__pycache__/
15+
*.pyc
16+
*.pyo
17+
*.egg-info/
18+
19+
# Git.
20+
.git/
21+
22+
# Archives.
23+
*.zip
24+
25+
# Test caches.
26+
.testmondata*
27+
.pytest_cache/
28+
29+
# IDE and editor files.
30+
.serena/
31+
.idea/
32+
.vscode/
33+
*.swp
34+
*.swo
35+
36+
# Docker.
37+
Dockerfile
38+
docker-compose.yaml
39+
.dockerignore
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Integration Test
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
# Get environment variables.
18+
env:
19+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
20+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
version: "0.7.8"
30+
enable-cache: true
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version-file: ".python-version"
36+
37+
- name: Install system dependencies for rendering
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y xvfb libegl1
41+
42+
- name: Install dependencies
43+
run: uv sync
44+
45+
- name: Restore testmon cache
46+
id: cache-testmon-restore
47+
uses: actions/cache/restore@v4
48+
with:
49+
path: |
50+
.testmondata
51+
.testmondata-shm
52+
.testmondata-wal
53+
key: testmon-integration-${{ runner.os }}-${{ github.sha }}
54+
restore-keys: |
55+
testmon-integration-${{ runner.os }}-
56+
57+
- name: Run integration tests
58+
timeout-minutes: 30
59+
run: uv run pytest tests/integration/ --testmon -x
60+
61+
- name: Save testmon cache
62+
uses: actions/cache/save@v4
63+
if: >-
64+
(success() || failure()) &&
65+
steps.cache-testmon-restore.outputs.cache-hit != 'true'
66+
with:
67+
path: |
68+
.testmondata
69+
.testmondata-shm
70+
.testmondata-wal
71+
key: ${{ steps.cache-testmon-restore.outputs.cache-primary-key }}

.github/workflows/lint.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v6
21+
with:
22+
version: "0.7.8"
23+
enable-cache: true
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version-file: ".python-version"
29+
30+
- name: black
31+
uses: psf/black@stable
32+
with:
33+
version: 25.1.0
34+
jupyter: true
35+
36+
- name: isort
37+
uses: isort/isort-action@master
38+
with:
39+
configuration: "--settings-path=pyproject.toml --check-only --diff"
40+
isort-version: 5.12.0
41+
42+
- name: autoflake
43+
uses: creyD/autoflake_action@master
44+
with:
45+
options: --remove-all-unused-imports --in-place

.github/workflows/unit_test.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Unit Test
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
- synchronize
9+
push:
10+
branches:
11+
- main
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
17+
# Get environment variables.
18+
env:
19+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
20+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Install uv
27+
uses: astral-sh/setup-uv@v6
28+
with:
29+
version: "0.7.8"
30+
enable-cache: true
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version-file: ".python-version"
36+
37+
- name: Install dependencies
38+
run: uv sync
39+
40+
- name: Restore testmon cache
41+
id: cache-testmon-restore
42+
uses: actions/cache/restore@v4
43+
with:
44+
path: |
45+
.testmondata
46+
.testmondata-shm
47+
.testmondata-wal
48+
key: testmon-unit-${{ runner.os }}-${{ github.sha }}
49+
restore-keys: |
50+
testmon-unit-${{ runner.os }}-
51+
52+
- name: Run unit tests
53+
run: uv run pytest tests/unit/ --testmon
54+
55+
- name: Save testmon cache
56+
uses: actions/cache/save@v4
57+
if: >-
58+
(success() || failure()) &&
59+
steps.cache-testmon-restore.outputs.cache-hit != 'true'
60+
with:
61+
path: |
62+
.testmondata
63+
.testmondata-shm
64+
.testmondata-wal
65+
key: ${{ steps.cache-testmon-restore.outputs.cache-primary-key }}

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.venv
2+
.mujoco_venv
3+
*.egg-info
4+
__pycache__
5+
outputs
6+
.serena
7+
debug_asset_gen
8+
debug_rendering
9+
debug_furniture_agent
10+
.testmondata*
11+
.pytest_cache/
12+
.vscode/
13+
.mcp.json

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "external/Hunyuan3D-2"]
2+
path = external/Hunyuan3D-2
3+
url = git@github.com:Tencent-Hunyuan/Hunyuan3D-2.git
4+
branch = main

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 25.1.0
4+
hooks:
5+
- id: black
6+
7+
- repo: https://github.com/pycqa/isort
8+
rev: 5.12.0
9+
hooks:
10+
- id: isort
11+
name: isort (python)
12+
13+
- repo: https://github.com/PyCQA/autoflake
14+
rev: v2.0.2
15+
hooks:
16+
- id: autoflake
17+
args: [--remove-all-unused-imports, --in-place]
18+
19+
- repo: https://github.com/astral-sh/uv-pre-commit
20+
rev: 0.7.8 # uv version
21+
hooks:
22+
- id: uv-lock

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

Dockerfile

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# Multi-stage Dockerfile for scenesmith.
2+
# Single-container setup: all servers (geometry generation, retrieval, blender,
3+
# etc.) are auto-managed by the pipeline inside the container.
4+
5+
# =============================================================================
6+
# Stage 1: Base system with Python 3.11 and system dependencies.
7+
# =============================================================================
8+
FROM nvidia/cuda:12.4.0-devel-ubuntu22.04 AS base
9+
10+
ENV DEBIAN_FRONTEND=noninteractive
11+
12+
# Install Python 3.11 via deadsnakes PPA and system packages.
13+
RUN apt-get update && apt-get install -y --no-install-recommends \
14+
software-properties-common \
15+
&& add-apt-repository ppa:deadsnakes/ppa \
16+
&& apt-get update && apt-get install -y --no-install-recommends \
17+
python3.11 \
18+
python3.11-dev \
19+
python3.11-venv \
20+
python3.11-distutils \
21+
libpython3.11-dev \
22+
git \
23+
git-lfs \
24+
wget \
25+
unzip \
26+
bubblewrap \
27+
cmake \
28+
build-essential \
29+
# X11/EGL libs for headless Blender rendering.
30+
libgl1 \
31+
libegl1 \
32+
libxrender1 \
33+
libxkbcommon0 \
34+
libsm6 \
35+
libxext6 \
36+
libxi6 \
37+
libxxf86vm1 \
38+
libglib2.0-0 \
39+
&& rm -rf /var/lib/apt/lists/*
40+
41+
# Set Python 3.11 as default.
42+
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \
43+
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
44+
45+
# Install uv package manager.
46+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
47+
48+
# Set environment variables.
49+
ENV CUDA_HOME=/usr/local/cuda-12.4
50+
ENV PATH="${CUDA_HOME}/bin:${PATH}"
51+
ENV LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}"
52+
ENV NVIDIA_VISIBLE_DEVICES=all
53+
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics
54+
55+
WORKDIR /app
56+
57+
# =============================================================================
58+
# Stage 2: Python dependencies.
59+
# =============================================================================
60+
FROM base AS deps
61+
62+
COPY pyproject.toml uv.lock .python-version README.md ./
63+
RUN uv sync --frozen --no-dev
64+
65+
# =============================================================================
66+
# Stage 3: SAM3D backend (optional but included in image).
67+
# =============================================================================
68+
FROM deps AS sam3d
69+
70+
COPY scripts/install_sam3d_docker.sh scripts/install_sam3d_docker.sh
71+
72+
# Disable uv project config to avoid hitting the Blender PyPI index
73+
# (from pyproject.toml) which rate-limits during Docker builds.
74+
# Set TORCH_CUDA_ARCH_LIST since no GPU is available during build.
75+
# Covers Ampere (A100, A10), Ada Lovelace (L40S, RTX 4090), Hopper (H100).
76+
RUN UV_NO_CONFIG=1 TORCH_CUDA_ARCH_LIST="8.0;8.6;8.9;9.0" \
77+
bash scripts/install_sam3d_docker.sh
78+
79+
# =============================================================================
80+
# Stage 4: Application code.
81+
# =============================================================================
82+
FROM sam3d AS app
83+
84+
# Copy full repo source.
85+
COPY . .
86+
87+
# Remove stale bytecode from earlier stages (SAM3D install imports
88+
# scenesmith, creating .pyc that would shadow updated .py files).
89+
RUN find /app/scenesmith -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null; true
90+
91+
# Activate the virtual environment by prepending it to PATH.
92+
ENV VIRTUAL_ENV=/app/.venv
93+
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
94+
ENV PYTHONPATH=/app
95+
ENV PYTHONUNBUFFERED=1
96+
97+
# Default command: print usage help.
98+
CMD ["python", "-c", \
99+
"print('scenesmith Docker container\\n')\n\
100+
print('Usage examples:\\n')\n\
101+
print(' # Smoke test')\n\
102+
print(' docker run --gpus all scenesmith python -c \"import torch; print(torch.cuda.is_available()); import scenesmith\"\\n')\n\
103+
print(' # Run unit tests')\n\
104+
print(' docker run --gpus all scenesmith pytest tests/unit/ -x\\n')\n\
105+
print(' # Run scene generation (requires data volumes and API keys)')\n\
106+
print(' docker compose up\\n')\n\
107+
print('See README.md for full documentation.')"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Nicholas Pfaff
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)