Spaces:
Runtime error
Runtime error
davidlee1102
commited on
Commit
•
011c680
1
Parent(s):
3feddd7
Update model
Browse files
app.py
CHANGED
@@ -38,18 +38,18 @@ if image_list is not None:
|
|
38 |
else:
|
39 |
count = 0
|
40 |
columns = st.columns(10)
|
41 |
-
for i,
|
42 |
-
img = Image.open(
|
43 |
img = img.resize((128, 128))
|
44 |
image_process_list.append(img)
|
45 |
if count <= 10:
|
46 |
count += 1
|
47 |
-
columns[i].image(img, caption=f"Uploaded image: {
|
48 |
else:
|
49 |
col1.write("Upload Image")
|
50 |
|
51 |
if image_query is not None:
|
52 |
-
img_qr = Image.open(
|
53 |
img_qr = img_qr.resize((128, 128))
|
54 |
image_query_process.append(img_qr)
|
55 |
col1.image(img_qr, caption="Query Image", use_column_width=True, width=98)
|
@@ -69,4 +69,4 @@ if st.button("Classify"):
|
|
69 |
max_index = np.argmax(distance_list)
|
70 |
image_matches = image_list[max_index]
|
71 |
|
72 |
-
col2.write(f"
|
|
|
38 |
else:
|
39 |
count = 0
|
40 |
columns = st.columns(10)
|
41 |
+
for i, uploaded_file_1 in enumerate(image_list):
|
42 |
+
img = Image.open(uploaded_file_1).convert('RGB')
|
43 |
img = img.resize((128, 128))
|
44 |
image_process_list.append(img)
|
45 |
if count <= 10:
|
46 |
count += 1
|
47 |
+
columns[i].image(img, caption=f"Uploaded image: {uploaded_file_1.name}", width=64)
|
48 |
else:
|
49 |
col1.write("Upload Image")
|
50 |
|
51 |
if image_query is not None:
|
52 |
+
img_qr = Image.open(image_query).convert('RGB')
|
53 |
img_qr = img_qr.resize((128, 128))
|
54 |
image_query_process.append(img_qr)
|
55 |
col1.image(img_qr, caption="Query Image", use_column_width=True, width=98)
|
|
|
69 |
max_index = np.argmax(distance_list)
|
70 |
image_matches = image_list[max_index]
|
71 |
|
72 |
+
col2.write(f"The image that have the most similarity: {image_matches}")
|