Spaces:
Sleeping
Sleeping
no message
Browse files- app.py +3 -2
- requirements.txt +5 -1
app.py
CHANGED
@@ -2,7 +2,8 @@ import streamlit as st
|
|
2 |
from transformers import pipeline
|
3 |
from PIL import Image
|
4 |
from datasets import load_dataset, Image
|
5 |
-
from PIL import Image
|
|
|
6 |
|
7 |
MODELS = [
|
8 |
"google/vit-base-patch16-224", #Classifição geral
|
@@ -34,7 +35,7 @@ def classify_full_dataset(shosen_dataset_name, chosen_model_name):
|
|
34 |
SCROLLABLE_TEXT.write("i-1:" + str(i-1))
|
35 |
image_object = dataset['pasta'][i-1]["image"]
|
36 |
SCROLLABLE_TEXT.image(image_object, caption="Uploaded Image", width=300)
|
37 |
-
extract_metadata =
|
38 |
SCROLLABLE_TEXT.write(extract_metadata)
|
39 |
#classification
|
40 |
classification_result = classifier_pipeline(image_object)
|
|
|
2 |
from transformers import pipeline
|
3 |
from PIL import Image
|
4 |
from datasets import load_dataset, Image
|
5 |
+
from PIL import Image, ExifTags
|
6 |
+
|
7 |
|
8 |
MODELS = [
|
9 |
"google/vit-base-patch16-224", #Classifição geral
|
|
|
35 |
SCROLLABLE_TEXT.write("i-1:" + str(i-1))
|
36 |
image_object = dataset['pasta'][i-1]["image"]
|
37 |
SCROLLABLE_TEXT.image(image_object, caption="Uploaded Image", width=300)
|
38 |
+
extract_metadata = { ExifTags.TAGS[k]: v for k, v in img._getexif().items() if k in ExifTags.TAGS }
|
39 |
SCROLLABLE_TEXT.write(extract_metadata)
|
40 |
#classification
|
41 |
classification_result = classifier_pipeline(image_object)
|
requirements.txt
CHANGED
@@ -5,4 +5,8 @@ datasets
|
|
5 |
datasets[vision]
|
6 |
torch
|
7 |
tensorflow
|
8 |
-
huggingface_hub
|
|
|
|
|
|
|
|
|
|
5 |
datasets[vision]
|
6 |
torch
|
7 |
tensorflow
|
8 |
+
huggingface_hub
|
9 |
+
pip
|
10 |
+
Pillow
|
11 |
+
defusedxml
|
12 |
+
olefile
|