AbdullahAj2000 commited on
Commit
dbc3816
·
verified ·
1 Parent(s): 7f6c16e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -9
app.py CHANGED
@@ -87,23 +87,20 @@ def classify_image(input_image,model_selection):
87
 
88
  def show_preds_image(image_path,model_selection):
89
  mux_value = str(classify_image(image_path,model_selection)[0])
90
- """img = cv2.imread(image_path)
91
- img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
92
- img = cv2.resize(img, (224, 224))
93
- height, width, _ = img.shape
94
- text_x = int((width - len(mux_value) * 10) / 2)
95
- text_y = int(height / 2)
96
- font_scale = 2
97
- cv2.putText(img, mux_value, (text_x, text_y), cv2.FONT_HERSHEY_SIMPLEX, font_scale, (255, 0, 0), 2, cv2.LINE_AA)"""
98
  img = cv2.imread(image_path)
99
  img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
100
  img = cv2.resize(img, (224, 224))
 
 
 
 
101
  text_size = cv2.getTextSize(mux_value, cv2.FONT_HERSHEY_SIMPLEX, fontScale=font_scale, thickness=2)[0]
102
  text_x = 10
103
  text_y = text_size[1] + 10
 
 
104
  cv2.putText(img, mux_value, (text_x, text_y), cv2.FONT_HERSHEY_SIMPLEX, font_scale, (255, 0, 0), 2, cv2.LINE_AA)
105
 
106
-
107
  conf = (classify_image(image_path,model_selection))
108
  informations = information(mux_value)
109
 
 
87
 
88
  def show_preds_image(image_path,model_selection):
89
  mux_value = str(classify_image(image_path,model_selection)[0])
 
 
 
 
 
 
 
 
90
  img = cv2.imread(image_path)
91
  img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
92
  img = cv2.resize(img, (224, 224))
93
+ height, width, _ = img.shape
94
+ #text_x = int((width - len(mux_value) * 10) / 2)
95
+ #text_y = int(height / 2)
96
+ font_scale = 1
97
  text_size = cv2.getTextSize(mux_value, cv2.FONT_HERSHEY_SIMPLEX, fontScale=font_scale, thickness=2)[0]
98
  text_x = 10
99
  text_y = text_size[1] + 10
100
+
101
+
102
  cv2.putText(img, mux_value, (text_x, text_y), cv2.FONT_HERSHEY_SIMPLEX, font_scale, (255, 0, 0), 2, cv2.LINE_AA)
103
 
 
104
  conf = (classify_image(image_path,model_selection))
105
  informations = information(mux_value)
106