Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ from processing import *
|
|
| 4 |
import pandas as pd
|
| 5 |
from indices import indices
|
| 6 |
import xgboost as xgb
|
|
|
|
| 7 |
import pickle
|
| 8 |
import json
|
| 9 |
from datetime import datetime
|
|
@@ -94,7 +95,7 @@ def predict(lat, lon):
|
|
| 94 |
# vegetation index calculation
|
| 95 |
X = indices(X)
|
| 96 |
# load the model from disk
|
| 97 |
-
filename = "data/
|
| 98 |
loaded_model = pickle.load(open(filename, 'rb'))
|
| 99 |
# make prediction
|
| 100 |
biomass = loaded_model.predict(X)[0]
|
|
@@ -120,7 +121,7 @@ article = "Created by data354."
|
|
| 120 |
|
| 121 |
# Create examples list from "examples/" directory
|
| 122 |
#example_list = [["examples/" + example] for example in os.listdir("examples")]
|
| 123 |
-
example_list = [[5.379913, -4.050445],[
|
| 124 |
|
| 125 |
outputs = [
|
| 126 |
gr.Textbox(label="Cloud coverage"),
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
from indices import indices
|
| 6 |
import xgboost as xgb
|
| 7 |
+
from lightgbm import LGBMRegressor
|
| 8 |
import pickle
|
| 9 |
import json
|
| 10 |
from datetime import datetime
|
|
|
|
| 95 |
# vegetation index calculation
|
| 96 |
X = indices(X)
|
| 97 |
# load the model from disk
|
| 98 |
+
filename = "data/new_version_model.sav"
|
| 99 |
loaded_model = pickle.load(open(filename, 'rb'))
|
| 100 |
# make prediction
|
| 101 |
biomass = loaded_model.predict(X)[0]
|
|
|
|
| 121 |
|
| 122 |
# Create examples list from "examples/" directory
|
| 123 |
#example_list = [["examples/" + example] for example in os.listdir("examples")]
|
| 124 |
+
example_list = [[5.379913, -4.050445],[5.363292, -3.9481601],[5.316458, -4.017172],[5.346938, -4.027849]]
|
| 125 |
|
| 126 |
outputs = [
|
| 127 |
gr.Textbox(label="Cloud coverage"),
|