Skip to content

Commit

Permalink
Merge pull request #234 from MrNeRF/cleanup_code
Browse files Browse the repository at this point in the history
cleanup structure
  • Loading branch information
MrNeRF authored Jan 4, 2025
2 parents 61932a7 + d49953d commit 89e3f85
Show file tree
Hide file tree
Showing 18 changed files with 539 additions and 734 deletions.
198 changes: 5 additions & 193 deletions .github/workflows/validate-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,207 +26,19 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml requests urllib3 PyGithub
pip install -r requirements.txt
- name: Validate Changed YAML entries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }}
run: |
python - <<EOF
import yaml
import sys
import os
import requests
import time
from urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
from github import Github
# Configure requests for better reliability
session = requests.Session()
retries = Retry(
total=3,
backoff_factor=1,
status_forcelist=[408, 429, 500, 502, 503, 504],
allowed_methods=["HEAD", "GET"]
)
adapter = HTTPAdapter(max_retries=retries)
session.mount('http://', adapter)
session.mount('https://', adapter)
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
}
allowed_tags = [
"2DGS", "360 degree", "Acceleration", "Antialiasing", "Autonomous Driving",
"Avatar", "Classic Work", "Code", "Compression", "Deblurring", "Densification",
"Diffusion", "Distributed", "Dynamic", "Editing", "Event Camera", "Feed-Forward",
"GAN", "Inpainting", "In the Wild", "Language Embedding", "Large-Scale", "Lidar",
"Medicine", "Meshing", "Misc", "Monocular", "Perspective-correct", "Object Detection",
"Optimization", "Physics", "Point Cloud", "Poses", "Project", "Ray Tracing",
"Rendering", "Relight", "Review", "Robotics", "Segmentation", "SLAM", "Sparse",
"Stereo", "Style Transfer", "Texturing", "Transformer", "Uncertainty", "Video",
"Virtual Reality", "World Generation"
]
def validate_url(url, required=False):
"""Validate URL with fallback to GET if HEAD fails"""
if not url:
return None if not required else "URL is missing or empty"
try:
# First try HEAD request
response = session.head(
url,
headers=headers,
timeout=30,
allow_redirects=True
)
# If HEAD fails, try GET
if response.status_code in [405, 400, 403]:
response = session.get(
url,
headers=headers,
timeout=30,
allow_redirects=True,
stream=True
)
response.close()
valid_codes = {200, 301, 302, 303, 307, 308}
if response.status_code not in valid_codes:
return f"URL returns {response.status_code}"
return None
except requests.Timeout:
return "URL timed out"
except requests.RequestException as e:
return f"Error accessing URL: {str(e)}"
except Exception as e:
return f"Unexpected error: {str(e)}"
def get_changed_entries():
"""Get entries that were changed or added in this PR"""
# Initialize GitHub client
g = Github(os.getenv('GITHUB_TOKEN'))
repo = g.get_repo(os.getenv('REPO'))
pr = repo.get_pull(int(os.getenv('PR_NUMBER')))
# Load both versions of the YAML file
with open("awesome_3dgs_papers.yaml", 'r') as file:
new_yaml = yaml.safe_load(file)
try:
# Get base content
base_content = repo.get_contents(
"awesome_3dgs_papers.yaml",
ref=pr.base.sha
).decoded_content.decode()
base_yaml = yaml.safe_load(base_content)
except:
# If file doesn't exist in base, all entries are new
base_yaml = []
# Create dictionary of existing entries by ID
base_entries = {entry['id']: entry for entry in base_yaml} if base_yaml else {}
# Find changed or new entries
changed_entries = []
for entry in new_yaml:
entry_id = entry['id']
if entry_id not in base_entries:
print(f"New entry found: {entry_id}")
changed_entries.append(entry)
elif entry != base_entries[entry_id]:
print(f"Modified entry found: {entry_id}")
changed_entries.append(entry)
return changed_entries
def validate_entries(entries):
"""Validate the specified entries"""
errors = []
url_fields = {
'paper': True,
'project_page': False,
'code': False,
'video': False
}
# Load full YAML to get entry numbers
with open("awesome_3dgs_papers.yaml", 'r') as file:
all_entries = yaml.safe_load(file)
# Create index lookup
entry_indices = {entry['id']: idx + 1 for idx, entry in enumerate(all_entries)}
for entry in entries:
# Basic validation
if not entry.get('id'):
errors.append("Entry missing ID")
continue
entry_num = entry_indices.get(entry['id'], '?')
print(f"\nValidating entry #{entry_num}: {entry['id']}")
# Tags validation
tags = entry.get('tags', [])
if not tags:
errors.append(f"Entry {entry['id']}: No tags provided")
else:
invalid_tags = [tag for tag in tags
if not tag.startswith('Year ') and tag not in allowed_tags]
if invalid_tags:
errors.append(f"Entry {entry['id']}: Invalid tags: {invalid_tags}")
non_year_tags = [tag for tag in tags if not tag.startswith('Year ')]
if not non_year_tags:
errors.append(f"Entry {entry['id']}: Must have at least one non-Year tag")
# URL validation
for field, required in url_fields.items():
value = entry.get(field)
if value or required:
print(f"Checking {field} URL: {value}")
error = validate_url(value, required)
if error:
errors.append(f"Entry {entry['id']}: {field} {error}")
# Add delay between requests
time.sleep(1)
return errors
# Main execution
try:
changed_entries = get_changed_entries()
if not changed_entries:
print("No entries were changed in this PR")
sys.exit(0)
print(f"\nFound {len(changed_entries)} changed/new entries to validate")
errors = validate_entries(changed_entries)
if errors:
print("\n❌ Validation errors found:")
for error in errors:
print(error)
sys.exit(1)
else:
print("\n✅ All changed entries passed validation!")
except Exception as e:
print(f"\n❌ Error during validation: {str(e)}")
sys.exit(1)
EOF
python src/validate_yaml.py
- name: Generate HTML
run: python src/generate_all.py
run: |
python src/generate_html.py awesome_3dgs_papers.yaml index.html
- name: Commit and push if changed
env:
Expand All @@ -242,4 +54,4 @@ jobs:
else
git commit -m "Update index.html"
git push origin ${{ github.head_ref }}
fi
fi
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pip install -r requirements.txt

4. Run the YAML editor:
```bash
python yaml_editor.py
python src/yaml_editor.py
```

5. Use the editor to:
Expand Down
Binary file added assets/thumbnails/xu2024representing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions awesome_3dgs_papers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10442,3 +10442,43 @@
- Project
- Video
thumbnail: assets/thumbnails/mallick2024taming.jpg
- id: xu2024representing
title: Representing Long Volumetric Video with Temporal Gaussian Hierarchy
authors: Zhen Xu, Yinghao Xu, Zhiyuan Yu, Sida Peng, Jiaming Sun, Hujun Bao, Xiaowei
Zhou
year: '2024'
abstract: 'This paper aims to address the challenge of reconstructing long volumetric
videos from multi-view RGB videos. Recent dynamic view synthesis methods leverage
powerful 4D representations, like feature grids or point cloud sequences, to achieve
high-quality rendering results. However, they are typically limited to short (1~2s)
video clips and often suffer from large memory footprints when dealing with longer
videos. To solve this issue, we propose a novel 4D representation, named Temporal
Gaussian Hierarchy, to compactly model long volumetric videos. Our key observation
is that there are generally various degrees of temporal redundancy in dynamic
scenes, which consist of areas changing at different speeds. Motivated by this,
our approach builds a multi-level hierarchy of 4D Gaussian primitives, where each
level separately describes scene regions with different degrees of content change,
and adaptively shares Gaussian primitives to represent unchanged scene content
over different temporal segments, thus effectively reducing the number of Gaussian
primitives. In addition, the tree-like structure of the Gaussian hierarchy allows
us to efficiently represent the scene at a particular moment with a subset of
Gaussian primitives, leading to nearly constant GPU memory usage during the training
or rendering regardless of the video length. Extensive experimental results demonstrate
the superiority of our method over alternative methods in terms of training cost,
rendering speed, and storage usage. To our knowledge, this work is the first approach
capable of efficiently handling minutes of volumetric video data while maintaining
state-of-the-art rendering quality. Our project page is available at: https://zju3dv.github.io/longvolcap.

'
project_page: https://zju3dv.github.io/longvolcap/
paper: https://arxiv.org/pdf/2412.09608.pdf
code: null
video: https://www.youtube.com/watch?v=y7e0YRNNmXw&feature=youtu.be
thumbnail_image: false
thumbnail_video: false
tags:
- Acceleration
- Dynamic
- Project
- Video
thumbnail: assets/thumbnails/xu2024representing.jpg
4 changes: 4 additions & 0 deletions editor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from src.yaml_editor import main

if __name__ == '__main__':
main()
46 changes: 46 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14728,6 +14728,52 @@ <h2 class="paper-title">
</div>
</div>


