Spaces:
Sleeping
Sleeping
Update app.py
Browse files14 unmodified lines1516171819202111 unmodified lines3334353637383910 unmodified lines50515251535455563 unmodified lines6061626162636465666714 unmodified lines# --- Load the Model ---print("[INFO] Attempting to load the trained model from: {}".format(MODEL_PATH))try: # We must tell load_model what 'K' means in our custom layers. model = load_model(MODEL_PATH, custom_objects={"K": K}) print("[SUCCESS] Model loaded successfully into memory.")except Exception as e:11 unmodified lines return {"Error": 1.0} print("[INFO] Received image for prediction.") # Preprocess the image exactly as the model expects image = input_image.convert("RGB").resize((IMAGE_SIZE, IMAGE_SIZE)) image_array = np.asarray(image) image_array = image_array / 255.010 unmodified lines# ==============================================================================print("[INFO] Creating Gradio Blocks interface...")
# Define the HTML for our custom-styled description# Define the HTML for our custom-styled description for centering and font sizedescription_html = """<div style="text-align: center; font-size: 16px;">Lightweight CNN for Fire Detection with Integrated Hybrid Attention: A Depthwise-Driven Approach for Embedded Systems<br>3 unmodified lines"""
# Build the interface component by componentwith gr.Blocks(theme=gr.themes.Soft()) as demo: # Title (using your new name)with gr.Blocks() as demo: # Removed the 'theme' parameter for compatibility # Title gr.Markdown( """ <h1 style="text-align: center;">🔥 HyFiNet 🔥</h1>app.py+5-3