Update app.py
Browse files
app.py
CHANGED
@@ -39,7 +39,7 @@ from scipy.interpolate import LinearNDInterpolator
|
|
39 |
from imageio import imread, imwrite
|
40 |
from diffusers import StableDiffusionImg2ImgPipeline
|
41 |
|
42 |
-
def diffuse(source_img
|
43 |
model_id = "runwayml/stable-diffusion-v1-5"
|
44 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
45 |
pipe = pipe.to("cuda")
|
@@ -81,8 +81,11 @@ def infer():
|
|
81 |
#video_path = Path(tempfile.mkdtemp()) / "basketball.mp4"
|
82 |
#_ = urlretrieve(video_url, video_path)
|
83 |
|
84 |
-
frames, _, _ = read_video(str("./spacex.mp4"), output_format="TCHW")
|
85 |
-
print(f"FRAME BEFORE stack: {frames[100]}")
|
|
|
|
|
|
|
86 |
|
87 |
input_frame_1 = read_image(str("./frame1.jpg"), ImageReadMode.UNCHANGED)
|
88 |
print(f"FRAME 1: {input_frame_1}")
|
|
|
39 |
from imageio import imread, imwrite
|
40 |
from diffusers import StableDiffusionImg2ImgPipeline
|
41 |
|
42 |
+
def diffuse(source_img):
|
43 |
model_id = "runwayml/stable-diffusion-v1-5"
|
44 |
pipe = StableDiffusionImg2ImgPipeline.from_pretrained(model_id, torch_dtype=torch.float16)
|
45 |
pipe = pipe.to("cuda")
|
|
|
81 |
#video_path = Path(tempfile.mkdtemp()) / "basketball.mp4"
|
82 |
#_ = urlretrieve(video_url, video_path)
|
83 |
|
84 |
+
#frames, _, _ = read_video(str("./spacex.mp4"), output_format="TCHW")
|
85 |
+
#print(f"FRAME BEFORE stack: {frames[100]}")
|
86 |
+
|
87 |
+
#testing difusion working properly
|
88 |
+
diffuse("./frame1.jpg")
|
89 |
|
90 |
input_frame_1 = read_image(str("./frame1.jpg"), ImageReadMode.UNCHANGED)
|
91 |
print(f"FRAME 1: {input_frame_1}")
|