Spaces:
Running
Running
no message
Browse files
app.py
CHANGED
@@ -15,24 +15,11 @@ DATASETS = [
|
|
15 |
MAX_N_LABELS = 5
|
16 |
SPLIT_TO_CLASSIFY = 'pasta'
|
17 |
|
18 |
-
# COL1, COL2 = st.columns([3, 1])
|
19 |
-
# CONTAINER_TOP = st.container()
|
20 |
-
# CONTAINER_BODY = st.container()
|
21 |
-
# CONTAINER_FULL = st.container()
|
22 |
-
# CONTAINER_LOOP = st.container()
|
23 |
-
COL1=""
|
24 |
-
COL2=""
|
25 |
COLS = st.columns([3, 1])
|
26 |
-
CONTAINER_TOP = st.container()
|
27 |
-
CONTAINER_BODY = st.container()
|
28 |
-
CONTAINER_FULL = st.container()
|
29 |
-
CONTAINER_LOOP = st.container()
|
30 |
|
31 |
|
32 |
|
33 |
-
|
34 |
-
#def classify_one_image(classifier_model, dataset_to_classify):
|
35 |
-
#classify_one_image(image_object, classifier_pipeline)
|
36 |
def classify_one_image(classifier_model, dataset_to_classify):
|
37 |
|
38 |
|
@@ -103,17 +90,8 @@ def make_template():
|
|
103 |
|
104 |
def main():
|
105 |
|
106 |
-
|
107 |
-
|
108 |
-
# with CONTAINER_TOP:
|
109 |
-
# st.write("# Bulk Image Classification DEMO")
|
110 |
-
|
111 |
-
COLS[0].write("# Bulk Image Classification DEMO")
|
112 |
-
# TODO Restart or reset your app
|
113 |
-
# if st.button("Restart"):
|
114 |
-
# # Code to restart or reset your app goes here
|
115 |
-
# import subprocess
|
116 |
-
# subprocess.call(["shutdown", "-r", "-t", "0"])
|
117 |
|
118 |
#with CONTAINER_BODY:
|
119 |
with COLS[0]:
|
@@ -121,14 +99,14 @@ def main():
|
|
121 |
st.write("Soon we will have a dataset template")
|
122 |
|
123 |
#Model
|
124 |
-
chosen_model_name = COLS[0].selectbox("Select the model to use", MODELS, index=0)
|
125 |
if chosen_model_name is not None:
|
126 |
-
COLS[0].write("You selected", chosen_model_name)
|
127 |
|
128 |
#Dataset
|
129 |
-
shosen_dataset_name = COLS[0].selectbox("Select the dataset to use", DATASETS, index=0)
|
130 |
if shosen_dataset_name is not None:
|
131 |
-
COLS[0].write("You selected", shosen_dataset_name)
|
132 |
|
133 |
#click to classify
|
134 |
#image_object = dataset['pasta'][0]
|
@@ -140,6 +118,7 @@ def main():
|
|
140 |
COLS[0].write(f"Classification result: {classification_result}")
|
141 |
#classification_array.append(classification_result)
|
142 |
#st.write("# FLAG 6")
|
143 |
-
#st.write(classification_array)
|
|
|
144 |
if __name__ == "__main__":
|
145 |
main()
|
|
|
15 |
MAX_N_LABELS = 5
|
16 |
SPLIT_TO_CLASSIFY = 'pasta'
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
COLS = st.columns([3, 1])
|
|
|
|
|
|
|
|
|
19 |
|
20 |
|
21 |
|
22 |
+
|
|
|
|
|
23 |
def classify_one_image(classifier_model, dataset_to_classify):
|
24 |
|
25 |
|
|
|
90 |
|
91 |
def main():
|
92 |
|
93 |
+
|
94 |
+
COLS[0].write("# Bulk Image Classification App")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
#with CONTAINER_BODY:
|
97 |
with COLS[0]:
|
|
|
99 |
st.write("Soon we will have a dataset template")
|
100 |
|
101 |
#Model
|
102 |
+
chosen_model_name = COLS[0].selectbox(f"Select the model to use", MODELS, index=0)
|
103 |
if chosen_model_name is not None:
|
104 |
+
COLS[0].write(f"You selected", chosen_model_name)
|
105 |
|
106 |
#Dataset
|
107 |
+
shosen_dataset_name = COLS[0].selectbox(f"Select the dataset to use", DATASETS, index=0)
|
108 |
if shosen_dataset_name is not None:
|
109 |
+
COLS[0].write(f"You selected", shosen_dataset_name)
|
110 |
|
111 |
#click to classify
|
112 |
#image_object = dataset['pasta'][0]
|
|
|
118 |
COLS[0].write(f"Classification result: {classification_result}")
|
119 |
#classification_array.append(classification_result)
|
120 |
#st.write("# FLAG 6")
|
121 |
+
#st.write(classification_array)
|
122 |
+
|
123 |
if __name__ == "__main__":
|
124 |
main()
|