File size: 651 Bytes
2d75ee8
 
 
 
 
 
 
1b7174a
76d4671
 
1b7174a
76d4671
 
 
 
 
1b7174a
76d4671
 
1b7174a
76d4671
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
import cv2
import numpy as np
import os
import torch
from PIL import Image
from diffusers import StableDiffusionInpaintPipeline

image_folder = '/Users/playment/Parth /Codes/data'
video_name = '/Users/playment/Parth /Codes/AI_VideoEditing/video.avi'

images = [img for img in os.listdir(image_folder) if img.endswith(".jpg")]
frame = cv2.imread(os.path.join(image_folder, images[0]))
height, width, layers = frame.shape
images = natsorted(images)
video = cv2.VideoWriter(video_name, 0, 60, (width,height))

for image in images:
    video.write(cv2.imread(os.path.join(image_folder, image)))

cv2.destroyAllWindows()
video.release()