SEINE
SEINE copied to clipboard
An error occurs when using a custom image
Thank you for your outstanding work. When I use the image I uploaded and execute sample_i2v.yaml, I will be prompted:
loading video from input/i2v/rocket1.png
loading the input image
Traceback (most recent call last):
File "/content/SEINE/sample_scripts/with_mask_sample.py", line 243, in
Is there any way to fix this error ??
Hey. You can either re-save it as a jpg (your image has an alpha / transparency channel), or create a function in the main sample code by adding:
def get_img(img_path_or_tensor):
img = torch.as_tensor(
np.array(
Image.open(img_path_or_tensor),
dtype=np.uint8, copy=True)
).unsqueeze(0)
return img[:, :, :, :3]
Then replace all instances like from here with:
first_frame = get_img(first_frame_path)
Hey. You can either re-save it as a jpg (your image has an alpha / transparency channel), or create a function in the main sample code by adding:
def get_img(img_path_or_tensor): img = torch.as_tensor( np.array( Image.open(img_path_or_tensor), dtype=np.uint8, copy=True) ).unsqueeze(0) return img[:, :, :, :3]Then replace all instances like from here with:
first_frame = get_img(first_frame_path)
it work, thanks