Spaces:
Runtime error
Runtime error
Update app.py
Browse files1 unmodified line234567810 unmodified lines19202122232425261 unmodified lineimport cv2import numpy as npfrom tensorflow.keras.models import load_modelfrom transformers import AutoTokenizer, get_tokenizer_config# Define class names corresponding to your datasetsclass_names = ["Ajloun Castle", "Jeresh", "Petra", "Roman amphitheater", "Umm_Qais", "Wadi_Rum"] # Replace with your actual class names10 unmodified linesvggnet_model = load_model(vggnet_model_path)inceptionv3_model = load_model(inceptionv3_model_path)# Define the tokenizer (optional for image classification, only needed for text-related tasks)tokenizer = None# Define the classify_image functiondef classify_image(img, model_choice):1 unmodified line234567810 unmodified lines19202122232425262728291 unmodified lineimport cv2import numpy as npfrom tensorflow.keras.models import load_modelfrom transformers import AutoTokenizer# Define class names corresponding to your datasetsclass_names = ["Ajloun Castle", "Jeresh", "Petra", "Roman amphitheater", "Umm_Qais", "Wadi_Rum"] # Replace with your actual class names10 unmodified linesvggnet_model = load_model(vggnet_model_path)inceptionv3_model = load_model(inceptionv3_model_path)# Define the tokenizersresnet_tokenizer = AutoTokenizer.from_pretrained("resnet_model") # Replace with the actual transformer model nameefficientnet_tokenizer = AutoTokenizer.from_pretrained("efficientnet_model")vggnet_tokenizer = AutoTokenizer.from_pretrained("vggnet_model")inceptionv3_tokenizer = AutoTokenizer.from_pretrained("inceptionv3_model")# Define the classify_image functiondef classify_image(img, model_choice):
app.py+6-3