AI4SAR_space / app.py
stummala521's picture
tst inference
9e6875e
raw
history blame
654 Bytes
import gradio as gr
import joblib
import requests
import os
# Download the model file
model_url = "https://huggingface.co/stummala521/AI4SAR/resolve/main/model.pkl"
local_filename = "model.pkl"
# Download the file
response = requests.get(model_url, allow_redirects=True)
with open(local_filename, 'wb') as f:
f.write(response.content)
# Load the model
model = joblib.load(local_filename)
test_data = {
"location_found_elevation": 1500,
"situation": "lost"
}
output = model.predict([test_data])
def greet(name):
return "Hello " + name + "!" + str(output[0])
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()