Spaces:
Build error
Build error
done
Browse files
app.py
CHANGED
|
@@ -22,34 +22,36 @@ SCROLLABLE_TEXT = COLS[1].container(height=500)
|
|
| 22 |
def classify_full_dataset(shosen_dataset_name, chosen_model_name):
|
| 23 |
image_count = 0
|
| 24 |
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
for i in range(len(dataset)):
|
| 28 |
image_object = dataset['pasta'][i]["image"]
|
| 29 |
SCROLLABLE_TEXT.image(image_object, caption="Uploaded Image", width=300)
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
#Image teste load
|
| 37 |
-
image_object = dataset['pasta'][0]["image"]
|
| 38 |
-
SCROLLABLE_TEXT.image(image_object, caption="Uploaded Image", width=300)
|
|
|
|
| 39 |
|
| 40 |
-
#modle instance
|
| 41 |
-
classifier_pipeline = pipeline('image-classification', model=chosen_model_name)
|
| 42 |
|
| 43 |
-
|
| 44 |
-
classification_result = classifier_pipeline(image_object)
|
| 45 |
-
SCROLLABLE_TEXT.write(classification_result)
|
| 46 |
|
| 47 |
|
| 48 |
-
#TODO save classification
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
SCROLLABLE_TEXT.write(image_count)
|
| 53 |
|
| 54 |
def main():
|
| 55 |
|
|
|
|
| 22 |
def classify_full_dataset(shosen_dataset_name, chosen_model_name):
|
| 23 |
image_count = 0
|
| 24 |
|
| 25 |
+
#modle instance
|
| 26 |
+
classifier_pipeline = pipeline('image-classification', model=chosen_model_name)
|
| 27 |
+
|
| 28 |
+
#dataset
|
| 29 |
+
dataset = load_dataset(shosen_dataset_name,"testedata_readme")
|
| 30 |
|
| 31 |
for i in range(len(dataset)):
|
| 32 |
image_object = dataset['pasta'][i]["image"]
|
| 33 |
SCROLLABLE_TEXT.image(image_object, caption="Uploaded Image", width=300)
|
| 34 |
+
#classification
|
| 35 |
+
classification_result = classifier_pipeline(image_object)
|
| 36 |
+
SCROLLABLE_TEXT.write(classification_result)
|
| 37 |
+
#TODO save classification result in dataset
|
| 38 |
+
image_count += 1
|
| 39 |
+
SCROLLABLE_TEXT.write(f"Image count" + str(image_count))
|
| 40 |
+
#SCROLLABLE_TEXT.write(image_count)
|
| 41 |
+
|
| 42 |
|
| 43 |
#Image teste load
|
| 44 |
+
#image_object = dataset['pasta'][0]["image"]
|
| 45 |
+
#SCROLLABLE_TEXT.image(image_object, caption="Uploaded Image", width=300)
|
| 46 |
+
|
| 47 |
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
|
|
|
|
|
|
|
| 50 |
|
| 51 |
|
|
|
|
| 52 |
|
| 53 |
+
|
| 54 |
+
|
|
|
|
| 55 |
|
| 56 |
def main():
|
| 57 |
|