Skip to content

Commit 8612e01

Browse files
committed
Fix AttributeError: module 'numpy' has no attribute 'float'
1 parent ac45dd4 commit 8612e01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

util/reverse2original.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ def reverse2wholeimage(b_align_crop_tenor_list,swaped_imgs, mats, crop_size, ori
154154
# target_image_parsing = postprocess(target_image, source_image, tgt_mask)
155155

156156
if use_mask:
157-
target_image = np.array(target_image, dtype=np.float) * 255
157+
target_image = np.array(target_image, dtype=np.float32) * 255
158158
else:
159-
target_image = np.array(target_image, dtype=np.float)[..., ::-1] * 255
159+
target_image = np.array(target_image, dtype=np.float32)[..., ::-1] * 255
160160

161161

162162
img_mask_list.append(img_mask)
@@ -165,7 +165,7 @@ def reverse2wholeimage(b_align_crop_tenor_list,swaped_imgs, mats, crop_size, ori
165165

166166
# target_image /= 255
167167
# target_image = 0
168-
img = np.array(oriimg, dtype=np.float)
168+
img = np.array(oriimg, dtype=np.float32)
169169
for img_mask, target_image in zip(img_mask_list, target_image_list):
170170
img = img_mask * target_image + (1-img_mask) * img
171171

0 commit comments

Comments
 (0)