<div class="paper-row"
data-title="Representing Long Volumetric Video with Temporal Gaussian Hierarchy"
data-authors="Zhen Xu, Yinghao Xu, Zhiyuan Yu, Sida Peng, Jiaming Sun, Hujun Bao, Xiaowei Zhou"
data-year="2024"
data-tags='["Acceleration", "Dynamic", "Project", "Video"]'>
<div class="paper-card">
<div class="paper-number"></div>
<div class="paper-thumbnail">
<img data-src="assets/thumbnails/xu2024representing.jpg"
data-fallback="https://raw.githubusercontent.com/yangcaogit/3DGS-DET/main/assets/teaser.jpg"
alt="Paper thumbnail for Representing Long Volumetric Video with Temporal Gaussian Hierarchy"
class="lazy"
loading="lazy"/>
</div>
<div class="paper-content">
<h2 class="paper-title">
Representing Long Volumetric Video with Temporal Gaussian Hierarchy <span class="paper-year">(2024)</span>
</h2>
<p class="paper-authors">Zhen Xu, Yinghao Xu, Zhiyuan Yu, Sida Peng, Jiaming Sun, Hujun Bao, Xiaowei Zhou</p>
<div class="paper-tags">
<span class="paper-tag">Acceleration</span>
<span class="paper-tag">Dynamic</span>
<span class="paper-tag">Project</span>
<span class="paper-tag">Video</span>
</div>
<div class="paper-links">
<a href="https://zju3dv.github.io/longvolcap/" class="paper-link" target="_blank" rel="noopener">
<i class="fas fa-globe"></i> Project Page
</a> <a href="https://arxiv.org/pdf/2412.09608.pdf" class="paper-link" target="_blank" rel="noopener">
<i class="fas fa-file-alt"></i> Paper
</a> <a href="https://www.youtube.com/watch?v=y7e0YRNNmXw&feature=youtu.be" class="paper-link" target="_blank" rel="noopener">
<i class="fas fa-video"></i> Video
</a>
</div>

<button class="abstract-toggle">Show Abstract</button>
<div class="paper-abstract">
This paper aims to address the challenge of reconstructing long volumetric videos from multi-view RGB videos. Recent dynamic view synthesis methods leverage powerful 4D representations, like feature grids or point cloud sequences, to achieve high-quality rendering results. However, they are typically limited to short (1~2s) video clips and often suffer from large memory footprints when dealing with longer videos. To solve this issue, we propose a novel 4D representation, named Temporal Gaussian Hierarchy, to compactly model long volumetric videos. Our key observation is that there are generally various degrees of temporal redundancy in dynamic scenes, which consist of areas changing at different speeds. Motivated by this, our approach builds a multi-level hierarchy of 4D Gaussian primitives, where each level separately describes scene regions with different degrees of content change, and adaptively shares Gaussian primitives to represent unchanged scene content over different temporal segments, thus effectively reducing the number of Gaussian primitives. In addition, the tree-like structure of the Gaussian hierarchy allows us to efficiently represent the scene at a particular moment with a subset of Gaussian primitives, leading to nearly constant GPU memory usage during the training or rendering regardless of the video length. Extensive experimental results demonstrate the superiority of our method over alternative methods in terms of training cost, rendering speed, and storage usage. To our knowledge, this work is the first approach capable of efficiently handling minutes of volumetric video data while maintaining state-of-the-art rendering quality. Our project page is available at: https://zju3dv.github.io/longvolcap.

</div>

</div>
</div>
</div>

</div>
</div>

Expand Down
9 changes: 9 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
arxiv==2.1.3
certifi==2024.12.14
cffi==1.17.1
charset-normalizer==3.4.1
cryptography==44.0.0
Deprecated==1.2.15
feedparser==6.0.11
idna==3.10
pdf2image==1.17.0
pillow==11.1.0
pycparser==2.22
PyGithub==2.5.0
PyJWT==2.10.1
PyNaCl==1.5.0
PyQt6==6.8.0
PyQt6-Qt6==6.8.1
PyQt6_sip==13.9.1
PyYAML==6.0.2
requests==2.32.3
sgmllib3k==1.0.0
typing_extensions==4.12.2
urllib3==2.3.0
wrapt==1.17.0
Empty file added src/__init__.py
Empty file.
File renamed without changes.
Empty file added src/components/__init__.py
Empty file.
Loading

0 comments on commit 89e3f85

Please sign in to comment.