Spaces:
Runtime error
Runtime error
Commit
·
bbf3945
1
Parent(s):
1b67318
back to deepmind model
Browse files
app.py
CHANGED
|
@@ -23,8 +23,8 @@ feature_extractor = ViTFeatureExtractor()
|
|
| 23 |
#feature_extractor = ViTFeatureExtractor.from_pretrained("google/vit-base-patch16-224")
|
| 24 |
|
| 25 |
#the following gets called by classify_image()
|
| 26 |
-
feature_extractor = PerceiverFeatureExtractor.from_pretrained("
|
| 27 |
-
model = PerceiverForImageClassificationConvProcessing.from_pretrained("
|
| 28 |
#google/vit-base-patch16-224, deepmind/vision-perceiver-con
|
| 29 |
image_pipe = ImageClassificationPipeline(model=model, feature_extractor=feature_extractor)
|
| 30 |
|
|
@@ -59,6 +59,7 @@ def self_caption(image):
|
|
| 59 |
print("Pred dictionary")
|
| 60 |
print(pred_dictionary)
|
| 61 |
#return(pred_dictionary)
|
|
|
|
| 62 |
return preds
|
| 63 |
|
| 64 |
|
|
|
|
| 23 |
#feature_extractor = ViTFeatureExtractor.from_pretrained("google/vit-base-patch16-224")
|
| 24 |
|
| 25 |
#the following gets called by classify_image()
|
| 26 |
+
feature_extractor = PerceiverFeatureExtractor.from_pretrained("deepmind/vision-perceiver-con")
|
| 27 |
+
model = PerceiverForImageClassificationConvProcessing.from_pretrained("deepmind/vision-perceiver-con")
|
| 28 |
#google/vit-base-patch16-224, deepmind/vision-perceiver-con
|
| 29 |
image_pipe = ImageClassificationPipeline(model=model, feature_extractor=feature_extractor)
|
| 30 |
|
|
|
|
| 59 |
print("Pred dictionary")
|
| 60 |
print(pred_dictionary)
|
| 61 |
#return(pred_dictionary)
|
| 62 |
+
preds = ' '.join(preds)
|
| 63 |
return preds
|
| 64 |
|
| 65 |
|