Spaces:
Sleeping
Sleeping
feat: restore CLIP (ViT) unimodal descriptor alongside ViT
Browse files- Interface/app.py +2 -1
- Interface/templates/index.html +18 -0
Interface/app.py
CHANGED
|
@@ -75,11 +75,12 @@ DESCRIPTOR_MAP = {
|
|
| 75 |
"ORB (Keypoints)": ("ORB", f.generateORB, 4),
|
| 76 |
"ViT (Deep Learning)": ("ViT", f.generateViT, 8),
|
| 77 |
"ResNet50 (Deep Learning)": ("ResNet", f.generateResNet, 9),
|
|
|
|
| 78 |
}
|
| 79 |
|
| 80 |
VECTOR_DESCRIPTORS = ["Color Histogram", "HSV Histogram", "GLCM (Texture)", "LBP (Texture)", "HOG (Shape)"]
|
| 81 |
KEYPOINT_DESCRIPTORS = ["SIFT (Keypoints)", "ORB (Keypoints)"]
|
| 82 |
-
DL_DESCRIPTORS = ["ViT (Deep Learning)", "ResNet50 (Deep Learning)"]
|
| 83 |
|
| 84 |
VECTOR_DISTANCES = ["Euclidienne", "Chi carre", "Correlation", "Intersection", "Bhattacharyya"]
|
| 85 |
KEYPOINT_DISTANCES = ["Brute force", "Flann"]
|
|
|
|
| 75 |
"ORB (Keypoints)": ("ORB", f.generateORB, 4),
|
| 76 |
"ViT (Deep Learning)": ("ViT", f.generateViT, 8),
|
| 77 |
"ResNet50 (Deep Learning)": ("ResNet", f.generateResNet, 9),
|
| 78 |
+
"CLIP (ViT)": ("CLIP", f.generateCLIP, 10),
|
| 79 |
}
|
| 80 |
|
| 81 |
VECTOR_DESCRIPTORS = ["Color Histogram", "HSV Histogram", "GLCM (Texture)", "LBP (Texture)", "HOG (Shape)"]
|
| 82 |
KEYPOINT_DESCRIPTORS = ["SIFT (Keypoints)", "ORB (Keypoints)"]
|
| 83 |
+
DL_DESCRIPTORS = ["ViT (Deep Learning)", "ResNet50 (Deep Learning)", "CLIP (ViT)"]
|
| 84 |
|
| 85 |
VECTOR_DISTANCES = ["Euclidienne", "Chi carre", "Correlation", "Intersection", "Bhattacharyya"]
|
| 86 |
KEYPOINT_DISTANCES = ["Brute force", "Flann"]
|
Interface/templates/index.html
CHANGED
|
@@ -115,6 +115,7 @@
|
|
| 115 |
<span class="group-label">Deep Learning</span>
|
| 116 |
<label class="checkbox-item"><input type="checkbox" name="descriptor" value="ViT (Deep Learning)" data-group="dl"> ViT · Vision Transformer</label>
|
| 117 |
<label class="checkbox-item"><input type="checkbox" name="descriptor" value="ResNet50 (Deep Learning)" data-group="dl"> ResNet50 · Deep Learning</label>
|
|
|
|
| 118 |
|
| 119 |
<span class="group-label">Keypoint-based</span>
|
| 120 |
<label class="checkbox-item"><input type="checkbox" name="descriptor" value="SIFT (Keypoints)" data-group="keypoint"> SIFT (Keypoints)</label>
|
|
@@ -249,6 +250,23 @@
|
|
| 249 |
↑ Browse Image
|
| 250 |
<input type="file" id="queryInputMulti" accept="image/*" hidden>
|
| 251 |
</label>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
</div>
|
| 253 |
|
| 254 |
<div class="divider"></div>
|
|
|
|
| 115 |
<span class="group-label">Deep Learning</span>
|
| 116 |
<label class="checkbox-item"><input type="checkbox" name="descriptor" value="ViT (Deep Learning)" data-group="dl"> ViT · Vision Transformer</label>
|
| 117 |
<label class="checkbox-item"><input type="checkbox" name="descriptor" value="ResNet50 (Deep Learning)" data-group="dl"> ResNet50 · Deep Learning</label>
|
| 118 |
+
<label class="checkbox-item"><input type="checkbox" name="descriptor" value="CLIP (ViT)" data-group="dl"> CLIP · ViT-B/32</label>
|
| 119 |
|
| 120 |
<span class="group-label">Keypoint-based</span>
|
| 121 |
<label class="checkbox-item"><input type="checkbox" name="descriptor" value="SIFT (Keypoints)" data-group="keypoint"> SIFT (Keypoints)</label>
|
|
|
|
| 250 |
↑ Browse Image
|
| 251 |
<input type="file" id="queryInputMulti" accept="image/*" hidden>
|
| 252 |
</label>
|
| 253 |
+
|
| 254 |
+
<button type="button" class="browse-btn" onclick="openFlickrModal()" style="margin-top:8px;">📁 Browse Flickr8k</button>
|
| 255 |
+
|
| 256 |
+
<div class="modal-overlay" id="flickrModal" onclick="closeFlickrModal()">
|
| 257 |
+
<div class="modal-content" style="max-width:820px;max-height:85vh;overflow-y:auto;padding:24px;" onclick="event.stopPropagation()">
|
| 258 |
+
<button class="modal-close" onclick="closeFlickrModal()">✕</button>
|
| 259 |
+
<h3 style="color:var(--cyan);font-family:var(--font-display);margin:0 0 6px;">SELECT FLICKR8K IMAGE</h3>
|
| 260 |
+
<p id="flickrInfo" style="color:var(--text-mute);font-size:11px;margin:0 0 16px;"></p>
|
| 261 |
+
<div id="flickrGrid" style="display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;"></div>
|
| 262 |
+
<div style="display:flex;justify-content:space-between;align-items:center;margin-top:18px;gap:10px;">
|
| 263 |
+
<button class="browse-btn" id="fkPrev" style="width:auto;padding:8px 16px;" onclick="loadFlickrPage(-1)">◀ PREV</button>
|
| 264 |
+
<input type="number" id="fkJump" min="1" placeholder="page…" style="width:80px;padding:6px;background:var(--surface);border:1px solid var(--border);color:var(--text);border-radius:4px;" onkeydown="if(event.key==='Enter')jumpFlickr()">
|
| 265 |
+
<span id="fkPageLabel" style="color:var(--text-mute);font-size:12px;">Page 1</span>
|
| 266 |
+
<button class="browse-btn" id="fkNext" style="width:auto;padding:8px 16px;" onclick="loadFlickrPage(1)">NEXT ▶</button>
|
| 267 |
+
</div>
|
| 268 |
+
</div>
|
| 269 |
+
</div>
|
| 270 |
</div>
|
| 271 |
|
| 272 |
<div class="divider"></div>
|