Skip to content

Commit

Permalink
update tensorrt to 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
TNTwise committed Aug 22, 2024
1 parent e91bc83 commit e1cf9b5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
1 change: 0 additions & 1 deletion backend/src/InterpolateArchs/RIFE/rife420IFNET.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from .interpolate import interpolate
except ImportError:
from torch.nn.functional import interpolate
import math

def conv(in_planes, out_planes, kernel_size=3, stride=1, padding=1, dilation=1):
return nn.Sequential(
Expand Down
12 changes: 4 additions & 8 deletions backend/src/InterpolateArchs/RIFE/rife46IFNET.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ def __init__(
self.tenFlow_div = tenFlow_div

def forward(self, img0, img1, timestep):
flow_list = []
merged = []
mask_list = []
warped_img0 = img0
warped_img1 = img1
flow = None
Expand Down Expand Up @@ -169,12 +166,11 @@ def forward(self, img0, img1, timestep):
m0 = (m0 + (-m1)) / 2
flow = flow + f0
mask = mask + m0
mask_list.append(mask)
flow_list.append(flow)
latest_mask = mask
warped_img0 = warp(img0, flow[:, :2], self.tenFlow_div, self.backwarp_tenGrid)
warped_img1 = warp(img1, flow[:, 2:4], self.tenFlow_div, self.backwarp_tenGrid)
merged.append((warped_img0, warped_img1))
mask_list[3] = torch.sigmoid(mask_list[3])
frame = merged[3][0] * mask_list[3] + merged[3][1] * (1 - mask_list[3])

temp = torch.sigmoid(latest_mask)
frame = warped_img0 * temp + warped_img1 * (1 - temp)
frame = frame[:, :, : self.height, : self.width][0]
return frame.squeeze(0).permute(1, 2, 0).mul(255).float()
20 changes: 10 additions & 10 deletions src/DownloadDeps.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,24 +270,24 @@ def getTensorRTDeps(self):
match getPlatform():
case "linux":
tensorRTDeps = [
"tensorrt==10.1.0",
"tensorrt_cu12==10.1.0",
"tensorrt-cu12_libs==10.1.0",
"tensorrt_cu12_bindings==10.1.0",
"tensorrt==10.3.0",
"tensorrt_cu12==10.3.0",
"tensorrt-cu12_libs==10.3.0",
"tensorrt_cu12_bindings==10.3.0",
]
#default
tensorRTDeps += ["torch_tensorrt==2.4.0"]
tensorRTDeps += ["--no-deps","torch_tensorrt==2.4.0"]
#nightly
#tensorRTDeps += ["https://download.pytorch.org/whl/nightly/cu124/torch_tensorrt-2.5.0.dev20240817%2Bcu124-cp311-cp311-linux_x86_64.whl"]
case "win32":
tensorRTDeps = [
"tensorrt==10.1.0",
"tensorrt_cu12==10.1.0",
"tensorrt-cu12_libs==10.1.0",
"tensorrt_cu12_bindings==10.1.0",
"tensorrt==10.3.0",
"tensorrt_cu12==10.3.0",
"tensorrt-cu12_libs==10.3.0",
"tensorrt_cu12_bindings==10.3.0",
]
tensorRTDeps += (
#"--no-deps",
"--no-deps",
#"torch_tensorrt==2.4.0",
"https://download.pytorch.org/whl/nightly/cu124/torch_tensorrt-2.5.0.dev20240816%2Bcu124-cp311-cp311-win_amd64.whl",
)
Expand Down

0 comments on commit e1cf9b5

Please sign in to comment.