Sarvamangalak commited on
Commit
d31d0af
·
verified ·
1 Parent(s): 8b58a52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -103,12 +103,12 @@ def get_dashboard():
103
 
104
  if len(df) == 0:
105
  ax.text(0.5, 0.5, "No vehicles scanned yet",
106
- ha="center", va="center", fontsize=12)
107
  ax.axis("off")
108
  return fig
109
 
110
  counts = df["type"].value_counts()
111
- counts.plot(kind="bar", ax=ax)
112
 
113
  ax.set_title("Vehicle Classification Dashboard")
114
  ax.set_xlabel("Vehicle Type")
@@ -171,7 +171,7 @@ def visualize_prediction(img, output_dict, threshold=0.5, id2label=None):
171
 
172
  if plate_type == "EV":
173
  amount = BASE_TOLL * 0.9
174
- price_text = f"EV | ₹{amount:.0f} (10% off)"
175
  else:
176
  amount = BASE_TOLL
177
  price_text = f"{plate_type} | ₹{amount:.0f}"
@@ -248,16 +248,16 @@ with demo:
248
  with gr.TabItem('Image URL'):
249
  with gr.Row():
250
  url_input = gr.Textbox(lines=2, label='Enter valid image URL here..')
251
- original_image = gr.Image(height=400)
252
  url_input.change(get_original_image, url_input, original_image)
253
- img_output_from_url = gr.Image(height=400)
254
  dashboard_output_url = gr.Plot()
255
  url_but = gr.Button('Detect')
256
 
257
  with gr.TabItem('Image Upload'):
258
  with gr.Row():
259
- img_input = gr.Image(type='pil', height=400)
260
- img_output_from_upload = gr.Image(height=400)
261
  dashboard_output_upload = gr.Plot()
262
  img_but = gr.Button('Detect')
263
 
@@ -266,7 +266,7 @@ with demo:
266
  web_input = gr.Image(
267
  sources=["webcam"],
268
  type="pil",
269
- height=400,
270
  streaming=True
271
  )
272
  img_output_from_webcam = gr.Image(height=400)
 
103
 
104
  if len(df) == 0:
105
  ax.text(0.5, 0.5, "No vehicles scanned yet",
106
+ ha="center", va="center", fontsize=8)
107
  ax.axis("off")
108
  return fig
109
 
110
  counts = df["type"].value_counts()
111
+ counts.plot(kind="line", ax=ax)
112
 
113
  ax.set_title("Vehicle Classification Dashboard")
114
  ax.set_xlabel("Vehicle Type")
 
171
 
172
  if plate_type == "EV":
173
  amount = BASE_TOLL * 0.9
174
+ price_text = f"EV |Congratulations !! 10% off on the amount "
175
  else:
176
  amount = BASE_TOLL
177
  price_text = f"{plate_type} | ₹{amount:.0f}"
 
248
  with gr.TabItem('Image URL'):
249
  with gr.Row():
250
  url_input = gr.Textbox(lines=2, label='Enter valid image URL here..')
251
+ original_image = gr.Image(height=200)
252
  url_input.change(get_original_image, url_input, original_image)
253
+ img_output_from_url = gr.Image(height=200)
254
  dashboard_output_url = gr.Plot()
255
  url_but = gr.Button('Detect')
256
 
257
  with gr.TabItem('Image Upload'):
258
  with gr.Row():
259
+ img_input = gr.Image(type='pil', height=200)
260
+ img_output_from_upload = gr.Image(height=200)
261
  dashboard_output_upload = gr.Plot()
262
  img_but = gr.Button('Detect')
263
 
 
266
  web_input = gr.Image(
267
  sources=["webcam"],
268
  type="pil",
269
+ height=200,
270
  streaming=True
271
  )
272
  img_output_from_webcam = gr.Image(height=400)