Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoyiZhu committed Oct 9, 2024
0 parents commit 4c4dbfd
Show file tree
Hide file tree
Showing 8 changed files with 321 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## What does this PR do?

Fixes #\<issue_number>

## Before submitting

- [ ] Did you make sure **title is self-explanatory** and **the description concisely explains the PR**?
- [ ] Did you make sure your **PR does only one thing**, instead of bundling different changes together?
- [ ] Did you list all the **breaking changes** introduced by this pull request?
- [ ] Did you **test your PR locally**?
- [ ] Did you **format your code** with `isort . --profile=black;black .` command?

## Did you have fun?

Make sure you had fun coding 🙃
26 changes: 26 additions & 0 deletions .github/workflows/formatter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Formatter

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
formatter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- run: python -m pip install --upgrade pip
- run: pip install isort black
- run: isort . --profile black
- uses: psf/black@stable
154 changes: 154 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
env/
.venv
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

### VisualStudioCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
**/.vscode

# JetBrains
.idea/

# Data & Models
*.h5
*.tar
*.tar.gz

# Lightning-Hydra-Template
configs/local/default.yaml
/data/
/logs/
.env

# Aim logging
.aim
2 changes: 2 additions & 0 deletions .project-root
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# this file is required for inferring the project root directory
# do not delete
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Haoyi Zhu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div align="center">

# SPA: 3D Spatial-Awareness Enables Effective Embodied Representation


[![python](https://img.shields.io/badge/-Python_3.9_%7C_3.10_%7C_3.11-blue?logo=python&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![pytorch](https://img.shields.io/badge/PyTorch_2.0+-ee4c2c?logo=pytorch&logoColor=white)](https://pytorch.org/get-started/locally/)
[![lightning](https://img.shields.io/badge/-Lightning_2.0+-792ee5?logo=pytorchlightning&logoColor=white)](https://pytorchlightning.ai/)
[![hydra](https://img.shields.io/badge/Config-Hydra_1.3-89b8cd)](https://hydra.cc/)
[![black](https://img.shields.io/badge/Code%20Style-Black-black.svg?labelColor=gray)](https://black.readthedocs.io/en/stable/)
[![isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![license](https://img.shields.io/badge/License-MIT-green.svg?labelColor=gray)](https://github.com/ashleve/lightning-hydra-template#license)

[**Project Page**](https://haoyizhu.github.io/spa.github.io/) | [**Arxiv**]()

[Haoyi Zhu](https://www.haoyizhu.site/), [Honghui Yang](https://hhyangcs.github.io/), [Yating Wang](https://scholar.google.com/citations?hl=zh-CN&user=5SuBWh0AAAAJ), [Jiange Yang](https://yangjiangeyjg.github.io/), [Liming Wang](https://wanglimin.github.io/), [Tong He](http://tonghe90.github.io/)
</div>

25 changes: 25 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
h5py==3.11.0
pyyaml==6.0.1
tensorboard==2.16.2
tensorboardx==2.6.2.2
yapf==0.40.2
addict==2.4.0
einops==0.8.0
scipy==1.13.1
termcolor==2.4.0
timm==0.9.10
hydra-colorlog==1.2.0
hydra-core==1.3.2
hydra-optuna-sweeper==1.2.0
lightning>=2.0.0
opencv-python==4.10.0.82
pre-commit==3.7.1
pytest==8.2.2
rich==13.7.1
isort==5.13.2
black==24.4.2
torchmetrics>=0.11.4
rootutils==1.0.7
imageio==2.34.1
python-dotenv==1.0.1
matplotlib
60 changes: 60 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/usr/bin/env python
import os
import pathlib

import pkg_resources
from setuptools import find_packages, setup

PKG_NAME = "spa"
VERSION = "0.1"
EXTRAS = {}


def _read_file(fname):
# this_dir = os.path.abspath(os.path.dirname(__file__))
# with open(os.path.join(this_dir, fname)) as f:
with pathlib.Path(fname).open() as fp:
return fp.read()


def _read_install_requires():
with pathlib.Path("requirements.txt").open() as fp:
return [
str(requirement) for requirement in pkg_resources.parse_requirements(fp)
]


def _fill_extras(extras):
if extras:
extras["all"] = list(set([item for group in extras.values() for item in group]))
return extras


setup(
name=PKG_NAME,
version=VERSION,
author="Haoyi Zhu",
author_email="[email protected]",
url="https://github.com/HaoyiZhu/SPA",
description="SPA: 3D Spatial-Awareness Enables Effective Embodied Representation",
long_description=_read_file("README.md"),
long_description_content_type="text/markdown",
keywords=[
"Deep Learning",
"Machine Learning",
"Embodied AI",
"Representation Learning",
],
license="MIT License",
packages=find_packages(include=f"{PKG_NAME}.*"),
include_package_data=True,
zip_safe=False,
install_requires=_read_install_requires(),
extras_require=_fill_extras(EXTRAS),
python_requires=">=3.9",
entry_points={
"console_scripts": [
"train_command = spa.train:main",
]
},
)

0 comments on commit 4c4dbfd

Please sign in to comment.