Fareskh12 commited on
Commit
4e0aadf
·
verified ·
1 Parent(s): df7792c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
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() # Record end time
24
- elapsed_time_microseconds = (end_time - start_time) * 1_000_000_000 # Calculate elapsed time in microseconds
25
 
26
- return f"{elapsed_time_microseconds/factor:.2f} ns",f"{elapsed_time_microseconds/1000:.2f} μs",factor, result
27
- return result
28
 
29
 
30
- # Create a Gradio interface
31
  interface = gr.Interface(
32
- fn=Classify, # Reference to the function
33
  inputs=[
34
  gr.Image(type="filepath"),
35
  gr.Radio(
36
- ["rgb", "hsv", "BoVW"],
37
  label="Preprocessing",
38
  info="Choose one"
39
  )
40
- # Input for sorting methodgr.Radio(
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
  )