Spaces:
Build error
Build error
temp
Browse files
app.py
CHANGED
|
@@ -51,10 +51,10 @@ transform = transforms.Compose([
|
|
| 51 |
def match(query_feat, pos_feat, LoweRatioTh=0.9):
|
| 52 |
# first perform reciprocal nn
|
| 53 |
dist = torch.cdist(query_feat, pos_feat)
|
| 54 |
-
print('dist.size',dist.size())
|
| 55 |
best1 = torch.argmin(dist, dim=1)
|
| 56 |
best2 = torch.argmin(dist, dim=0)
|
| 57 |
-
print('best2.size',best2.size())
|
| 58 |
arange = torch.arange(best2.size(0))
|
| 59 |
reciprocal = best1[best2]==arange
|
| 60 |
# check Lowe ratio test
|
|
@@ -84,8 +84,8 @@ def generate_matching_superfeatures(
|
|
| 84 |
Imagenet_model=False,
|
| 85 |
scale_id=6, threshold=50,
|
| 86 |
random_mode=False, sf_ids=''): #, only_matching=True):
|
| 87 |
-
print('im1:', im1.size)
|
| 88 |
-
print('im2:', im2.size)
|
| 89 |
|
| 90 |
clear_figures()
|
| 91 |
col = plt.get_cmap('tab10')
|
|
@@ -159,8 +159,6 @@ def generate_matching_superfeatures(
|
|
| 159 |
img1rsz[m,n, :] = col_[::-1]
|
| 160 |
|
| 161 |
img2rsz = np.copy(im2_cv)
|
| 162 |
-
print('im2:', im2.size)
|
| 163 |
-
print('img2rsz:', img2rsz.shape)
|
| 164 |
for j, att in enumerate(all_att_bin2):
|
| 165 |
att = cv2.resize(att, im2.size, interpolation=cv2.INTER_NEAREST)
|
| 166 |
mask2d = zip(*np.where(att==255))
|
|
|
|
| 51 |
def match(query_feat, pos_feat, LoweRatioTh=0.9):
|
| 52 |
# first perform reciprocal nn
|
| 53 |
dist = torch.cdist(query_feat, pos_feat)
|
| 54 |
+
# print('dist.size',dist.size())
|
| 55 |
best1 = torch.argmin(dist, dim=1)
|
| 56 |
best2 = torch.argmin(dist, dim=0)
|
| 57 |
+
# print('best2.size',best2.size())
|
| 58 |
arange = torch.arange(best2.size(0))
|
| 59 |
reciprocal = best1[best2]==arange
|
| 60 |
# check Lowe ratio test
|
|
|
|
| 84 |
Imagenet_model=False,
|
| 85 |
scale_id=6, threshold=50,
|
| 86 |
random_mode=False, sf_ids=''): #, only_matching=True):
|
| 87 |
+
# print('im1:', im1.size)
|
| 88 |
+
# print('im2:', im2.size)
|
| 89 |
|
| 90 |
clear_figures()
|
| 91 |
col = plt.get_cmap('tab10')
|
|
|
|
| 159 |
img1rsz[m,n, :] = col_[::-1]
|
| 160 |
|
| 161 |
img2rsz = np.copy(im2_cv)
|
|
|
|
|
|
|
| 162 |
for j, att in enumerate(all_att_bin2):
|
| 163 |
att = cv2.resize(att, im2.size, interpolation=cv2.INTER_NEAREST)
|
| 164 |
mask2d = zip(*np.where(att==255))
|