Spaces:
Runtime error
Runtime error
Update app.py
Browse files17 unmodified lines18192021222326 unmodified lines505152535455561 unmodified line5859606162636465664 unmodified lines7172737475767717 unmodified linesResNet_model = load_model(ResNet_path)Efficient_model = load_model(EfficientNet_path)history=[]def classify_selected_model(image, model_name):try:26 unmodified lineserror_message = f"Error: {str(e)}"return None, None, Noneimage_input = gr.Image(type='filepath', label="Input Image")model_dropdown = gr.Dropdown(["ResNet", "EfficientNet", "VGGNet", "InceptionV3"], label="Select Model")1 unmodified lineiface = gr.Interface(fn=classify_selected_model,inputs=[image_input, model_dropdown ,],outputs=[gr.Label(value="Archaeological Site")],# 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",17 unmodified lines18192021222324252627282930313233343536373839404126 unmodified lines686970717273747576777879808182838485868788891 unmodified line9192939495969798991004 unmodified lines10510610710810911011117 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 linkhistory=[]def classify_selected_model(image, model_name):try:26 unmodified lineserror_message = f"Error: {str(e)}"return None, None, Noneinfo = 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 lineiface = gr.Interface(fn=classify_selected_model,inputs=[image_input, model_dropdown ,gr.Text(["Ajloun","Jeresh","Umm Qais","Petra","Roman Amphitheater","Wadi Rum"]],outputs=[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"]] ,live=True,title="Image Classification for Archaeological Sites Interface",
app.py+38-4