Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,13 @@ from transformers import pipeline
|
|
3 |
from transformers import ViTFeatureExtractor, ViTForImageClassification
|
4 |
from PIL import Image
|
5 |
import requests
|
|
|
6 |
|
7 |
img_file_buffer = st.file_uploader('Upload a PNG image', type='png')
|
8 |
if img_file_buffer is not None:
|
9 |
-
image = Image.open(img_file_buffer)
|
|
|
|
|
10 |
|
11 |
feature_extractor = ViTFeatureExtractor.from_pretrained('rizvandwiki/gender-classification')
|
12 |
model = ViTForImageClassification.from_pretrained('rizvandwiki/gender-classification')
|
|
|
3 |
from transformers import ViTFeatureExtractor, ViTForImageClassification
|
4 |
from PIL import Image
|
5 |
import requests
|
6 |
+
import numpy as np
|
7 |
|
8 |
img_file_buffer = st.file_uploader('Upload a PNG image', type='png')
|
9 |
if img_file_buffer is not None:
|
10 |
+
image = Image.open(img_file_buffer)
|
11 |
+
image_array=np.array(image)
|
12 |
+
print("Image_array.shape:",image_array.shape)
|
13 |
|
14 |
feature_extractor = ViTFeatureExtractor.from_pretrained('rizvandwiki/gender-classification')
|
15 |
model = ViTForImageClassification.from_pretrained('rizvandwiki/gender-classification')
|