├── .all-contributorsrc
├── .env.example
├── .github
└── workflows
│ ├── dockerhub.yml
│ ├── mkdocs.yml
│ ├── publish.yml
│ └── tests.yml
├── .gitignore
├── Dockerfile
├── MANIFEST.in
├── README.md
├── data
├── camera_data.json
├── datasets.json
├── object_data.json
└── stage_data.json
├── docs
├── assets
│ ├── DeepAI.png
│ ├── favicon.ico
│ ├── logo.png
│ └── simian_banner.png
├── backgrounds.md
├── batch_rendering.md
├── cameras.md
├── combiner.md
├── getting_started.md
├── index.md
├── object.md
├── postprocessing.md
├── rendering.md
├── scene.md
├── transform.md
└── worker.md
├── mkdocs.yml
├── requirements.txt
├── scripts
├── data
│ ├── get_data.sh
│ ├── get_objaverse_data.py
│ ├── get_polyhaven_background_data.py
│ └── get_polyhaven_texture_data.py
├── demo
│ └── demo.py
├── filter
│ ├── caption_combination_pairs.py
│ ├── combinations_add_placeholder.py
│ ├── combinations_to_captions.py
│ ├── combinations_to_motion_labels.py
│ ├── get_captions.py
│ ├── get_ontop_captions.py
│ ├── rewrite_captions_gem.py
│ ├── rewrite_captions_gpt.py
│ └── test_combinations.py
├── setup_redis.sh
└── start_x_server.py
├── setup.py
└── simian
├── __init__.py
├── background.py
├── batch.py
├── camera.py
├── combiner.py
├── distributed.py
├── object.py
├── postprocessing.py
├── prompts.py
├── render.py
├── scene.py
├── server.py
├── tests
├── __run__.py
├── background_test.py
├── batch_test.py
├── camera_test.py
├── combiner_test.py
├── new_camera_test.py
├── object_test.py
├── postprocessing_test.py
├── transform_test.py
└── worker_test.py
├── transform.py
├── vendor
├── __init__.py
└── objaverse.py
└── worker.py
/.all-contributorsrc:
--------------------------------------------------------------------------------
1 | {
2 | "files": [
3 | "README.md"
4 | ],
5 | "imageSize": 100,
6 | "commit": false,
7 | "commitType": "docs",
8 | "commitConvention": "angular",
9 | "contributors": [
10 | {
11 | "login": "eric-prog",
12 | "name": "Eric S",
13 | "avatar_url": "https://avatars.githubusercontent.com/u/59460685?v=4",
14 | "profile": "https://ericsheen.tech/",
15 | "contributions": [
16 | "infra",
17 | "code",
18 | "test",
19 | "doc"
20 | ]
21 | },
22 | {
23 | "login": "lalalune",
24 | "name": "M̵̞̗̝̼̅̏̎͝Ȯ̴̝̻̊̃̋̀Õ̷̼͋N̸̩̿͜ ̶̜̠̹̼̩͒",
25 | "avatar_url": "https://avatars.githubusercontent.com/u/18633264?v=4",
26 | "profile": "https://github.com/lalalune",
27 | "contributions": [
28 | "infra",
29 | "code",
30 | "test",
31 | "doc"
32 | ]
33 | }
34 | ],
35 | "contributorsPerLine": 7,
36 | "skipCi": true,
37 | "repoType": "github",
38 | "repoHost": "https://github.com",
39 | "projectName": "Simian",
40 | "projectOwner": "DeepAI Research"
41 | }
42 |
--------------------------------------------------------------------------------
/.env.example:
--------------------------------------------------------------------------------
1 | REDIS_HOST=redis-xxx.xxx.us-west-1-2.ec2.redns.redis-cloud.com
2 | REDIS_PORT=1337
3 | REDIS_USER=default
4 | REDIS_PASSWORD=NZxxxxxxxxxxxxxxxxxxxxxxxxxxxxxBD
5 | HF_TOKEN=hf_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxw
6 | HF_REPO_ID=org/repo
7 | HF_PATH=./
8 | VAST_API_KEY=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
9 | OPENAI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
10 | GOOGLE_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
--------------------------------------------------------------------------------
/.github/workflows/dockerhub.yml:
--------------------------------------------------------------------------------
1 | name: Publish Docker image
2 |
3 | on:
4 | release:
5 | types: [published]
6 |
7 | env:
8 | REGISTRY: index.docker.io
9 | IMAGE_NAME: arfx/simian-worker
10 |
11 | jobs:
12 | push_to_registry:
13 | name: Push Docker image to Docker Hub
14 | runs-on: ubuntu-latest
15 | permissions:
16 | packages: write
17 | contents: read
18 | attestations: write
19 | id-token: write
20 | steps:
21 | - name: Check out the repo
22 | uses: actions/checkout@v4
23 |
24 | - name: Log in to Docker Hub
25 | uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
26 | with:
27 | username: ${{ secrets.DOCKER_USERNAME }}
28 | password: ${{ secrets.DOCKER_PASSWORD }}
29 |
30 | - name: Extract metadata (tags, labels) for Docker
31 | id: meta
32 | uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
33 | with:
34 | images: ${{ env.IMAGE_NAME }}
35 |
36 | - name: Build and push Docker image
37 | id: push
38 | uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
39 | with:
40 | context: .
41 | file: ./Dockerfile
42 | push: true
43 | tags: ${{ steps.meta.outputs.tags }}
44 | labels: ${{ steps.meta.outputs.labels }}
45 |
46 |
47 | - name: Generate artifact attestation
48 | uses: actions/attest-build-provenance@v1
49 | with:
50 | subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
51 | subject-digest: ${{ steps.push.outputs.digest }}
52 | push-to-registry: true
53 |
54 |
--------------------------------------------------------------------------------
/.github/workflows/mkdocs.yml:
--------------------------------------------------------------------------------
1 | name: mkdocs
2 | on:
3 | push:
4 | branches:
5 | - main
6 | permissions:
7 | contents: write
8 | jobs:
9 | deploy:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Configure Git Credentials
14 | run: |
15 | git config user.name github-actions[bot]
16 | git config user.email 41898282+github-actions[bot]@users.noreply.github.com
17 | - uses: actions/setup-python@v5
18 | with:
19 | python-version: 3.x
20 | - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV # (3)!
21 | - uses: actions/cache@v4
22 | with:
23 | key: mkdocs-material-${{ env.cache_id }}
24 | path: .cache
25 | restore-keys: |
26 | mkdocs-material-
27 | - run: pip install mkdocs-material mkdocstrings mkdocstrings-python
28 | - run: mkdocs gh-deploy --force
29 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | name: Upload Python Package
2 |
3 | on:
4 | release:
5 | types: [published]
6 |
7 | permissions:
8 | contents: read
9 |
10 | jobs:
11 | deploy:
12 |
13 | runs-on: ubuntu-latest
14 |
15 | steps:
16 | - uses: actions/checkout@v3
17 | - name: Set up Python
18 | uses: actions/setup-python@v3
19 | with:
20 | python-version: '3.x'
21 | - name: Install dependencies
22 | run: |
23 | python -m pip install --upgrade pip
24 | pip install build
25 | - name: Extract package version
26 | id: extract_version
27 | run: echo "package_version=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV
28 | - name: Write package version to file
29 | run: echo "${{ env.package_version }}" > version.txt
30 | - name: Build package
31 | run: python -m build
32 | - name: Publish package
33 | uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34 | with:
35 | user: ${{ secrets.PYPI_USERNAME }}
36 | password: ${{ secrets.PYPI_PASSWORD }}
37 |
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: Run Tests
2 |
3 | on:
4 | push:
5 | branches: [ main ]
6 | pull_request:
7 | branches: [ main ]
8 | env:
9 | HF_TOKEN: ${{ secrets.HF_TOKEN }}
10 | HF_REPO_ID: ${{ secrets.HF_REPO_ID }}
11 | HF_PATH: ${{ secrets.HF_PATH }}
12 | REDIS_HOST: ${{ secrets.REDIS_HOST }}
13 | REDIS_PORT: ${{ secrets.REDIS_PORT }}
14 | REDIS_USER: ${{ secrets.REDIS_USER }}
15 | REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
16 |
17 | jobs:
18 | run-tests:
19 | runs-on: ubuntu-latest
20 |
21 | steps:
22 | - uses: actions/checkout@v2
23 |
24 | - name: Set up Python
25 | uses: actions/setup-python@v2
26 | with:
27 | python-version: 3.11.9
28 |
29 | - name: Install dependencies
30 | run: |
31 | python -m pip install --upgrade pip
32 | pip install -r requirements.txt
33 |
34 | - name: Get the data
35 | run: bash scripts/data/get_data.sh
36 |
37 | - name: Generate combinations
38 | run: python3.11 -m simian.combiner
39 |
40 | - name: Run tests
41 | run: python3.11 -m simian.tests.__run__
42 |
43 | - name: Check test results
44 | if: failure()
45 | run: |
46 | echo "Some tests failed. Please check the test output for more details."
47 | exit 1
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | __pycache__
3 | simian/__pycache__
4 | github
5 | hf-objaverse-v1
6 | sketchfab
7 | smithsonian
8 | thingiverse
9 | combinations.json
10 | annotations*.json
11 | captions.json
12 | datasets
13 | renders
14 | backgrounds
15 | examples
16 | materials
17 | sampled_df.json
18 | *.blend1
19 | *.obj
20 | venv/
21 | .env
22 | version.txt
23 | dist
24 | config.json
25 | chroma_data
26 | chroma_db
27 | chroma.log
28 | get_captions_1.json
29 | get_captions_2.json
30 | get_captions_processed.json
31 | combinations_updated.json
32 | combinations_processed.json
33 | stationary
34 | combined_captions.py
35 | combinations
36 | combinations_0-26.json
37 | combinations_27-53.json
--------------------------------------------------------------------------------
/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM --platform=linux/x86_64 ubuntu:24.04
2 |
3 | ENV DEBIAN_FRONTEND=noninteractive
4 | ENV TZ=UTC
5 |
6 | RUN apt-get update && \
7 | apt-get install -y \
8 | python3-pip \
9 | python3 \
10 | xorg \
11 | git \
12 | && apt-get install -y software-properties-common && \
13 | add-apt-repository ppa:deadsnakes/ppa && \
14 | apt-get update && \
15 | apt-get install -y python3.11 python3.11-distutils python3.11-dev && \
16 | update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 && \
17 | update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \
18 | apt-get clean \
19 | && rm -rf /var/lib/apt/lists/*
20 |
21 | COPY scripts/ ./scripts/
22 | RUN bash scripts/data/get_data.sh
23 |
24 | COPY requirements.txt .
25 |
26 | RUN python3.11 -m pip install --upgrade --ignore-installed setuptools wheel
27 | RUN python3.11 -m pip install omegaconf requests argparse numpy scipy rich chromadb bpy boto3
28 | RUN python3.11 -m pip install distributask==0.0.40
29 |
30 | COPY simian/ ./simian/
31 | COPY data/ ./data/
32 |
33 | CMD ["python3.11", "-m", "celery", "-A", "simian.worker", "worker", "--loglevel=info", "--concurrency=1"]
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include version.txt
2 | include README.md
3 | include requirements.txt
4 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simian
2 | A synthetic data generator for video caption pairs.
3 |
4 |
239 |
5 |
6 | 
7 | 
8 | 
9 | [](https://badge.fury.io/py/simian3d)
10 | [](https://github.com/RaccoonResearch/simian/blob/main/LICENSE)
11 | [](https://github.com/RaccoonResearch/simian)
12 |
13 | Simian creates synthetic data that is usable for generative video and video captioning tasks. The data consists of videos and captions. The videos are generated using Blender, a 3D modeling software.
14 |
15 | ## 🖥️ Setup
16 |
17 | > **_NOTE:_** Simian requires Python 3.11.
18 |
19 | 1. Install dependences:
20 | ```bash
21 | pip install -r requirements.txt
22 | ```
23 |
24 | 2. Download the datasets:
25 | ```bash
26 | ./scripts/data/get_data.sh
27 | ```
28 |
29 | 3. [OPTIONAL] If you're on a headless Linux server, install Xorg and start it:
30 |
31 | ```bash
32 | sudo apt-get install xserver-xorg -y && \
33 | sudo python3 scripts/start_x_server.py start
34 | ```
35 |
36 | ## 📸 Usage
37 |
38 | ### Generating Combinations
39 |
40 | Generate scenes without movement (static videos):
41 | ```bash
42 | python3 -m simian.combiner --count 1000 --seed 42
43 | ```
44 |
45 | Add movement to all or no objects (camera is stationary):
46 | ```bash
47 | python3 -m simian.combiner --count 1000 --seed 42 --movement
48 | ```
49 |
50 | Allow objects to be on top of each other (static or movement):
51 | ```bash
52 | python3 -m simian.combiner --count 1000 --seed 42 --ontop
53 | ```
54 |
55 | Make camera follow an object (camera follows object):
56 | ```bash
57 | python3 -m simian.combiner --count 1000 --seed 42 --camera_follow
58 | ```
59 |
60 | Randomly apply movement, object stacking, and camera follow effects:
61 | ```bash
62 | python3 -m simian.combiner --count 1000 --seed 42 --random
63 | ```
64 |
65 | ### Generating Videos or Images
66 |
67 | Configure the flags as needed:
68 | - `--width` and `--height` are the resolution of the video.
69 | - `--start_index` and `--end_index` are the number of videos in the combinations you want to run. 0-100 will compile all 100 videos.
70 | - `--combination_index` is the index of the combination to render.
71 | - `--output_dir` is the directory to save the rendered video.
72 | - `--hdri_path` is the directory containing the background images.
73 | - `--start_frame` and `--end_frame` are the start and end frames of the video.
74 | - `--images` adding this will output images instead of video at random frames. Creates multiple images per combination of varying sizes
75 | - `blend_file
223 |
224 |
230 |
231 |
232 |
233 |
234 |
235 |
236 | ## Sponsors
237 |
238 |
225 |
228 |
229 |
226 |
Eric S
🚇💻 ⚠️ 📖
227 |
M̵̞̗̝̼̅̏̎͝Ȯ̴̝̻̊̃̋̀Õ̷̼͋N̸̩̿͜ ̶̜̠̹̼̩͒
🚇 💻 ⚠️ 📖
242 |
245 |