Skip to content

Commit

Permalink
limit float precision in cmdline, notify #28
Browse files Browse the repository at this point in the history
  • Loading branch information
Kahsolt committed May 3, 2023
1 parent 13ad319 commit 4f18372
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/controlnet_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def rife_interp(i:int, j:int, k:int, alpha:float) -> Tensor:
fp0 = self.tmp_dp / f'{i}-{k}.png'
fp1 = self.tmp_dp / f'{j}-{k}.png'
fpo = self.tmp_dp / f'{i}-{j}-{alpha:.3f}.png' if self.dbg_rife else self.tmp_fp
assert run_cmd(f'rife-ncnn-vulkan -m rife-v4 -s {alpha} -0 "{fp0}" -1 "{fp1}" -o "{fpo}"')
assert run_cmd(f'rife-ncnn-vulkan -m rife-v4 -s {alpha:.3f} -0 "{fp0}" -1 "{fp1}" -o "{fpo}"')
x = torch.from_numpy(np.asarray(Image.open(fpo)) / 255.0)
if len(x.shape) == 2: x = x.unsqueeze_(0) # [H, W] => [C=1, H, W]
elif len(x.shape) == 3: x = x.permute([2, 0, 1]) # [H, W, C] => [C, H, W]
Expand Down

0 comments on commit 4f18372

Please sign in to comment.