Spaces:
Build error
Build error
no message
Browse files
app.py
CHANGED
|
@@ -15,8 +15,8 @@ DATASETS = [
|
|
| 15 |
MAX_N_LABELS = 5
|
| 16 |
SPLIT_TO_CLASSIFY = 'pasta'
|
| 17 |
|
| 18 |
-
COLS = st.columns([
|
| 19 |
-
|
| 20 |
|
| 21 |
|
| 22 |
|
|
@@ -51,27 +51,27 @@ def classify_full_dataset(shosen_dataset_name, chosen_model_name):
|
|
| 51 |
|
| 52 |
#dataset
|
| 53 |
dataset = load_dataset(shosen_dataset_name,"testedata_readme")
|
| 54 |
-
with
|
| 55 |
#Image teste load
|
| 56 |
image_object = dataset['pasta'][0]["image"]
|
| 57 |
st.image(image_object, caption="Uploaded Image", width=300)
|
| 58 |
-
st.write("### FLAG 3")
|
| 59 |
|
| 60 |
#modle instance
|
| 61 |
classifier_pipeline = pipeline('image-classification', model=chosen_model_name)
|
| 62 |
-
COLS[1].write("### FLAG 4")
|
| 63 |
|
| 64 |
#classification
|
| 65 |
classification_result = classifier_pipeline(image_object)
|
| 66 |
-
|
| 67 |
-
COLS[1].write("### FLAG 5")
|
| 68 |
#classification_array.append(classification_result)
|
| 69 |
|
| 70 |
#save classification
|
| 71 |
|
| 72 |
image_count += 1
|
| 73 |
-
|
| 74 |
-
|
| 75 |
return image_count
|
| 76 |
|
| 77 |
|
|
@@ -92,7 +92,8 @@ def main():
|
|
| 92 |
|
| 93 |
|
| 94 |
COLS[0].write("# Bulk Image Classification App")
|
| 95 |
-
|
|
|
|
| 96 |
#with CONTAINER_BODY:
|
| 97 |
with COLS[0]:
|
| 98 |
st.markdown("This app uses several 🤗 models to classify images stored in 🤗 datasets.")
|
|
|
|
| 15 |
MAX_N_LABELS = 5
|
| 16 |
SPLIT_TO_CLASSIFY = 'pasta'
|
| 17 |
|
| 18 |
+
COLS = st.columns([0.75, 0.25])
|
| 19 |
+
SCROLLABLE_TEXT = COLS[1].text_area("Conteúdo da segunda coluna", height=500)
|
| 20 |
|
| 21 |
|
| 22 |
|
|
|
|
| 51 |
|
| 52 |
#dataset
|
| 53 |
dataset = load_dataset(shosen_dataset_name,"testedata_readme")
|
| 54 |
+
with SCROLLABLE_TEXT:
|
| 55 |
#Image teste load
|
| 56 |
image_object = dataset['pasta'][0]["image"]
|
| 57 |
st.image(image_object, caption="Uploaded Image", width=300)
|
| 58 |
+
#st.write("### FLAG 3")
|
| 59 |
|
| 60 |
#modle instance
|
| 61 |
classifier_pipeline = pipeline('image-classification', model=chosen_model_name)
|
| 62 |
+
#COLS[1].write("### FLAG 4")
|
| 63 |
|
| 64 |
#classification
|
| 65 |
classification_result = classifier_pipeline(image_object)
|
| 66 |
+
SCROLLABLE_TEXT.write(classification_result)
|
| 67 |
+
#COLS[1].write("### FLAG 5")
|
| 68 |
#classification_array.append(classification_result)
|
| 69 |
|
| 70 |
#save classification
|
| 71 |
|
| 72 |
image_count += 1
|
| 73 |
+
SCROLLABLE_TEXT.write("Image count")
|
| 74 |
+
SCROLLABLE_TEXT.write(image_count)
|
| 75 |
return image_count
|
| 76 |
|
| 77 |
|
|
|
|
| 92 |
|
| 93 |
|
| 94 |
COLS[0].write("# Bulk Image Classification App")
|
| 95 |
+
|
| 96 |
+
|
| 97 |
#with CONTAINER_BODY:
|
| 98 |
with COLS[0]:
|
| 99 |
st.markdown("This app uses several 🤗 models to classify images stored in 🤗 datasets.")
|