Skip to content

Commit 07f3dcf

Browse files
CopilotMMathisLab
andauthored
Update project header from FMPose to FMPose3D with Apache 2.0 license (#3)
* Initial plan * Update file headers and add automation script - Changed header in fmpose/__init__.py from 'FMPose' to 'FMPose3D: monocular' - Changed 'Accepted by IEEE Transactions...' to 'Licensed under Apache 2.0' - Added update_headers.py script to automate header changes - Added .gitignore to exclude Python cache files Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com> * Update paper title in header to FMPose3D Changed paper reference from "FMPose: 3D Pose Estimation via Flow Matching" to "FMPose3D: monocular 3D Pose Estimation via Flow Matching" to match the new project branding Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com>
1 parent a4baf59 commit 07f3dcf

3 files changed

Lines changed: 158 additions & 3 deletions

File tree

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
pip-wheel-metadata/
20+
share/python-wheels/
21+
*.egg-info/
22+
.installed.cfg
23+
*.egg
24+
MANIFEST
25+
26+
# Virtual environments
27+
venv/
28+
ENV/
29+
env/
30+
31+
# IDE
32+
.vscode/
33+
.idea/
34+
*.swp
35+
*.swo
36+
*~
37+
38+
# Testing
39+
.pytest_cache/
40+
.coverage
41+
htmlcov/
42+
43+
# Models and data
44+
*.pth
45+
*.pkl
46+
*.h5
47+
*.ckpt

fmpose/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"""
2-
FMPose: 3D Pose Estimation via Flow Matching
2+
FMPose3D: monocular 3D Pose Estimation via Flow Matching
33
44
Official implementation of the paper:
5-
"FMPose: 3D Pose Estimation via Flow Matching"
5+
"FMPose3D: monocular 3D Pose Estimation via Flow Matching"
66
by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis
7-
Accepted by IEEE Transactions on Multimedia (TMM), 2025.
7+
Licensed under Apache 2.0
88
"""
99

1010
__version__ = "0.0.5"

scripts/update_headers.py

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Script to update file headers in the FMPose3D repository.
4+
5+
This script replaces the old header format with the new header format
6+
across all Python files in the repository.
7+
"""
8+
9+
import os
10+
import sys
11+
from pathlib import Path
12+
13+
# Define the old and new headers
14+
OLD_HEADER = '''"""
15+
FMPose: 3D Pose Estimation via Flow Matching
16+
17+
Official implementation of the paper:
18+
"FMPose: 3D Pose Estimation via Flow Matching"
19+
by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis
20+
Accepted by IEEE Transactions on Multimedia (TMM), 2025.
21+
"""'''
22+
23+
NEW_HEADER = '''"""
24+
FMPose3D: monocular 3D Pose Estimation via Flow Matching
25+
26+
Official implementation of the paper:
27+
"FMPose3D: monocular 3D Pose Estimation via Flow Matching"
28+
by Ti Wang, Xiaohang Yu, and Mackenzie Weygandt Mathis
29+
Licensed under Apache 2.0
30+
"""'''
31+
32+
33+
def update_file_header(file_path):
34+
"""
35+
Update the header in a single file.
36+
37+
Args:
38+
file_path: Path to the file to update
39+
40+
Returns:
41+
True if the file was updated, False otherwise
42+
"""
43+
try:
44+
with open(file_path, 'r', encoding='utf-8') as f:
45+
content = f.read()
46+
47+
if OLD_HEADER in content:
48+
new_content = content.replace(OLD_HEADER, NEW_HEADER)
49+
with open(file_path, 'w', encoding='utf-8') as f:
50+
f.write(new_content)
51+
return True
52+
return False
53+
except Exception as e:
54+
print(f"Error processing {file_path}: {e}")
55+
return False
56+
57+
58+
def find_and_update_headers(root_dir):
59+
"""
60+
Find and update all Python files with the old header.
61+
62+
Args:
63+
root_dir: Root directory to search from
64+
65+
Returns:
66+
List of files that were updated
67+
"""
68+
root_path = Path(root_dir)
69+
updated_files = []
70+
71+
# Find all Python files
72+
for py_file in root_path.rglob('*.py'):
73+
# Skip files in .git directory
74+
if '.git' in py_file.parts:
75+
continue
76+
77+
if update_file_header(py_file):
78+
updated_files.append(py_file)
79+
print(f"✓ Updated: {py_file.relative_to(root_path)}")
80+
81+
return updated_files
82+
83+
84+
def main():
85+
"""Main function to run the header update script."""
86+
if len(sys.argv) > 1:
87+
root_dir = sys.argv[1]
88+
else:
89+
root_dir = os.getcwd()
90+
91+
print(f"Searching for files with old headers in: {root_dir}")
92+
print("-" * 60)
93+
94+
updated_files = find_and_update_headers(root_dir)
95+
96+
print("-" * 60)
97+
if updated_files:
98+
print(f"\n✓ Successfully updated {len(updated_files)} file(s):")
99+
for file_path in updated_files:
100+
print(f" - {file_path}")
101+
else:
102+
print("\nNo files found with the old header.")
103+
104+
return 0 if updated_files else 1
105+
106+
107+
if __name__ == '__main__':
108+
sys.exit(main())

0 commit comments

Comments
 (0)