VectorMind / backend /ingest /image_ingest.py
Ash-211's picture
feat: add frontend and backend code for multimodal RAG knowledge assistant
2db8ee1
Raw
History Blame Contribute Delete
339 Bytes
from PIL import Image
import os
import shutil
def ingest_image(image_path, output_dir):
os.makedirs(output_dir, exist_ok=True)
img = Image.open(image_path).convert("RGB")
filename = os.path.basename(image_path)
save_path = os.path.join(output_dir, filename)
shutil.copy(image_path, save_path)
return save_path