Jyothish CHANDRASENAN commited on
Commit
75dd967
·
1 Parent(s): 4ae8fd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -113,6 +113,7 @@ def postprocessor(prediction, orig_img):
113
  img_copy = copy.deepcopy(orig_img)
114
  result_image = None
115
  text = ["A", "B"]
 
116
  for bbox in best_boxes:
117
  start_point = (int(bbox[0]), int(bbox[1]))
118
  end_point = (int(bbox[2]), int(bbox[3]))
@@ -124,10 +125,13 @@ def postprocessor(prediction, orig_img):
124
  for idx, point in enumerate(ab):
125
  x = int(point[0])
126
  y = int(point[1])
 
127
  color = (255, 0, 0)
128
- thickness = 0.5
129
  result_image = cv2.circle(result_image, (x,y), radius=0, color=color, thickness=thickness)
130
- result_image = cv2.putText(result_image,text[idx], (x-10,y+10), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,0,0), thickness, cv2.LINE_AA)
 
 
131
  return result_image
132
 
133
 
 
113
  img_copy = copy.deepcopy(orig_img)
114
  result_image = None
115
  text = ["A", "B"]
116
+ points = list()
117
  for bbox in best_boxes:
118
  start_point = (int(bbox[0]), int(bbox[1]))
119
  end_point = (int(bbox[2]), int(bbox[3]))
 
125
  for idx, point in enumerate(ab):
126
  x = int(point[0])
127
  y = int(point[1])
128
+ points.append((x,y))
129
  color = (255, 0, 0)
130
+ thickness = 1
131
  result_image = cv2.circle(result_image, (x,y), radius=0, color=color, thickness=thickness)
132
+ result_image = cv2.putText(result_image,text[idx], (x-10,y+10), cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255,0,0), thickness, cv2.LINE_AA)
133
+
134
+ result_image = cv2.line(result_image, points[0], points[1], (255,0,0), thickness)
135
  return result_image
136
 
137