IDubrovsky
commited on
Commit
•
27db21d
1
Parent(s):
eeaddcc
final
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ from PIL import Image
|
|
6 |
|
7 |
def predict(m_cloth, v_w, v_m, v_k, v_b, m_al, m_cu, m_fe, m_tan, time, pH):
|
8 |
xgb = pickle.load(open('xgb.ckpt', 'rb'))
|
9 |
-
print(xgb)
|
10 |
v_sum = v_w + v_m + v_k + v_b
|
11 |
X = pd.DataFrame({'m_cloth': m_cloth, 'v_w': v_w / v_sum, 'v_m': v_m / v_sum, 'v_k': v_k / v_sum, 'v_b': v_b / v_sum, 'm_al': m_al, 'm_cu': m_cu, 'm_fe': m_fe, 'm_tan': m_tan, 'time': time, 'pH': pH}, index = [0])
|
12 |
y = xgb.predict(X)
|
@@ -77,4 +76,4 @@ with gr.Blocks() as demo:
|
|
77 |
gr.Image(label="Color image", height = 500, width = 500)]
|
78 |
button = gr.Button()
|
79 |
button.click(fn=predict, inputs=inp, outputs=out)
|
80 |
-
demo.launch(
|
|
|
6 |
|
7 |
def predict(m_cloth, v_w, v_m, v_k, v_b, m_al, m_cu, m_fe, m_tan, time, pH):
|
8 |
xgb = pickle.load(open('xgb.ckpt', 'rb'))
|
|
|
9 |
v_sum = v_w + v_m + v_k + v_b
|
10 |
X = pd.DataFrame({'m_cloth': m_cloth, 'v_w': v_w / v_sum, 'v_m': v_m / v_sum, 'v_k': v_k / v_sum, 'v_b': v_b / v_sum, 'm_al': m_al, 'm_cu': m_cu, 'm_fe': m_fe, 'm_tan': m_tan, 'time': time, 'pH': pH}, index = [0])
|
11 |
y = xgb.predict(X)
|
|
|
76 |
gr.Image(label="Color image", height = 500, width = 500)]
|
77 |
button = gr.Button()
|
78 |
button.click(fn=predict, inputs=inp, outputs=out)
|
79 |
+
demo.launch()
|