Spaces:
Runtime error
Runtime error
davidlee1102
commited on
Commit
•
708199f
1
Parent(s):
f6e92c9
Update model
Browse files- .gitattributes +1 -0
- app.py +8 -3
- model/adcv_model/fingerprint.pb +3 -0
- model/adcv_model/keras_metadata.pb +3 -0
- model/adcv_model/saved_model.pb +3 -0
- model/adcv_model/variables/variables.index +0 -0
.gitattributes
CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*.data-00000-of-00001 filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -7,7 +7,7 @@ from scipy.spatial.distance import euclidean
|
|
7 |
|
8 |
st.title("Surrey 2023 - Image Retrieval")
|
9 |
# # Load your TensorFlow model
|
10 |
-
|
11 |
|
12 |
|
13 |
def preprocess_image(image, target_size=(128, 128)):
|
@@ -58,7 +58,12 @@ else:
|
|
58 |
|
59 |
image_pr = []
|
60 |
if st.button("Classify"):
|
61 |
-
image_pr =
|
62 |
image_pr = np.stack(image_pr)
|
|
|
|
|
|
|
|
|
|
|
63 |
|
64 |
-
col2.write(f"len image: {
|
|
|
7 |
|
8 |
st.title("Surrey 2023 - Image Retrieval")
|
9 |
# # Load your TensorFlow model
|
10 |
+
model = tf.keras.models.load_model("model/adcv_model")
|
11 |
|
12 |
|
13 |
def preprocess_image(image, target_size=(128, 128)):
|
|
|
58 |
|
59 |
image_pr = []
|
60 |
if st.button("Classify"):
|
61 |
+
image_pr = image_query_process + image_process_list
|
62 |
image_pr = np.stack(image_pr)
|
63 |
+
result = model.predict(image_pr)
|
64 |
+
distance_list = []
|
65 |
+
for i in range(1, len(result)):
|
66 |
+
distance = euclidean(result[0], result[i])
|
67 |
+
distance_list.append(1 / (1 + distance))
|
68 |
|
69 |
+
col2.write(f"len image: {distance_list")
|
model/adcv_model/fingerprint.pb
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:372ceefd610b9ae442f4e97bc46f6409bde77c591d8d32b4902f5db1e526299d
|
3 |
+
size 57
|
model/adcv_model/keras_metadata.pb
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:60ab6da3e235bab6b4a59fb699591529d6d0d563c5c371199f1962024ee7a051
|
3 |
+
size 361694
|
model/adcv_model/saved_model.pb
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:86e4c55daaf8845e1634d3b38fbad815168bd8e3ccbed59d64dd4667b3656800
|
3 |
+
size 2955648
|
model/adcv_model/variables/variables.index
ADDED
Binary file (16.8 kB). View file
|
|