Idk
This commit is contained in:
25
rpi/training/move_image.py
Normal file
25
rpi/training/move_image.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import os
|
||||
import shutil
|
||||
|
||||
# ----------------------------
|
||||
# Configuration
|
||||
# ----------------------------
|
||||
|
||||
source_folder = "datasets/twhpv/valid/images"
|
||||
destination_folder = "datasets/_unified/valid/images"
|
||||
|
||||
os.makedirs(destination_folder, exist_ok=True)
|
||||
|
||||
# Supported image extensions
|
||||
image_extensions = [".jpg", ".jpeg", ".png", ".bmp", ".gif"]
|
||||
|
||||
# ----------------------------
|
||||
# Copy images
|
||||
# ----------------------------
|
||||
for filename in os.listdir(source_folder):
|
||||
if any(filename.lower().endswith(ext) for ext in image_extensions):
|
||||
src_path = os.path.join(source_folder, filename)
|
||||
dst_path = os.path.join(destination_folder, filename)
|
||||
shutil.copy2(src_path, dst_path) # copy2 preserves metadata
|
||||
|
||||
print(f"All images copied to '{destination_folder}'")
|
||||
Reference in New Issue
Block a user