Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with inpainting #62

Closed
Alexadar opened this issue Apr 30, 2023 · 2 comments
Closed

Issue with inpainting #62

Alexadar opened this issue Apr 30, 2023 · 2 comments

Comments

@Alexadar
Copy link

Alexadar commented Apr 30, 2023

Hi!
I;ve tried to launch the inpainting example from the internal notebook and got error.
`
----> 1 result = inpainting(
2 t5=t5, if_I=if_I,
3 if_II=if_II,
4 if_III=if_III,
5 support_pil_img=raw_pil_image.resize((128, 128), resample=Image.BICUBIC),
6 inpainting_mask=inpainting_mask,
7 prompt=[
8 'blue sunglasses',
9 ],
10 seed=42,
11 if_I_kwargs={
12 "guidance_scale": 7.0,
13 "sample_timestep_respacing": "10,10,10,10,10,0,0,0,0,0",
14 'support_noise_less_qsample_steps': 0,
15 },
16 if_II_kwargs={
17 "guidance_scale": 4.0,
18 'aug_level': 0.0,
19 "sample_timestep_respacing": '100',
20 },
21 )
22 if_I.show(result['I'], 2, 3)
23 if_I.show(result['II'], 2, 6)

File ~/miniconda3/envs/df/lib/python3.8/site-packages/deepfloyd_if/pipelines/inpainting.py:61, in inpainting(t5, if_I, if_II, if_III, support_pil_img, prompt, inpainting_mask, negative_prompt, seed, if_I_kwargs, if_II_kwargs, if_III_kwargs, progress, return_tensors, disable_watermark)
57 if_I_kwargs['negative_t5_embs'] = negative_t5_embs
59 if_I_kwargs['support_noise'] = low_res
---> 61 inpainting_mask_I = img_as_bool(resize(inpainting_mask[0].cpu(), (3, image_h, image_w)))
62 inpainting_mask_I = torch.from_numpy(inpainting_mask_I).unsqueeze(0).to(if_I.device)
64 if_I_kwargs['inpainting_mask'] = inpainting_mask_I

File ~/miniconda3/envs/df/lib/python3.8/site-packages/skimage/transform/_warps.py:154, in resize(image, output_shape, order, mode, cval, clip, preserve_range, anti_aliasing, anti_aliasing_sigma)
149 image = image.astype(np.float32)
151 if anti_aliasing is None:
152 anti_aliasing = (
153 not input_type == bool and
--> 154 not (np.issubdtype(input_type, np.integer) and order == 0) and
155 any(x < y for x, y in zip(output_shape, input_shape)))
157 if input_type == bool and anti_aliasing:
158 raise ValueError("anti_aliasing must be False for boolean images")

File ~/miniconda3/envs/df/lib/python3.8/site-packages/numpy/core/numerictypes.py:416, in issubdtype(arg1, arg2)
358 r"""
359 Returns True if first argument is a typecode lower/equal in type hierarchy.
360
(...)
413
414 """
415 if not issubclass_(arg1, generic):
--> 416 arg1 = dtype(arg1).type
417 if not issubclass_(arg2, generic):
418 arg2 = dtype(arg2).type

TypeError: Cannot interpret 'torch.float32' as a data type
`

libs:
image

I assume something wrong with scikit-image, not sure what
Please, assist.
Thanks!

@tomguluson92
Copy link

tomguluson92 commented Apr 30, 2023

I have fix it, please check my pull requrest. #64

@Alexadar
Copy link
Author

I have fix it, please check my pull requrest. #64

I Patched it locally manually, It works, Thanks!

@Alexadar Alexadar closed this as completed May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants