Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.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

# Virtual environments
venv/
ENV/
env/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Testing
.pytest_cache/
.coverage
htmlcov/

# Models and data
*.pth
*.pkl
*.h5
*.ckpt
6 changes: 3 additions & 3 deletions fmpose/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
FMPose: 3D Pose Estimation via Flow Matching
FMPose3D: monocular 3D Pose Estimation via Flow Matching

Official implementation of the paper:
"FMPose: 3D Pose Estimation via Flow Matching"
"FMPose3D: monocular 3D Pose Estimation via Flow Matching"
by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis
Accepted by IEEE Transactions on Multimedia (TMM), 2025.
Licensed under Apache 2.0
"""

__version__ = "0.0.5"
Expand Down
108 changes: 108 additions & 0 deletions scripts/update_headers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/usr/bin/env python3
"""
Script to update file headers in the FMPose3D repository.

This script replaces the old header format with the new header format
across all Python files in the repository.
"""

import os
import sys
from pathlib import Path

# Define the old and new headers
OLD_HEADER = '''"""
FMPose: 3D Pose Estimation via Flow Matching

Official implementation of the paper:
"FMPose: 3D Pose Estimation via Flow Matching"
by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis
Accepted by IEEE Transactions on Multimedia (TMM), 2025.
"""'''

NEW_HEADER = '''"""
FMPose3D: monocular 3D Pose Estimation via Flow Matching

Official implementation of the paper:
"FMPose3D: monocular 3D Pose Estimation via Flow Matching"
by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis
Licensed under Apache 2.0
"""'''


def update_file_header(file_path):
"""
Update the header in a single file.

Args:
file_path: Path to the file to update

Returns:
True if the file was updated, False otherwise
"""
try:
with open(file_path, 'r', encoding='utf-8') as f:
content = f.read()

if OLD_HEADER in content:
new_content = content.replace(OLD_HEADER, NEW_HEADER)
with open(file_path, 'w', encoding='utf-8') as f:
f.write(new_content)
return True
return False
except Exception as e:
print(f"Error processing {file_path}: {e}")
return False


def find_and_update_headers(root_dir):
"""
Find and update all Python files with the old header.

Args:
root_dir: Root directory to search from

Returns:
List of files that were updated
"""
root_path = Path(root_dir)
updated_files = []

# Find all Python files
for py_file in root_path.rglob('*.py'):
# Skip files in .git directory
if '.git' in py_file.parts:
continue

if update_file_header(py_file):
updated_files.append(py_file)
print(f"✓ Updated: {py_file.relative_to(root_path)}")

return updated_files


def main():
"""Main function to run the header update script."""
if len(sys.argv) > 1:
root_dir = sys.argv[1]
else:
root_dir = os.getcwd()

print(f"Searching for files with old headers in: {root_dir}")
print("-" * 60)

updated_files = find_and_update_headers(root_dir)

print("-" * 60)
if updated_files:
print(f"\n✓ Successfully updated {len(updated_files)} file(s):")
for file_path in updated_files:
print(f" - {file_path}")
else:
print("\nNo files found with the old header.")

return 0 if updated_files else 1


if __name__ == '__main__':
sys.exit(main())
Loading