Spaces:
Running
Running
gavinyuan
commited on
Commit
·
2b471ce
1
Parent(s):
f057d66
udpate: tricks bisenet
Browse files- inference/tricks.py +3 -3
- weights/79999_iter.pth +3 -0
inference/tricks.py
CHANGED
@@ -149,12 +149,12 @@ vgg_std = torch.tensor([[[0.229]], [[0.224]], [[0.225]]],
|
|
149 |
def load_bisenet():
|
150 |
bisenet_model = BiSeNet(n_classes=19)
|
151 |
bisenet_model.load_state_dict(
|
152 |
-
torch.load(make_abs_path("/
|
153 |
)
|
154 |
bisenet_model.eval()
|
155 |
-
bisenet_model = bisenet_model.
|
156 |
|
157 |
-
smooth_mask = SoftErosion(kernel_size=17, threshold=0.9, iterations=7).
|
158 |
print('[Global] bisenet loaded.')
|
159 |
return bisenet_model, smooth_mask
|
160 |
|
|
|
149 |
def load_bisenet():
|
150 |
bisenet_model = BiSeNet(n_classes=19)
|
151 |
bisenet_model.load_state_dict(
|
152 |
+
torch.load(make_abs_path("./weights/79999_iter.pth",), map_location="cpu")
|
153 |
)
|
154 |
bisenet_model.eval()
|
155 |
+
bisenet_model = bisenet_model.to(device)
|
156 |
|
157 |
+
smooth_mask = SoftErosion(kernel_size=17, threshold=0.9, iterations=7).to(device)
|
158 |
print('[Global] bisenet loaded.')
|
159 |
return bisenet_model, smooth_mask
|
160 |
|
weights/79999_iter.pth
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:468e13ca13a9b43cc0881a9f99083a430e9c0a38abd935431d1c28ee94b26567
|
3 |
+
size 53289463
|