Spaces:
Running
Running
Update pixelization.py
Browse files- pixelization.py +2 -2
pixelization.py
CHANGED
@@ -75,12 +75,12 @@ class Model():
|
|
75 |
self.G_A_net = define_G(3, 3, 64, "c2pGen", "instance", False, "normal", 0.02, [0])
|
76 |
self.alias_net = define_G(3, 3, 64, "antialias", "instance", False, "normal", 0.02, [0])
|
77 |
|
78 |
-
G_A_state = torch.load("160_net_G_A.pth" if not os.environ['NET_MODEL'] else os.environ['NET_MODEL'], map_location=str(self.device))
|
79 |
for p in list(G_A_state.keys()):
|
80 |
G_A_state["module."+str(p)] = G_A_state.pop(p)
|
81 |
self.G_A_net.load_state_dict(G_A_state)
|
82 |
|
83 |
-
alias_state = torch.load("alias_net.pth" if not os.environ['ALIAS_MODEL'] else os.environ['ALIAS_MODEL'], map_location=str(self.device))
|
84 |
for p in list(alias_state.keys()):
|
85 |
alias_state["module."+str(p)] = alias_state.pop(p)
|
86 |
self.alias_net.load_state_dict(alias_state)
|
|
|
75 |
self.G_A_net = define_G(3, 3, 64, "c2pGen", "instance", False, "normal", 0.02, [0])
|
76 |
self.alias_net = define_G(3, 3, 64, "antialias", "instance", False, "normal", 0.02, [0])
|
77 |
|
78 |
+
G_A_state = torch.load("160_net_G_A.pth" if not os.environ['NET_MODEL'] else os.environ['NET_MODEL'], map_location=str(self.device), weights_only=True)
|
79 |
for p in list(G_A_state.keys()):
|
80 |
G_A_state["module."+str(p)] = G_A_state.pop(p)
|
81 |
self.G_A_net.load_state_dict(G_A_state)
|
82 |
|
83 |
+
alias_state = torch.load("alias_net.pth" if not os.environ['ALIAS_MODEL'] else os.environ['ALIAS_MODEL'], map_location=str(self.device), weights_only=True)
|
84 |
for p in list(alias_state.keys()):
|
85 |
alias_state["module."+str(p)] = alias_state.pop(p)
|
86 |
self.alias_net.load_state_dict(alias_state)
|