Fahd-B commited on
Commit
539eabc
ยท
verified ยท
1 Parent(s): 16b94ec

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +65 -16
index.html CHANGED
@@ -3,26 +3,75 @@
3
 
4
  <head>
5
  <meta charset="UTF-8" />
6
- <link rel="stylesheet" href="style.css" />
7
-
8
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
9
- <title>Transformers.js - Object Detection</title>
 
 
 
 
10
  </head>
11
 
12
  <body>
13
- <h1>Object Detection w/ ๐Ÿค— Transformers.js</h1>
14
- <label id="container" for="upload">
15
- <svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
16
- <path fill="#000"
17
- d="M3.5 24.3a3 3 0 0 1-1.9-.8c-.5-.5-.8-1.2-.8-1.9V2.9c0-.7.3-1.3.8-1.9.6-.5 1.2-.7 2-.7h18.6c.7 0 1.3.2 1.9.7.5.6.7 1.2.7 2v18.6c0 .7-.2 1.4-.7 1.9a3 3 0 0 1-2 .8H3.6Zm0-2.7h18.7V2.9H3.5v18.7Zm2.7-2.7h13.3c.3 0 .5 0 .6-.3v-.7l-3.7-5a.6.6 0 0 0-.6-.2c-.2 0-.4 0-.5.3l-3.5 4.6-2.4-3.3a.6.6 0 0 0-.6-.3c-.2 0-.4.1-.5.3l-2.7 3.6c-.1.2-.2.4 0 .7.1.2.3.3.6.3Z">
18
- </path>
19
- </svg>
20
- Click to upload image
21
- <label id="example">(or try example)</label>
22
- </label>
23
- <label id="status">Loading model...</label>
24
- <input id="upload" type="file" accept="image/*" />
25
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  <script src="index.js" type="module"></script>
27
  </body>
28
 
 
3
 
4
  <head>
5
  <meta charset="UTF-8" />
 
 
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Image Similarity Comparison</title>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
9
+ <link rel="stylesheet" href="style.css">
10
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
11
+ <script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-zoom/dist/chartjs-plugin-zoom.min.js"></script>
12
  </head>
13
 
14
  <body>
15
+ <div class="container">
16
+ <div class="panels-wrapper">
17
+ <div class="left-panel">
18
+ <div class="header">
19
+ <h1>Image Similarity Comparison</h1>
20
+ <p>Upload two images to calculate their visual similarity</p>
21
+ </div>
22
+
23
+ <div class="info-section">
24
+ <div class="info-header">
25
+ <i class="fas fa-info-circle"></i>
26
+ <span>How Image Comparison Works</span>
27
+ </div>
28
+ <div class="info-content">
29
+ <p><i class="fas fa-brain"></i>The CLIP model generates a numerical representation (embedding) for each image, capturing its semantic meaning.</p>
30
+ <p><i class="fas fa-calculator"></i>By calculating the cosine similarity between the two image embeddings, we can determine how visually similar they are.</p>
31
+ <p><i class="fas fa-chart-line"></i>A higher score (closer to 100%) means the model considers the images to be more alike in content and style.</p>
32
+ </div>
33
+ </div>
34
+
35
+ <label for="file-upload" id="drop-zone" class="upload-label">
36
+ <i class="fas fa-cloud-upload-alt"></i>
37
+ <span>Drag & drop images here, or click to upload</span>
38
+ <small>You can drop two images at once</small>
39
+ </label>
40
+ <input type="file" id="file-upload" accept="image/*" multiple style="display: none;">
41
+
42
+ <div id="status-indicator">
43
+ <div class="spinner"></div>
44
+ <span id="status-text"></span>
45
+ </div>
46
+ <div class="clear-section">
47
+ <button id="clear-btn"><i class="fas fa-trash"></i> Clear Images</button>
48
+ </div>
49
+ </div>
50
+
51
+ <div class="right-panel">
52
+ <div class="back-link-section">
53
+ <a href="index.html" class="back-link">
54
+ <i class="fas fa-arrow-left"></i>
55
+ <span>Zero-Shot Classification</span>
56
+ </a>
57
+ </div>
58
+ <div class="image-display-area">
59
+ <div id="image-preview-1" class="image-preview"></div>
60
+ <div id="image-preview-2" class="image-preview"></div>
61
+ </div>
62
+ <div id="meter-container"></div>
63
+ <div class="action-buttons">
64
+ <button id="show-graph-btn" style="display: none;">Show Embeddings</button>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ <div id="graph-modal" class="modal">
70
+ <div class="modal-content">
71
+ <span class="close-button">&times;</span>
72
+ <div id="graph-container-modal"></div>
73
+ </div>
74
+ </div>
75
  <script src="index.js" type="module"></script>
76
  </body>
77