Sarvamangalak commited on
Commit
0db392c
·
verified ·
1 Parent(s): f73ac0b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -56,20 +56,20 @@ def visualize_prediction(img, output_dict, threshold=0.5, id2label=None):
56
  ax = plt.gca()
57
  colors = COLORS * 100
58
  for score, (xmin, ymin, xmax, ymax), label, color in zip(scores, boxes, labels, colors):
59
- if label == 'license-plates':
60
 
61
- # Crop plate
62
- plate_crop = img.crop((xmin, ymin, xmax, ymax))
63
 
64
- # Check EV
65
- ev = is_green_plate(plate_crop)
66
 
67
- if ev:
68
- plate_type = "EV (Green Plate)"
69
- box_color = "green"
70
- else:
71
- plate_type = "Non-EV Plate"
72
- box_color = "red"
73
 
74
  ax.add_patch(
75
  plt.Rectangle((xmin, ymin), xmax - xmin, ymax - ymin,
 
56
  ax = plt.gca()
57
  colors = COLORS * 100
58
  for score, (xmin, ymin, xmax, ymax), label, color in zip(scores, boxes, labels, colors):
59
+ if label == 'license-plates':
60
 
61
+ # Crop plate
62
+ plate_crop = img.crop((xmin, ymin, xmax, ymax))
63
 
64
+ # Check EV
65
+ ev = is_green_plate(plate_crop)
66
 
67
+ if ev:
68
+ plate_type = "EV (Green Plate)"
69
+ box_color = "green"
70
+ else:
71
+ plate_type = "Non-EV Plate"
72
+ box_color = "red"
73
 
74
  ax.add_patch(
75
  plt.Rectangle((xmin, ymin), xmax - xmin, ymax - ymin,