Skip to content

Commit 998efac

Browse files
committed
fixed publications
1 parent 6f19384 commit 998efac

File tree

9 files changed

+115
-0
lines changed

9 files changed

+115
-0
lines changed

_data/sources.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,23 @@
158158
- code translation
159159
- semi-supervised learning
160160
- id: doi:10.48550/arXiv.2507.19598
161+
image: images/publications/mocha.png
161162
publisher: Conference on Empirical Methods in Natural Language Processing (EMNLP) Findings
162163
date: '2025-11-04'
163164
- id: doi:10.48550/arXiv.2507.19060
165+
image: images/publications/purpcode.png
164166
publisher: Conference on Neural Information Processing Systems (NeurIPS)
165167
date: '2025-12-07'
166168
- id: doi:10.48550/arXiv.2506.21656
169+
image: images/publications/sreasoner.png
167170
publisher: Conference on Neural Information Processing Systems (NeurIPS)
168171
date: '2025-12-07'
169172
- id: doi:10.48550/arXiv.2506.21550
173+
image: images/publications/mtsbench.png
170174
- id: doi:10.48550/arXiv.2506.21546
175+
image: images/publications/hallusegbench.png
171176
- id: doi:10.48550/arXiv.2506.17212
177+
image: images/publications/part2gs.gif
172178
- id: doi:10.48550/arXiv.2506.06952
179+
image: images/publications/latteflow.png
180+

fetch-members/fix-images.py

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Script to convert publication images to square format with white padding.
4+
Takes image filenames from the images/publications folder and saves them as square images.
5+
"""
6+
7+
import os
8+
from PIL import Image, ImageOps
9+
10+
# Input: List of image filenames from images/publications folder
11+
IMAGE_FILENAMES = [
12+
"mocha.png",
13+
"purpcode.png",
14+
"sreasoner.png",
15+
"mtsbench.png",
16+
"hallusegbench.png",
17+
"part2gs.gif",
18+
"latteflow.png"
19+
]
20+
21+
def make_square_with_padding(image_path, output_path):
22+
"""
23+
Convert an image to square format by adding white padding.
24+
25+
Args:
26+
image_path (str): Path to the input image
27+
output_path (str): Path to save the square image
28+
"""
29+
try:
30+
# Open the image
31+
with Image.open(image_path) as img:
32+
# Convert to RGB if necessary (for PNG with transparency)
33+
if img.mode in ('RGBA', 'LA', 'P'):
34+
# Create a white background
35+
background = Image.new('RGB', img.size, (255, 255, 255))
36+
if img.mode == 'P':
37+
img = img.convert('RGBA')
38+
background.paste(img, mask=img.split()[-1] if img.mode == 'RGBA' else None)
39+
img = background
40+
elif img.mode != 'RGB':
41+
img = img.convert('RGB')
42+
43+
# Get current dimensions
44+
width, height = img.size
45+
46+
# Determine the size of the square (max of width and height)
47+
max_size = max(width, height)
48+
49+
# Create a new square image with white background
50+
square_img = Image.new('RGB', (max_size, max_size), (255, 255, 255))
51+
52+
# Calculate position to center the original image
53+
x_offset = (max_size - width) // 2
54+
y_offset = (max_size - height) // 2
55+
56+
# Paste the original image onto the square canvas
57+
square_img.paste(img, (x_offset, y_offset))
58+
59+
# Save the square image
60+
square_img.save(output_path, quality=95, optimize=True)
61+
print(f"✓ Converted: {os.path.basename(image_path)} -> {os.path.basename(output_path)}")
62+
63+
except Exception as e:
64+
print(f"✗ Error processing {image_path}: {str(e)}")
65+
66+
def main():
67+
"""Main function to process all images in the list."""
68+
# Define paths
69+
base_dir = os.path.dirname(os.path.abspath(__file__))
70+
input_dir = os.path.join(base_dir, '..', "images", "publications")
71+
output_dir = os.path.join(base_dir, '..', "images", "publications")
72+
73+
# Check if input directory exists
74+
if not os.path.exists(input_dir):
75+
print(f"Error: Input directory does not exist: {input_dir}")
76+
return
77+
78+
# Create output directory if it doesn't exist
79+
os.makedirs(output_dir, exist_ok=True)
80+
81+
print("Converting images to square format with white padding...")
82+
print("-" * 60)
83+
84+
processed = 0
85+
skipped = 0
86+
87+
for filename in IMAGE_FILENAMES:
88+
input_path = os.path.join(input_dir, filename)
89+
output_path = os.path.join(output_dir, filename)
90+
91+
# Check if input file exists
92+
if not os.path.exists(input_path):
93+
print(f"⚠ Skipped: {filename} (file not found)")
94+
skipped += 1
95+
continue
96+
97+
# Process the image
98+
make_square_with_padding(input_path, output_path)
99+
processed += 1
100+
101+
print("-" * 60)
102+
print(f"Processing complete!")
103+
print(f"Processed: {processed} images")
104+
print(f"Skipped: {skipped} images")
105+
106+
if __name__ == "__main__":
107+
main()
172 KB
Loading

images/publications/latteflow.png

34.2 KB
Loading

images/publications/mocha.png

246 KB
Loading

images/publications/mtsbench.png

417 KB
Loading

images/publications/part2gs.gif

2.98 MB
Loading

images/publications/purpcode.png

95.7 KB
Loading

images/publications/sreasoner.png

239 KB
Loading

0 commit comments

Comments
 (0)