Spaces:
Running
on
Zero
Running
on
Zero
daidedou
commited on
Commit
·
e3c8376
1
Parent(s):
dbf15c6
Try to fix the gpu aborted problem
Browse files- zero_shot.py +0 -4
zero_shot.py
CHANGED
|
@@ -121,7 +121,6 @@ class Matcher(object):
|
|
| 121 |
self.fmap_cfg = self.cfg.deepfeat_conf.fmap
|
| 122 |
self.dataloaders = dict()
|
| 123 |
|
| 124 |
-
@spaces.GPU
|
| 125 |
def _init(self):
|
| 126 |
cfg = self.cfg
|
| 127 |
self.fmap_model = DFMNet(self.cfg["deepfeat_conf"]["fmap"]).cuda()
|
|
@@ -138,7 +137,6 @@ class Matcher(object):
|
|
| 138 |
self.eye = torch.eye(self.n_fmap).float().cuda()
|
| 139 |
self.eye.requires_grad = False
|
| 140 |
|
| 141 |
-
@spaces.GPU
|
| 142 |
def fmap(self, shape_dict, target_dict):
|
| 143 |
diff_model_cuda = self.diffusion_model
|
| 144 |
diff_model_cuda.net.cuda()
|
|
@@ -155,7 +153,6 @@ class Matcher(object):
|
|
| 155 |
mask_12, mask_21 = None, None
|
| 156 |
return C12_pred, C12_obj, C21_pred, C21_obj, feat1, feat2, evecs_trans1, evecs_trans2, mask_12, mask_21
|
| 157 |
|
| 158 |
-
@spaces.GPU
|
| 159 |
def zo_shot(self, shape_dict, target_dict):
|
| 160 |
self._init()
|
| 161 |
evecs1, evecs2 = shape_dict["evecs"], target_dict["evecs"]
|
|
@@ -165,7 +162,6 @@ class Matcher(object):
|
|
| 165 |
indKNN_new, _ = extract_p2p_torch_fmap(new_FM, evecs1, evecs2)
|
| 166 |
return new_FM, indKNN_new
|
| 167 |
|
| 168 |
-
@spaces.GPU
|
| 169 |
def optimize(self, shape_dict, target_dict, target_normals):
|
| 170 |
self._init()
|
| 171 |
diff_model_cuda = self.diffusion_model
|
|
|
|
| 121 |
self.fmap_cfg = self.cfg.deepfeat_conf.fmap
|
| 122 |
self.dataloaders = dict()
|
| 123 |
|
|
|
|
| 124 |
def _init(self):
|
| 125 |
cfg = self.cfg
|
| 126 |
self.fmap_model = DFMNet(self.cfg["deepfeat_conf"]["fmap"]).cuda()
|
|
|
|
| 137 |
self.eye = torch.eye(self.n_fmap).float().cuda()
|
| 138 |
self.eye.requires_grad = False
|
| 139 |
|
|
|
|
| 140 |
def fmap(self, shape_dict, target_dict):
|
| 141 |
diff_model_cuda = self.diffusion_model
|
| 142 |
diff_model_cuda.net.cuda()
|
|
|
|
| 153 |
mask_12, mask_21 = None, None
|
| 154 |
return C12_pred, C12_obj, C21_pred, C21_obj, feat1, feat2, evecs_trans1, evecs_trans2, mask_12, mask_21
|
| 155 |
|
|
|
|
| 156 |
def zo_shot(self, shape_dict, target_dict):
|
| 157 |
self._init()
|
| 158 |
evecs1, evecs2 = shape_dict["evecs"], target_dict["evecs"]
|
|
|
|
| 162 |
indKNN_new, _ = extract_p2p_torch_fmap(new_FM, evecs1, evecs2)
|
| 163 |
return new_FM, indKNN_new
|
| 164 |
|
|
|
|
| 165 |
def optimize(self, shape_dict, target_dict, target_normals):
|
| 166 |
self._init()
|
| 167 |
diff_model_cuda = self.diffusion_model
|