Skip to content

Commit 0fa4bb6

Browse files
author
Phạm Băng Đăng
committed
fix text
1 parent e8c0c9f commit 0fa4bb6

File tree

10 files changed

+28
-1
lines changed

10 files changed

+28
-1
lines changed

change.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
from PIL import Image
3+
4+
def convert_images_to_jpeg(image_folder):
5+
# Create an output folder if it does not exist
6+
output_folder = os.path.join(image_folder, 'jpeg_converted')
7+
if not os.path.exists(output_folder):
8+
os.makedirs(output_folder)
9+
10+
# Loop through all files in the image folder
11+
for filename in os.listdir(image_folder):
12+
if filename.lower().endswith(('.png', '.jpg', '.jpeg', '.bmp', '.gif', '.tiff')):
13+
# Open an image file
14+
img_path = os.path.join(image_folder, filename)
15+
with Image.open(img_path) as img:
16+
# Convert image to RGB mode if it's not already
17+
img = img.convert('RGB')
18+
19+
# Save the image as JPEG
20+
base_filename = os.path.splitext(filename)[0]
21+
jpeg_path = os.path.join(output_folder, f"{base_filename}.jpeg")
22+
img.save(jpeg_path, 'JPEG')
23+
24+
# Specify the folder containing images
25+
image_folder = 'img'
26+
27+
convert_images_to_jpeg(image_folder)

img/jpeg_converted/B2B_Pipeline.jpeg

500 KB
Loading

img/jpeg_converted/Overview.jpeg

452 KB
Loading

img/jpeg_converted/Teaser.jpeg

102 KB
Loading

img/jpeg_converted/mathB.jpeg

7.52 KB
Loading

img/jpeg_converted/mathK.jpeg

9.13 KB
Loading

img/jpeg_converted/mathS.jpeg

6.99 KB
Loading

img/jpeg_converted/quantitative.jpeg

513 KB
Loading

img/jpeg_converted/youtube_icon.jpeg

2.08 KB
Loading

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ <h3 class="title has-text-centered">Blur2Blur Pipeline</h3>
946946
This translator is trained using <span style="color: rgb(253, 127, 2);"><b>reconstruction</b></span> and <span style="color: purple;"><b>adversarial</b></span> losses. The converted images have known blur and can be successfully deblurred using the previously trained deblurring model.
947947
</p>
948948
<div style="text-align: center;">
949-
<img id="method_pipeline" width="95%" height="auto" src="./img/B2B_Pipeline.jpg" alt="B2B_Pipeline"/>
949+
<img id="method_pipeline" width="95%" height="auto" src="./img/jpeg_converted/B2B_Pipeline.jpeg" alt="B2B_Pipeline"/>
950950
</div>
951951
</div>
952952
</div>

0 commit comments

Comments
 (0)