Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,25 +20,22 @@ image = PIL.Image.open(img)
|
|
| 20 |
file=model+'_'+pre+'.skops'
|
| 21 |
loaded_model = sio.load(file)
|
| 22 |
predictions = loaded_model.predict(single_image(image,pre))
|
| 23 |
-
end_time = time.time()
|
| 24 |
-
elapsed_time_microseconds = (end_time - start_time) * 1_000_000_000
|
| 25 |
|
| 26 |
-
return
|
| 27 |
-
return result
|
| 28 |
|
| 29 |
|
| 30 |
-
# Create a Gradio interface
|
| 31 |
interface = gr.Interface(
|
| 32 |
-
fn=Classify,
|
| 33 |
inputs=[
|
| 34 |
gr.Image(type="filepath"),
|
| 35 |
gr.Radio(
|
| 36 |
-
["rgb", "hsv", "
|
| 37 |
label="Preprocessing",
|
| 38 |
info="Choose one"
|
| 39 |
)
|
| 40 |
-
|
| 41 |
-
["DT", "RF", "XGBoost"],
|
| 42 |
label="ML Model",
|
| 43 |
info="Choose one"
|
| 44 |
)
|
|
|
|
| 20 |
file=model+'_'+pre+'.skops'
|
| 21 |
loaded_model = sio.load(file)
|
| 22 |
predictions = loaded_model.predict(single_image(image,pre))
|
| 23 |
+
end_time = time.time()
|
| 24 |
+
elapsed_time_microseconds = (end_time - start_time) * 1_000_000_000
|
| 25 |
|
| 26 |
+
return predictions,(end_time - start_time) * 1_000_000_000
|
|
|
|
| 27 |
|
| 28 |
|
|
|
|
| 29 |
interface = gr.Interface(
|
| 30 |
+
fn=Classify,
|
| 31 |
inputs=[
|
| 32 |
gr.Image(type="filepath"),
|
| 33 |
gr.Radio(
|
| 34 |
+
["rgb", "hsv", "sift"],
|
| 35 |
label="Preprocessing",
|
| 36 |
info="Choose one"
|
| 37 |
)
|
| 38 |
+
["dt", "rf", "gb"],
|
|
|
|
| 39 |
label="ML Model",
|
| 40 |
info="Choose one"
|
| 41 |
)
|