Spaces:
Runtime error
Runtime error
Update app.py
Browse files17 unmodified lines18192021222324252627282930313233343536373839404126 unmodified lines68697071727374757677785379808182838485868788891 unmodified line91929361949563969798991004 unmodified lines1051061077410810911011117 unmodified linesResNet_model = load_model(ResNet_path)Efficient_model = load_model(EfficientNet_path)
def classes(class_name): if class_name == "Ajloun Castle": link = "https://ar.tripadvisor.com/Attraction_Review-g293988-d1549575-Reviews-Ajloun_Castle-Jerash_Jerash_Governorate.html" elif class_name == "Jerash": link ="https://ar.tripadvisor.com/Tourism-g293988-Jerash_Jerash_Governorate-Vacations.html" elif class_name == "Petra": link ="https://ar.tripadvisor.com/Tourism-g318895-Petra_Wadi_Musa_Ma_an_Governorate-Vacations.html" elif class_name == "Roman amphitheater": link ="https://ar.tripadvisor.com/Attraction_Review-g295398-d553291-Reviews-Ancient_Roman_Amphitheater-Alexandria_Alexandria_Governorate.html" elif class_name == "Umm Qais": link = "https://ar.tripadvisor.com/Tourism-g318874-Umm_Qais_Irbid_Governorate-Vacations.html" elif class_name == "Wadi Rum": link = "https://ar.tripadvisor.com/Tourism-g303973-Wadi_Rum_Al_Aqabah_Governorate-Vacations.html" return link
history=[]def classify_selected_model(image, model_name): try:26 unmodified lines error_message = f"Error: {str(e)}" return None, None, None info = f''' <!DOCTYPE html> <html> <head> <title>Links</title> </head> <body> <h1>Useful Links</h1> <ul> <li><a href="{links[0]}" target="_blank">{links[0]}</a></li> </ul> </body> </html> '''
image_input = gr.Image(type='filepath', label="Input Image")model_dropdown = gr.Dropdown(["ResNet", "EfficientNet", "VGGNet", "InceptionV3"], label="Select Model")1 unmodified line
iface = gr.Interface( fn=classify_selected_model, inputs=[image_input, model_dropdown ,], inputs=[image_input, model_dropdown ,gr.Text(["Ajloun","Jeresh","Umm Qais","Petra","Roman Amphitheater","Wadi Rum"]], outputs=[ gr.Label(value="Archaeological Site")], gr.Label(value="Archaeological Site"), gr.HTML(type='html', label="Useful Links")], # gr.Label(value="Probability"), # result_textbox], 4 unmodified lines ["Sites/Petra.png"], ["Sites/Roman Amphitheater.png"], ["Sites/Wadi Rum.png"]] , gr.Interface(gr.Text(["Ajloun","Jeresh","Umm Qais","Petra","Roman Amphitheater","Wadi Rum"])), live=True, title="Image Classification for Archaeological Sites Interface",app.py+38-4