Spaces:
Sleeping
Sleeping
| import os | |
| os.system("pip install -r requirements.txt") | |
| import tensorflow as tf | |
| import numpy as np | |
| import gradio as gr | |
| # Load the trained model | |
| model = tf.keras.models.load_model("nn_model.h5") | |
| def predict(depression, anxiety, stress): | |
| data = np.array([[depression, anxiety, stress]]) | |
| prediction = model.predict(data) | |
| return "Internet Addicted" if prediction[0][0] >= 0.5 else "Not Addicted" | |
| iface = gr.Interface( | |
| fn=predict, | |
| inputs=["number", "number", "number"], | |
| outputs="text", | |
| title="Internet Addiction Predictor", | |
| description="Enter Depression, Anxiety, and Stress levels to predict if someone is Internet Addicted." | |
| ) | |
| iface.launch() |